summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/sslproto.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2018-03-10 17:09:07 (GMT)
committerGitHub <noreply@github.com>2018-03-10 17:09:07 (GMT)
commit017e9fda922a143ac9f1601cbde05e80214852d2 (patch)
treeb4c36ddbf7fc4cb4ef33083e9231f205dc5f8f64 /Lib/asyncio/sslproto.py
parentde8567e38c44b1509f0b906aec54437256848f14 (diff)
downloadcpython-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.py6
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: