[Python-bugs-list] [ python-Bugs-458839 ] SSL errno wrong under Windows (original) (raw)

noreply@sourceforge.net noreply@sourceforge.net
Thu, 11 Oct 2001 10:28:08 -0700


Bugs item #458839, was opened at 2001-09-05 12:05 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458839&group_id=5470

Category: Python Library Group: Python 2.1.1 Status: Open Resolution: None Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Jeremy Hylton (jhylton) Summary: SSL errno wrong under Windows

Initial Comment: in socketmodule.c, routine SSL_SSLread(), lines 2348 and 2355:

return PyErr_SetFromErrno(PySocket_Error);

does not work under Windows; as elsewhere:

return PySocket_Err();

should be used instead.

In addition, if SSL_read() returns SSL_ERROR_SYSCALL, errno will not be set correctly if an EOF is the cause of this return code. Add something like:

case SSL_ERROR_SYSCALL: if (ERR_get_error() == 0 && count == 0) { v = Py_BuildValue("(is)", -1, "Protocol violation: unexpected EOF"); if (v != NULL) { PyErr_SetObject(PySocket_Error, v); Py_DECREF(v); } return NULL; } else { return PySocket_Err(); } break;


Comment By: Jeremy Hylton (jhylton) Date: 2001-10-11 10:28

Message: Logged In: YES user_id=31392

Fixed in rev. 1.178 of socketmodule.c


Comment By: Gerhard H�ring (ghaering) Date: 2001-10-10 16:48

Message: Logged In: YES user_id=163326

My patch #462759 tries to fix this problem.


You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=458839&group_id=5470