diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-03-10 16:27:01 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2018-03-10 16:27:01 (GMT) |
commit | bf0d1165174e8347b4d3a731c4e47e8288f1d01b (patch) | |
tree | d19a0f86a7fa49d12644e7a1a6276ba09d0dcc9e /Lib/asyncio/sslproto.py | |
parent | 89090789debb9d76892af566277cb71740808945 (diff) | |
download | cpython-bf0d1165174e8347b4d3a731c4e47e8288f1d01b.zip cpython-bf0d1165174e8347b4d3a731c4e47e8288f1d01b.tar.gz cpython-bf0d1165174e8347b4d3a731c4e47e8288f1d01b.tar.bz2 |
bpo-33037: Skip sending/receiving after SSL transport closing (GH-6044) (GH-6057)
* Skip write()/data_received() if sslpipe is destroyed
(cherry picked from commit 5e80a71ab67045fecec46573a1892e240b569ace)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
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 863b543..2bbf134 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -504,6 +504,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: @@ -636,7 +640,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: |