cpython: 48743ad2d2ef (original) (raw)

Mercurial > cpython

changeset 70011:48743ad2d2ef 2.7

Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in order to accept exactly one connection. Patch by Daniel Evers. [#8498]

Antoine Pitrou solipsis@pitrou.net
date Tue, 10 May 2011 19:16:03 +0200
parents 50a5e271edf9
children a21f5af476cb
files Doc/library/socket.rst Lib/test/test_socket.py Misc/ACKS Misc/NEWS Modules/socketmodule.c
diffstat 5 files changed, 20 insertions(+), 6 deletions(-)[+] [-] Doc/library/socket.rst 4 Lib/test/test_socket.py 7 Misc/ACKS 1 Misc/NEWS 3 Modules/socketmodule.c 11

line wrap: on

line diff

--- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -644,8 +644,8 @@ correspond to Unix system calls applicab .. method:: socket.listen(backlog) Listen for connections made to the socket. The backlog argument specifies the

.. method:: socket.makefile([mode[, bufsize]])

--- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -700,6 +700,13 @@ class GeneralModuleTests(unittest.TestCa def test_sendall_interrupted_with_timeout(self): self.check_sendall_interrupted(True)

+ @unittest.skipUnless(thread, 'Threading required for this test.') class BasicTCPTest(SocketConnectedTest):

--- a/Misc/ACKS +++ b/Misc/ACKS @@ -243,6 +243,7 @@ Carey Evans Tim Everett Paul Everitt David Everly +Daniel Evers Greg Ewing Martijn Faassen Clovis Fabricio

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -80,6 +80,9 @@ Core and Builtins Library ------- +- Issue #8498: In socket.accept(), allow to specify 0 as a backlog value in

--- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2244,8 +2244,10 @@ sock_listen(PySocketSockObject *s, PyObj if (backlog == -1 && PyErr_Occurred()) return NULL; Py_BEGIN_ALLOW_THREADS

#ifndef NO_DUP