diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2018-03-10 17:09:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-10 17:09:07 (GMT) |
commit | 017e9fda922a143ac9f1601cbde05e80214852d2 (patch) | |
tree | b4c36ddbf7fc4cb4ef33083e9231f205dc5f8f64 /Lib/asyncio/sslproto.py | |
parent | de8567e38c44b1509f0b906aec54437256848f14 (diff) | |
download | cpython-017e9fda922a143ac9f1601cbde05e80214852d2.zip cpython-017e9fda922a143ac9f1601cbde05e80214852d2.tar.gz cpython-017e9fda922a143ac9f1601cbde05e80214852d2.tar.bz2 |
[3.6] bpo-33037: Skip sending/receiving after SSL transport closing (GH-6044) (GH-6058)
* Skip write()/data_received() if sslpipe is destroyed.
(cherry picked from commit 5e80a71ab67045fecec46573a1892e240b569ace)
Diffstat (limited to 'Lib/asyncio/sslproto.py')
-rw-r--r-- | Lib/asyncio/sslproto.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index f4d8a48..a82babb 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -497,6 +497,10 @@ class SSLProtocol(protocols.Protocol): The argument is a bytes object. """ + if self._sslpipe is None: + # transport closing, sslpipe is destroyed + return + try: ssldata, appdata = self._sslpipe.feed_ssldata(data) except ssl.SSLError as e: @@ -626,7 +630,7 @@ class SSLProtocol(protocols.Protocol): def _process_write_backlog(self): # Try to make progress on the write backlog. - if self._transport is None: + if self._transport is None or self._sslpipe is None: return try: |