mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
bpo-35065: Remove StreamReaderProtocol._untrack_reader
(#10212)
The call to `_untrack_reader` is performed too soon, causing the protocol to forget about the reader before `connection_lost` can run and feed the EOF to the reader. See bpo-35065.
This commit is contained in:
parent
5d95312fb8
commit
fd512d7645
4 changed files with 26 additions and 11 deletions
|
@ -227,9 +227,6 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
|
|||
self._reject_connection = True
|
||||
self._stream_reader_wr = None
|
||||
|
||||
def _untrack_reader(self):
|
||||
self._stream_reader_wr = None
|
||||
|
||||
@property
|
||||
def _stream_reader(self):
|
||||
if self._stream_reader_wr is None:
|
||||
|
@ -345,9 +342,6 @@ class StreamWriter:
|
|||
return self._transport.can_write_eof()
|
||||
|
||||
def close(self):
|
||||
# a reader can be garbage collected
|
||||
# after connection closing
|
||||
self._protocol._untrack_reader()
|
||||
self._transport.close()
|
||||
|
||||
def is_closing(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue