summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-02-01 23:35:20 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-02-01 23:35:20 (GMT)
commit42dd01add5cc53dc5a5eab46b04b44c8ef6c969f (patch)
tree3df3f376a6246daf649d5cb078a145f29efe409f /Modules
parent0072d5aa33eb84cb17e63d4dee255e1d1262f52e (diff)
downloadcpython-42dd01add5cc53dc5a5eab46b04b44c8ef6c969f.zip
cpython-42dd01add5cc53dc5a5eab46b04b44c8ef6c969f.tar.gz
cpython-42dd01add5cc53dc5a5eab46b04b44c8ef6c969f.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/socketmodule.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index b3571a5..9b6300c 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -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);