From df71fc012575cac0c0c050a8f1febf1438f8fdd7 Mon Sep 17 00:00:00 2001 From: Anthony Baxter Date: Thu, 1 Nov 2001 14:25:38 +0000 Subject: [PATCH] wrap SSL_read and SSL_write in Py_{BEGIN,END}_ALLOW_THREADS. other half of backport of guido's 1.188 --- Modules/socketmodule.c | 4 ++++ 1 file changed, 4 insertions(+) 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) { -- 2.47.3