summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux (#1370)Antoine Pitrou2017-05-021-3/+3
| | | | | | * bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux * Add NEWS entry
* bpo-29728: Provide socket.TCP_NOTSENT_LOWAT (#477)Nathaniel J. Smith2017-03-231-0/+3
| | | | | * Provide socket.TCP_NOTSENT_LOWAT * New TCP option available on recent MacOS and Linux. * Document addition of TCP_NOTSENT_LOWAT
* Add sockaddr_alg to sock_addr_t (#234)Christian Heimes2017-02-221-30/+0
| | | | | | | | | | sock_addr_t is used to define the minimum size of any socket address on the stack. Let's make sure that an AF_ALG address always fits. Coverity complains because in theory, AF_ALG might be larger than any of the other structs. In practice it already fits. Closes Coverity CID 1398948, 1398949, 1398950 Signed-off-by: Christian Heimes <christian@python.org>
* Remove double definition of IPPROTO_IPV6 (#100)Maximilian Hils2017-02-141-3/+0
| | | IPPROTO_IPV6 is already defined further above in the same way.
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-16/+8
| | | | possible. Patch is writen with Coccinelle.
* Address a minor Coverity warning re: unchecked PyArg_ParseTuple callsGregory P. Smith2017-01-181-5/+7
| | | | | in socket.sendto(). A PyErr_Occurred() check was happening later, but it is better to just use the return value and not call PyErr_Occurred().
* Add TCP_CONGESTION and TCP_USER_TIMEOUTVictor Stinner2016-11-291-0/+6
| | | | | | | Issue #26273: Add new socket.TCP_CONGESTION (Linux 2.6.13) and socket.TCP_USER_TIMEOUT (Linux 2.6.37) constants. Patch written by Omar Sandoval.
* Added the const qualifier to char* variables that refer to readonly internalSerhiy Storchaka2016-11-201-1/+1
| | | | UTF-8 represenatation of Unicode objects.
* Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-201-1/+1
|\ | | | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
| * Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka2016-11-201-1/+1
| | | | | | | | with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
* | Merge AIX fixes from 3.6Martin Panter2016-11-141-1/+3
|\ \ | |/
| * Merge AIX fixes from 3.5 into 3.6Martin Panter2016-11-141-1/+3
| |\
| | * Issue #28000: Fix gethostbyname_r() usage on AIX with _LINUX_SOURCE_COMPATMartin Panter2016-11-141-1/+3
| | | | | | | | | | | | Patch by Matthieu S.
* | | Issue #28480: Merge multithreading fixes from 3.6Martin Panter2016-10-201-0/+1
|\ \ \ | |/ /
| * | Issue #28480: Avoid label at end of compound statement --without-threadsMartin Panter2016-10-201-0/+1
| | | | | | | | | | | | Based on patch by Masayuki Yamamoto.
* | | Merge 3.6 (issue #28471)Yury Selivanov2016-10-181-9/+15
|\ \ \ | |/ /
| * | Issue #28471: Fix crash (GIL state related) in socket.setblockingYury Selivanov2016-10-181-9/+15
| | |
* | | Issue #28332: Deprecated silent truncations in socket.htons and socket.ntohs.Serhiy Storchaka2016-10-021-14/+42
|/ / | | | | | | Original patch by Oren Milman.
* | Issue #28139: Merge indentation fixes from 3.5 into 3.6Martin Panter2016-09-171-5/+6
|\ \ | |/
| * Issue #28139: Fix messed up indentationMartin Panter2016-09-171-5/+6
| | | | | | | | | | Also update the classmethod and staticmethod doc strings and comments to match the RST documentation.
| * Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-1/+1
| |
* | Fix NULL check in sock_sendmsg_iovec. CID 1372885Christian Heimes2016-09-131-1/+1
| |
* | socket: Fix memory leak in sendmsg() and sendmsg_afalg()Victor Stinner2016-09-121-5/+12
| | | | | | | | | | | | | | Issue #27744: * Release msg.msg_iov memory block. * Release memory on PyMem_Malloc(controllen) failure
* | Cleanup socketmodule.cVictor Stinner2016-09-121-13/+31
| | | | | | | | | | | | | | | | Issue #27744: * PEP 7: add {...} around if blocks * assign variables and then check their value in if() to make the code easier to read and to debug.
* | Issue 18550: Check return value of ioctl() / fnctl() in internal_setblockingChristian Heimes2016-09-081-20/+41
| | | | | | | | | | | | | | The function internal_setblocking() of the socket module did not check the return values of ioctl() and fnctl(). CID 1294328
* | use the '__linux__' instead 'linux' preprocessor defineBenjamin Peterson2016-09-071-4/+4
| |
* | Issue #27744: correct comment and markupChristian Heimes2016-09-051-1/+1
| |
* | Issue #27744: Add AF_ALG (Linux Kernel crypto) to socket module.Christian Heimes2016-09-051-53/+378
| |
* | Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-1/+1
| |
* | #26907: add some missing getsockopt constants.R David Murray2016-08-241-0/+12
| | | | | | | | Patch by Christian Heimes, reviewed by Martin Panter.
* | Issue #27702: Only expose SOCK_RAW when definedBerker Peksag2016-08-081-0/+3
| | | | | | | | | | | | | | | | SOCK_RAW is marked as optional in the POSIX specification: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html Patch by Ed Schouten.
* | Merge 3.5 (INVALID_SOCKET)Victor Stinner2016-07-221-6/+6
|\ \ | |/
| * socket: use INVALID_SOCKETVictor Stinner2016-07-221-5/+6
| | | | | | | | | | | | | | | | * Replace "fd = -1" with "fd = INVALID_SOCKET" * Replace "fd < 0" with "fd == INVALID_SOCKET": SOCKET_T is unsigned on Windows Bug found by Pavel Belikov ("Fragment N1"): http://www.viva64.com/en/b/0414/#ID0ECDAE
* | Merge 3.5 (fix internal_select)Victor Stinner2016-07-221-1/+1
|\ \ | |/
| * socket: Fix internal_select()Victor Stinner2016-07-221-1/+1
| | | | | | | | | | Bug found by Pavel Belikov ("Fragment N1"): http://www.viva64.com/en/b/0414/#ID0ECDAE
* | Remove duplicate AF_INET6 additionMartin Panter2016-06-251-3/+0
| |
* | Issue #26536: Use spaces instead of tabsBerker Peksag2016-06-181-4/+4
| |
* | Issue #26536: socket.ioctl now supports SIO_LOOPBACK_FAST_PATH. Patch by ↵Steve Dower2016-06-171-3/+23
| | | | | | | | Daniel Stokes.
* | - Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constantsdoko@ubuntu.com2016-06-131-0/+2
| | | | | | | | | | exposed on the API which are not implemented on GNU/Hurd. They would not work at runtime anyway.
* | Issue #26857: The gethostbyaddr_r() workaround is no longer needed withStefan Krah2016-05-221-1/+5
| | | | | | | | api-level >= 23. Patch by Xavier de Gaye.
* | Issue #26857: Workaround for missing symbol "gethostbyaddr_r" on Android.Stefan Krah2016-04-261-1/+1
| |
* | Issue #26057: Got rid of nonneeded use of PyUnicode_FromObject().Serhiy Storchaka2016-04-131-24/+20
| |
* | Issue #26685: Raise OSError if closing a socket failsMartin Panter2016-04-111-1/+5
| |
* | socketmodule.c: error if option larger than INT_MAXVictor Stinner2016-03-231-3/+16
| | | | | | | | | | On Windows, socket.setsockopt() raises an OverflowError if the socket option is larger than INT_MAX bytes.
* | Add socket finalizerVictor Stinner2016-03-211-18/+53
| | | | | | | | | | | | | | Issue #26590: Implement a safe finalizer for the _socket.socket type. It now releases the GIL to close the socket. Use PyErr_ResourceWarning() to raise the ResourceWarning to pass the socket object to the warning logger, to get the traceback where the socket was created (allocated).
* | ResourceWarning: Revert change on socket and scandirVictor Stinner2016-03-191-1/+2
| | | | | | | | io.FileIO has a safe implementation of destructor, but not socket nor scandir.
* | On ResourceWarning, log traceback where the object was allocatedVictor Stinner2016-03-191-2/+1
| | | | | | | | | | | | | | | | | | | | Issue #26567: * Add a new function PyErr_ResourceWarning() function to pass the destroyed object * Add a source attribute to warnings.WarningMessage * Add warnings._showwarnmsg() which uses tracemalloc to get the traceback where source object was allocated.
* | Issue #26406: merge from 3.5Ned Deily2016-02-231-4/+10
|\ \ | |/
| * Issue #26406: Avoid unnecessary serialization of getaddrinfo(3) calls onNed Deily2016-02-231-4/+10
| | | | | | | | current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis.
* | Issue #25924: merge with 3.5Ned Deily2016-02-151-2/+18
|\ \ | |/