summaryrefslogtreecommitdiff
path: root/Modules/socketmodule.c
AgeCommit message (Collapse)AuthorLines
2017-05-03Backport bpo-30205 to 3.6 (#1403)Antoine Pitrou-3/+3
2017-03-16Add sockaddr_alg to sock_addr_t (GH-234) (GH-533)Mariatta-30/+0
(cherry picked from commit d37c068e695f8ec72b5c1b5a5a5ece2337fda768)
2016-11-29Add TCP_CONGESTION and TCP_USER_TIMEOUTVictor Stinner-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.
2016-11-20Replaced outdated macros _PyUnicode_AsString and _PyUnicode_AsStringAndSizeSerhiy Storchaka-1/+1
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
2016-11-14Merge AIX fixes from 3.5 into 3.6Martin Panter-1/+3
2016-11-14Issue #28000: Fix gethostbyname_r() usage on AIX with _LINUX_SOURCE_COMPATMartin Panter-1/+3
Patch by Matthieu S.
2016-10-20Issue #28480: Avoid label at end of compound statement --without-threadsMartin Panter-0/+1
Based on patch by Masayuki Yamamoto.
2016-10-18Issue #28471: Fix crash (GIL state related) in socket.setblockingYury Selivanov-9/+15
2016-09-17Issue #28139: Merge indentation fixes from 3.5 into 3.6Martin Panter-5/+6
2016-09-17Issue #28139: Fix messed up indentationMartin Panter-5/+6
Also update the classmethod and staticmethod doc strings and comments to match the RST documentation.
2016-09-13Fix NULL check in sock_sendmsg_iovec. CID 1372885Christian Heimes-1/+1
2016-09-12socket: Fix memory leak in sendmsg() and sendmsg_afalg()Victor Stinner-5/+12
Issue #27744: * Release msg.msg_iov memory block. * Release memory on PyMem_Malloc(controllen) failure
2016-09-12Cleanup socketmodule.cVictor Stinner-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.
2016-09-09Issue 18550: Check return value of ioctl() / fnctl() in internal_setblockingChristian Heimes-20/+41
The function internal_setblocking() of the socket module did not check the return values of ioctl() and fnctl(). CID 1294328
2016-09-07Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter-1/+1
2016-09-07use the '__linux__' instead 'linux' preprocessor defineBenjamin Peterson-4/+4
2016-09-06Issue #27744: correct comment and markupChristian Heimes-1/+1
2016-09-05Issue #27744: Add AF_ALG (Linux Kernel crypto) to socket module.Christian Heimes-53/+378
2016-08-30Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger-1/+1
2016-08-23#26907: add some missing getsockopt constants.R David Murray-0/+12
Patch by Christian Heimes, reviewed by Martin Panter.
2016-08-08Issue #27702: Only expose SOCK_RAW when definedBerker Peksag-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.
2016-07-22Merge 3.5 (INVALID_SOCKET)Victor Stinner-6/+6
2016-07-22socket: use INVALID_SOCKETVictor Stinner-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
2016-07-22Merge 3.5 (fix internal_select)Victor Stinner-1/+1
2016-07-22socket: Fix internal_select()Victor Stinner-1/+1
Bug found by Pavel Belikov ("Fragment N1"): http://www.viva64.com/en/b/0414/#ID0ECDAE
2016-06-25Remove duplicate AF_INET6 additionMartin Panter-3/+0
2016-06-18Issue #26536: Use spaces instead of tabsBerker Peksag-4/+4
2016-06-17Issue #26536: socket.ioctl now supports SIO_LOOPBACK_FAST_PATH. Patch by ↵Steve Dower-3/+23
Daniel Stokes.
2016-06-13- Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constantsdoko@ubuntu.com-0/+2
exposed on the API which are not implemented on GNU/Hurd. They would not work at runtime anyway.
2016-05-22Issue #26857: The gethostbyaddr_r() workaround is no longer needed withStefan Krah-1/+5
api-level >= 23. Patch by Xavier de Gaye.
2016-04-26Issue #26857: Workaround for missing symbol "gethostbyaddr_r" on Android.Stefan Krah-1/+1
2016-04-13Issue #26057: Got rid of nonneeded use of PyUnicode_FromObject().Serhiy Storchaka-24/+20
2016-04-11Issue #26685: Raise OSError if closing a socket failsMartin Panter-1/+5
2016-03-23socketmodule.c: error if option larger than INT_MAXVictor Stinner-3/+16
On Windows, socket.setsockopt() raises an OverflowError if the socket option is larger than INT_MAX bytes.
2016-03-21Add socket finalizerVictor Stinner-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).
2016-03-19ResourceWarning: Revert change on socket and scandirVictor Stinner-1/+2
io.FileIO has a safe implementation of destructor, but not socket nor scandir.
2016-03-19On ResourceWarning, log traceback where the object was allocatedVictor Stinner-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.
2016-02-23Issue #26406: merge from 3.5Ned Deily-4/+10
2016-02-23Issue #26406: Avoid unnecessary serialization of getaddrinfo(3) calls onNed Deily-4/+10
current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis.
2016-02-15Issue #25924: merge with 3.5Ned Deily-2/+18
2016-02-15Issue #25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS XNed Deily-2/+18
versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis.
2016-01-28Merge 3.5: Issue #26227Victor Stinner-2/+24
2016-01-28Windows: Decode hostname from ANSI code pageVictor Stinner-2/+24
Issue #26227: On Windows, getnameinfo(), gethostbyaddr() and gethostbyname_ex() functions of the socket module now decode the hostname from the ANSI code page rather than UTF-8.
2016-01-24Fix compiler warning about obviously unreachable code.Raymond Hettinger-4/+0
2015-12-25Issue #25923: Added more const qualifiers to signatures of static and ↵Serhiy Storchaka-2/+2
private functions.
2015-10-11Close #24784: Fix compilation without thread supportVictor Stinner-0/+2
Add "#ifdef WITH_THREAD" around cals to: * PyGILState_Check() * _PyImport_AcquireLock() * _PyImport_ReleaseLock()
2015-10-11Close #24784: Fix compilation without thread supportVictor Stinner-0/+2
Add "#ifdef WITH_THREAD" around cals to: * PyGILState_Check() * _PyImport_AcquireLock() * _PyImport_ReleaseLock()
2015-09-11Merge 3.4Victor Stinner-3/+1
2015-09-11Issue #24684: socket.socket.getaddrinfo() now callsVictor Stinner-3/+1
PyUnicode_AsEncodedString() instead of calling the encode() method of the host, to handle correctly custom string with an encode() method which doesn't return a byte string. The encoder of the IDNA codec is now called directly instead of calling the encode() method of the string.
2015-07-27Issue #24732, #23834: Fix sock_accept_impl() on WindowsVictor Stinner-0/+5
accept() returns INVALID_SOCKET on error, it's not necessary a negative number.