[Python-checkins] python/dist/src/Modules _ssl.c,1.11,1.12
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Sat, 28 Jun 2003 00:40:27 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv28637
Modified Files:
_ssl.c
Log Message:
Patch #751916: Check for signals, fix some refcounting errors.
Index: _ssl.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_ssl.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** _ssl.c 2 Feb 2003 17:08:33 -0000 1.11
--- _ssl.c 28 Jun 2003 07:40:23 -0000 1.12
***************
*** 246,249 ****
--- 246,252 ----
err = SSL_get_error(self->ssl, ret);
Py_END_ALLOW_THREADS
+ if(PyErr_CheckSignals()) {
+ goto fail;
+ }
if (err == SSL_ERROR_WANT_READ) {
timedout = wait_for_timeout(Sock, 0);
***************
*** 252,257 ****
}
if (timedout) {
! PyErr_SetString(PySSLErrorObject, "The connect operation timed out");
! return NULL;
}
} while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE);
--- 255,260 ----
}
if (timedout) {
! errstr = "The connect operation timed out";
! goto fail;
}
} while (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE);
***************
*** 388,391 ****
--- 391,397 ----
err = SSL_get_error(self->ssl, len);
Py_END_ALLOW_THREADS
+ if(PyErr_CheckSignals()) {
+ return NULL;
+ }
if (err == SSL_ERROR_WANT_READ) {
timedout = wait_for_timeout(self->Socket, 0);
***************
*** 435,438 ****
--- 441,448 ----
err = SSL_get_error(self->ssl, count);
Py_END_ALLOW_THREADS
+ if(PyErr_CheckSignals()) {
+ Py_DECREF(buf);
+ return NULL;
+ }
if (err == SSL_ERROR_WANT_READ) {
timedout = wait_for_timeout(self->Socket, 0);
***************
*** 442,445 ****
--- 452,456 ----
if (timedout) {
PyErr_SetString(PySSLErrorObject, "The read operation timed out");
+ Py_DECREF(buf);
return NULL;
}