diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2015-03-04 19:54:57 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2015-03-04 19:54:57 (GMT) |
commit | 0bfd0a40486d1eac92572e7272d25e3e405b7aef (patch) | |
tree | d04df6c3a939b9d2a00869cf99098bc8f67213ee /Modules | |
parent | 9672da7bb44de9f71880f8daed14a4faff63c570 (diff) | |
parent | f7f3b0a14a63ca355097fa2ee546d20888e39faa (diff) | |
download | cpython-0bfd0a40486d1eac92572e7272d25e3e405b7aef.zip cpython-0bfd0a40486d1eac92572e7272d25e3e405b7aef.tar.gz cpython-0bfd0a40486d1eac92572e7272d25e3e405b7aef.tar.bz2 |
Issue #23576: Avoid stalling in SSL reads when EOF has been reached in the SSL layer but the underlying connection hasn't been closed.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ssl.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 0e6abda..4f23097 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1841,26 +1841,6 @@ static PyObject *PySSL_SSLread(PySSLSocket *self, PyObject *args) BIO_set_nbio(SSL_get_wbio(self->ssl), nonblocking); } - /* first check if there are bytes ready to be read */ - PySSL_BEGIN_ALLOW_THREADS - count = SSL_pending(self->ssl); - PySSL_END_ALLOW_THREADS - - if (!count) { - sockstate = check_socket_and_wait_for_timeout(sock, 0); - if (sockstate == SOCKET_HAS_TIMED_OUT) { - PyErr_SetString(PySocketModule.timeout_error, - "The read operation timed out"); - goto error; - } else if (sockstate == SOCKET_TOO_LARGE_FOR_SELECT) { - PyErr_SetString(PySSLErrorObject, - "Underlying socket too large for select()."); - goto error; - } else if (sockstate == SOCKET_HAS_BEEN_CLOSED) { - count = 0; - goto done; - } - } do { PySSL_BEGIN_ALLOW_THREADS count = SSL_read(self->ssl, mem, len); |