mirror of https://github.com/python/cpython
Revert r79384 (the fix failed).
This commit is contained in:
parent
fb224e3034
commit
2c6799ab8c
|
@ -315,21 +315,12 @@ if ssl is not None:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
ssl_want_read_or_write = False
|
|
||||||
try:
|
try:
|
||||||
if isinstance(self.socket, ssl.SSLSocket):
|
if isinstance(self.socket, ssl.SSLSocket):
|
||||||
if self.socket._sslobj is not None:
|
if self.socket._sslobj is not None:
|
||||||
try:
|
self.socket.unwrap()
|
||||||
self.socket.unwrap()
|
|
||||||
except ssl.SSLError, err:
|
|
||||||
if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
|
|
||||||
ssl.SSL_ERROR_WANT_WRITE):
|
|
||||||
ssl_want_read_or_write = True
|
|
||||||
else:
|
|
||||||
raise
|
|
||||||
finally:
|
finally:
|
||||||
if not ssl_want_read_or_write:
|
super(SSLConnection, self).close()
|
||||||
super(SSLConnection, self).close()
|
|
||||||
|
|
||||||
|
|
||||||
class DummyTLS_DTPHandler(SSLConnection, DummyDTPHandler):
|
class DummyTLS_DTPHandler(SSLConnection, DummyDTPHandler):
|
||||||
|
|
Loading…
Reference in New Issue