diff Modules/socketmodule.c @ 16400:166e87836e8e legacy-trunk

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.
author Jeremy Hylton <jeremy@alum.mit.edu>
date Thu, 01 Feb 2001 23:35:20 +0000
parents 28c414dcb3e1
children 3d4a7cd0bf17
line wrap: on
line diff
--- a/Modules/socketmodule.c	Thu Feb 01 22:53:15 2001 +0000
+++ b/Modules/socketmodule.c	Thu Feb 01 23:35:20 2001 +0000
@@ -2165,17 +2165,14 @@
 	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);