]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #803998: Correctly check for error in SSL_write.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 27 Oct 2003 14:24:41 +0000 (14:24 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 27 Oct 2003 14:24:41 +0000 (14:24 +0000)
Misc/NEWS
Modules/_ssl.c

index d36d360d1bb90e37b129af2d97cb30c6f107d4f0..526943834742e3d77c9c532059ed84b49f1de0f5 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -18,6 +18,8 @@ Core and builtins
 Extension modules
 -----------------
 
+- Patch #803998: Deal with errors in SSL_write correctly.
+
 - The xml.parsers.expat module now provides Expat 1.95.7.
 
 - Patch #813445: Add missing socket.IPPROTO_IPV6.
index b338aeafe1a177fb55447ec8883cda0ed4888ce5..5fcf84ca2e9e97d505ae8d8d81a5f18451ced715 100644 (file)
@@ -373,10 +373,11 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
 {
        char *data;
        int len;
+       int count;
        int timedout;
        int err;
 
-       if (!PyArg_ParseTuple(args, "s#:write", &data, &len))
+       if (!PyArg_ParseTuple(args, "s#:write", &data, &count))
                return NULL;
 
        timedout = wait_for_timeout(self->Socket, 1);
@@ -387,7 +388,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
        do {
                err = 0;
                Py_BEGIN_ALLOW_THREADS
-               len = SSL_write(self->ssl, data, len);
+               len = SSL_write(self->ssl, data, count);
                err = SSL_get_error(self->ssl, len);
                Py_END_ALLOW_THREADS
                if(PyErr_CheckSignals()) {