]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
- #125981 -- socketmodule.c -- closing sockets was not thread-safe.
authorMoshe Zadka <moshez@math.huji.ac.il>
Sat, 31 Mar 2001 07:13:29 +0000 (07:13 +0000)
committerMoshe Zadka <moshez@math.huji.ac.il>
Sat, 31 Mar 2001 07:13:29 +0000 (07:13 +0000)
- Use openssl/*.h to include the OpenSSL header files

- Patch #103636: Allow writing strings containing null bytes to an SSL socket

Misc/NEWS
Modules/socketmodule.c

index 29832975bebf4ba6513e5e2372e1fca663e2644f..46cb28a46931aa885fb9c6c5d116000026b1f4d5 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -68,6 +68,12 @@ http://sourceforge.net/tracker/index.php?func=detail&aid=<id>&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?
 =========================
 
index 6582713425150d32028263f1b7c625f132615954..eae62031a4b3b2f8fa5693c54cf62eb8c997201e 100644 (file)
@@ -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)