diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2016-05-20 15:31:40 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2016-05-20 15:31:40 (GMT) |
commit | 3dc5129d4fd26d97c1cd8176f6e085db99e38036 (patch) | |
tree | 70ae270c2ab5422fe90923b123de6900db53a265 /Lib/asyncio/streams.py | |
parent | b0d43ce890adbcfea2e1dff7ba6e76c5c046b61c (diff) | |
download | cpython-3dc5129d4fd26d97c1cd8176f6e085db99e38036.zip cpython-3dc5129d4fd26d97c1cd8176f6e085db99e38036.tar.gz cpython-3dc5129d4fd26d97c1cd8176f6e085db99e38036.tar.bz2 |
asyncio: Fix an SSL warning in StreamReaderProtocol.eof_received
Diffstat (limited to 'Lib/asyncio/streams.py')
-rw-r--r-- | Lib/asyncio/streams.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index 0345a3d..6f465af 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -225,9 +225,11 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): self._stream_reader = stream_reader self._stream_writer = None self._client_connected_cb = client_connected_cb + self._over_ssl = False def connection_made(self, transport): self._stream_reader.set_transport(transport) + self._over_ssl = transport.get_extra_info('sslcontext') is not None if self._client_connected_cb is not None: self._stream_writer = StreamWriter(transport, self, self._stream_reader, @@ -252,6 +254,11 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): def eof_received(self): self._stream_reader.feed_eof() + if self._over_ssl: + # Prevent a warning in SSLProtocol.eof_received: + # "returning true from eof_received() + # has no effect when using ssl" + return False return True |