]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
wrap SSL_read and SSL_write in Py_{BEGIN,END}_ALLOW_THREADS.
authorAnthony Baxter <anthonybaxter@gmail.com>
Thu, 1 Nov 2001 14:25:38 +0000 (14:25 +0000)
committerAnthony Baxter <anthonybaxter@gmail.com>
Thu, 1 Nov 2001 14:25:38 +0000 (14:25 +0000)
other half of backport of guido's 1.188

Modules/socketmodule.c

index 37a167444a53f7fac733a8a8d214532d95f5692c..e1b69d469dfeb99acd3b3a2875c3ffbaf4eb71c2 100644 (file)
@@ -2331,7 +2331,9 @@ static PyObject *SSL_SSLwrite(SSLObject *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "s#:write", &data, &len))
                return NULL;
 
+       Py_BEGIN_ALLOW_THREADS
        len = SSL_write(self->ssl, data, len);
+       Py_END_ALLOW_THREADS
        return PyInt_FromLong((long)len);
 }
 
@@ -2347,7 +2349,9 @@ static PyObject *SSL_SSLread(SSLObject *self, PyObject *args)
        if (!(buf = PyString_FromStringAndSize((char *) 0, len)))
                return NULL;    /* Error object should already be set */
 
+       Py_BEGIN_ALLOW_THREADS
        count = SSL_read(self->ssl, PyString_AsString(buf), len);
+       Py_END_ALLOW_THREADS
        res = SSL_get_error(self->ssl, count);
 
        switch (res) {