diff options
author | Guido van Rossum <guido@dropbox.com> | 2013-10-30 21:36:58 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@dropbox.com> | 2013-10-30 21:36:58 (GMT) |
commit | 1f683bbe71480e652c6be75cb88426aa6a7507a9 (patch) | |
tree | fd15406ede4de1a2aa2b49848284c27b4b9cb2a1 /Lib | |
parent | 4574b49703785081262f65df59c1a630242e506f (diff) | |
download | cpython-1f683bbe71480e652c6be75cb88426aa6a7507a9.zip cpython-1f683bbe71480e652c6be75cb88426aa6a7507a9.tar.gz cpython-1f683bbe71480e652c6be75cb88426aa6a7507a9.tar.bz2 |
asyncio: When not closing the connection after receiving EOF, still remove the read handler.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/asyncio/selector_events.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py index 6cffdd4..c296dcc 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): |