From 4b2725df006ae172f267072a8bcb222b6be6aad9 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Tue, 20 Sep 2022 10:09:43 -0400 Subject: [PATCH] Try to prevent leaking timeouts. --- src/allmydata/protocol_switch.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/allmydata/protocol_switch.py b/src/allmydata/protocol_switch.py index 89570436c..a17f3055c 100644 --- a/src/allmydata/protocol_switch.py +++ b/src/allmydata/protocol_switch.py @@ -151,6 +151,10 @@ class _FoolscapOrHttps(Protocol, metaclass=_PretendToBeNegotiation): 30, self.transport.abortConnection ) + def connectionLost(self, reason): + if self._timeout.active(): + self._timeout.cancel() + def dataReceived(self, data: bytes) -> None: """Handle incoming data.