From b2c6691a88a61df7f6f65ef16da374c40000176c Mon Sep 17 00:00:00 2001 From: Delta Regeer Date: Sun, 3 Mar 2024 16:26:22 -0700 Subject: Don't exit handle_write early -- even if socket is not connected Calling handle_close() multiple times does not hurt anything, and is safe. --- src/waitress/channel.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/waitress/channel.py b/src/waitress/channel.py index bc9a2bb..4a5ce3a 100644 --- a/src/waitress/channel.py +++ b/src/waitress/channel.py @@ -90,9 +90,6 @@ class HTTPChannel(wasyncore.dispatcher, object): def handle_write(self): # Precondition: there's data in the out buffer to be sent, or # there's a pending will_close request - if not self.connected: - # we dont want to close the channel twice - return # try to flush any pending output if not self.requests: -- 2.30.2