From: Guido van Rossum Date: Wed, 30 Oct 2013 21:36:58 +0000 (-0700) Subject: asyncio: When not closing the connection after receiving EOF, still remove the read... X-Git-Tag: v3.4.0b1~465 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1f683bbe71480e652c6be75cb88426aa6a7507a9;p=thirdparty%2FPython%2Fcpython.git asyncio: When not closing the connection after receiving EOF, still remove the read handler. --- diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 6cffdd4e3540..c296dccb2d34 100644 --- a/Lib/asyncio/selector_events.py +++ b/Lib/asyncio/selector_events.py @@ -468,7 +468,12 @@ class _SelectorSocketTransport(_SelectorTransport): self._protocol.data_received(data) else: keep_open = self._protocol.eof_received() - if not keep_open: + if keep_open: + # We're keeping the connection open so the + # protocol can write more, but we still can't + # receive more, so remove the reader callback. + self._loop.remove_reader(self._sock_fd) + else: self.close() def write(self, data):