mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
An ssl-wrapped socket now returns '' on EOF, just like a regular
socket -- as suggested by Clarence Gardner. Fix httplib to comply with the new ssl-socket interface.
This commit is contained in:
parent
0072d5aa33
commit
42dd01add5
2 changed files with 11 additions and 10 deletions
|
@ -2165,17 +2165,14 @@ static PyObject *SSL_SSLread(SSLObject *self, PyObject *args)
|
|||
res = SSL_get_error(self->ssl, count);
|
||||
|
||||
switch (res) {
|
||||
case 0: /* Good return value! */
|
||||
case SSL_ERROR_NONE:
|
||||
assert(count > 0);
|
||||
break;
|
||||
case 6:
|
||||
PyErr_SetString(SSLErrorObject, "EOF");
|
||||
Py_DECREF(buf);
|
||||
return NULL;
|
||||
case SSL_ERROR_ZERO_RETURN: /* normal EOF */
|
||||
assert(count == 0);
|
||||
break;
|
||||
case 5:
|
||||
default:
|
||||
return PyErr_SetFromErrno(SSLErrorObject);
|
||||
break;
|
||||
}
|
||||
|
||||
fflush(stderr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue