From 0a6e17993458981740c760245d88be6c39dc7fa2 Mon Sep 17 00:00:00 2001 From: Moshe Zadka Date: Sat, 31 Mar 2001 07:13:29 +0000 Subject: - #125981 -- socketmodule.c -- closing sockets was not thread-safe. - Use openssl/*.h to include the OpenSSL header files - Patch #103636: Allow writing strings containing null bytes to an SSL socket --- Misc/NEWS | 6 ++++++ Modules/socketmodule.c | 21 +++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Misc/NEWS b/Misc/NEWS index 2983297..46cb28a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -68,6 +68,12 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=&group_id=5470&atid - Loosely based on patch #103249 -- Fix core dumps in PyUnicode_Count +- #125981 -- socketmodule.c -- closing sockets was not thread-safe. + +- Use openssl/*.h to include the OpenSSL header files + +- Patch #103636: Allow writing strings containing null bytes to an SSL socket + What's New in Python 2.0? ========================= diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 6582713..eae6203 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -156,12 +156,12 @@ Socket methods: #endif #ifdef USE_SSL -#include "rsa.h" -#include "crypto.h" -#include "x509.h" -#include "pem.h" -#include "ssl.h" -#include "err.h" +#include "openssl/rsa.h" +#include "openssl/crypto.h" +#include "openssl/x509.h" +#include "openssl/pem.h" +#include "openssl/ssl.h" +#include "openssl/err.h" #endif /* USE_SSL */ #if defined(MS_WINDOWS) || defined(__BEOS__) @@ -898,14 +898,15 @@ pair (host, port); the host must refer to the local host."; static PyObject * PySocketSock_close(PySocketSockObject *s, PyObject *args) { + SOCKET_T fd; if (!PyArg_ParseTuple(args, ":close")) return NULL; - if (s->sock_fd != -1) { + if ((fd = s->sock_fd) != -1) { + s->sock_fd = -1; Py_BEGIN_ALLOW_THREADS - (void) SOCKETCLOSE(s->sock_fd); + (void) SOCKETCLOSE(fd); Py_END_ALLOW_THREADS } - s->sock_fd = -1; Py_INCREF(Py_None); return Py_None; } @@ -2132,7 +2133,7 @@ static PyObject *SSL_SSLwrite(SSLObject *self, PyObject *args) char *data; size_t len = 0; - if (!PyArg_ParseTuple(args, "s|i:write", &data, &len)) + if (!PyArg_ParseTuple(args, "s#|i:write", &data, &len)) return NULL; if (!len) -- cgit v0.12