From: Anthony Baxter Date: Thu, 1 Nov 2001 14:25:38 +0000 (+0000) Subject: wrap SSL_read and SSL_write in Py_{BEGIN,END}_ALLOW_THREADS. X-Git-Tag: v2.1.2c1~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df71fc012575cac0c0c050a8f1febf1438f8fdd7;p=thirdparty%2FPython%2Fcpython.git wrap SSL_read and SSL_write in Py_{BEGIN,END}_ALLOW_THREADS. other half of backport of guido's 1.188 --- diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 37a167444a53..e1b69d469dfe 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -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) {