Victor Stinner
b6c15bcad3
Issue #23618 : Refactor internal_connect()
On Windows, internal_connect() now reuses internal_connect_select() and always
calls getsockopt().
11 years ago
Victor Stinner
dd88d3db45
Issue #23618 : Refactor internal_connect()
The function now returns the error code instead of using the global errno
(POSIX) or WSAGetLastError() (Windows).
internal_connect() now returns errno if getsockopt() fails.
11 years ago
Victor Stinner
1bb0aef4d1
Issue #22117 : Fix integer overflow check in socket_parse_timeout() on Windows
11 years ago
Victor Stinner
dd83bd2f9c
Issue #23618 : Fix internal_connect_select()
11 years ago
Victor Stinner
416f2e66ca
Issue #23618 : internal_connect_select() now waits also for error events
11 years ago
Victor Stinner
e6951c6c8a
Issue #23618 : Refactor internal_select() to prepare socket.connect() for EINTR
11 years ago
Victor Stinner
391fa713f7
Issue #23618 : Refactor the _socket module
* Inline internal_select() function
* Rename internal_select_ex() internal_select()
11 years ago
Victor Stinner
869e1778c0
Issue #22117 : Replace usage of _PyTime_ROUND_UP with _PyTime_ROUND_CEILING
All these functions only accept positive timeouts, so this change has no effect
in practice.
11 years ago
Victor Stinner
ea9c0dd2c2
Issue #22117 : Fix usage of _PyTime_AsTimeval()
Add _PyTime_AsTimeval_noraise() function. Call it when it's not possible (or
not useful) to raise a Python exception on overflow.
11 years ago
Victor Stinner
71694d5c8c
Issue #22117 : The socket module uses _PyTime_t timestamp for timeouts
11 years ago
Victor Stinner
b7df3144ef
Issue #23618 , #22117 : refactor socketmodule.c
Move Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS inside internal_select_ex() to
prepare a switch to the _PyTime_t type and retry syscall on EINTR.
11 years ago
Victor Stinner
f50e187724
Fix compiler warnings: comparison between signed and unsigned numbers
11 years ago
Serhiy Storchaka
8490f5acfe
Issue #23001 : Few functions in modules mmap, ossaudiodev, socket, ssl, and
codecs, that accepted only read-only bytes-like object now accept writable
bytes-like object too.
11 years ago
Victor Stinner
9a8089b32a
Issue #23646 : Enhance precision of time.sleep() and socket timeout when
interrupted by a signal
Add a new _PyTime_AddDouble() function and remove _PyTime_ADD_SECONDS() macro.
The _PyTime_ADD_SECONDS only supported an integer number of seconds, the
_PyTime_AddDouble() has subsecond resolution.
11 years ago
Serhiy Storchaka
caa01f861c
Fixed GCC version testing.
11 years ago
Victor Stinner
a4c727131e
Fix "GCC diagnostic" in socketmodule.c
Fix regression of changeset 7c6e3358221a on GCC < 4.4. The _socket module
cannot be compiled on "x86 FreeBSD 7.2 3.x" buildbot anymore.
11 years ago
Serhiy Storchaka
b48af340b9
Silenced minor GCC warnings.
11 years ago
Serhiy Storchaka
1a1ff29659
Issue #23446 : Use PyMem_New instead of PyMem_Malloc to avoid possible integer
overflows. Added few missed PyErr_NoMemory().
11 years ago
Charles-François Natali
6e6c59b508
Issue #23285 : PEP 475 -- Retry system calls failing with EINTR.
11 years ago
Serhiy Storchaka
b757c83ec6
Issue #22581 : Use more "bytes-like object" throughout the docs and comments.
11 years ago
Steve Dower
65e4cb10d9
Issue #22919 : Windows build updated to support VC 14.0 (Visual Studio 2015), which will be used for the official 3.5 release.
11 years ago
Charles-François Natali
ea07eb9469
Issue #22378 : socket module: add SO_MARK.
11 years ago
Serhiy Storchaka
d8a1447c99
Issue #22215 : Now ValueError is raised instead of TypeError when str or bytes
argument contains not permitted null character or byte.
11 years ago
Victor Stinner
ae58649721
Issue #22043 : time.monotonic() is now always available
threading.Lock.acquire(), threading.RLock.acquire() and socket operations now
use a monotonic clock, instead of the system clock, when a timeout is used.
11 years ago
Victor Stinner
1a62a680d6
Issue #22218 : Fix "comparison between signed and unsigned integers" warnings in
socketmodule.c.
12 years ago
Martin v. Löwis
17fd1e1013
Issue #22127 : fix typo.
12 years ago
Martin v. Löwis
eb1c28a849
Issue #22127 : Bypass IDNA for pure-ASCII host names (in particular for numeric IPs).
12 years ago
Victor Stinner
e254e53c83
Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError
on closed socket. repr(socket.socket) already works fine.
12 years ago
Victor Stinner
b6dab6bce8
Issue #22042 : Avoid dangerous C cast in socket.setblocking()
Avoid cast from (int*) to (u_long*), even if sizeof(int) == sizeof(u_long).
12 years ago
Berker Peksag
a6ec5ee3c8
Fix typo in socket.getaddrinfo() docstring.
Reported by Krishna Kumar Thakur on docs@.
12 years ago
Victor Stinner
ef7f140366
All modern compilers provide a offsetof() function
offsetof() is used directly in many other .c files without any issue.
12 years ago
Charles-François Natali
644b8f52a8
Issue #21455 : Add a default backlog to socket.listen().
12 years ago
Vinay Sajip
ed6783f315
Issue #10141 , Issue 20065: Changed #if to take CAN_RAW into account.
12 years ago
Vinay Sajip
ecfc98c67b
Issue #10141 : updated new usages of AF_CAN to be in #ifdef AF_CAN rather than #ifdef HAVE_LINUX_CAN_H to allow compilation on older Linuxes.
12 years ago
Charles-François Natali
b4062e8f8a
Issue #20065 : socketmodule: Fix build error when AF_CAN is defined without the
proper CAN headers.
12 years ago
Benjamin Peterson
a677d7628b
remove overly strict assertion ( closes #20251 )
12 years ago
Benjamin Peterson
c6b37e21f5
merge 3.3 ( #20246 )
12 years ago
Benjamin Peterson
fbf648ebba
complain when nbytes > buflen to fix possible buffer overflow ( closes #20246 )
12 years ago
Brett Cannon
b05cbe61b3
Issue #12837 : Silence a Clang compiler warning on OS X.
Now makes CPython build without warnings on OS X under Clang with
-Wno-unused-value -Wno-empty-body -Qunused-arguments
-Wno-deprecated-declarations.
Thanks to David Watson for taking an initial stab at a solution.
12 years ago
Christian Heimes
af01f66817
Issue #16136 : Remove VMS support and VMS-related code
12 years ago
Guido van Rossum
638aebd58e
Fix broken docstring continuation line for detach().
12 years ago
Victor Stinner
9a954838ab
Close #19827 : On UNIX, setblocking() and settimeout() methods of socket.socket
can now avoid a second syscall if the ioctl() function can be used, or if the
non-blocking flag of the socket is unchanged.
12 years ago
Benjamin Peterson
1314ef73d0
add SO_PRIORITY ( closes #19802 )
Patch by Claudiu Popa.
12 years ago
Victor Stinner
e990c6e952
Fix sock_recvfrom_guts(): recvfrom() size is limited to an int on Windows, not
on other OSes!
12 years ago
Jason R. Coombs
8ec784c2df
Issue #7171 : Update syntax to replace MAX in favor of Py_MAX (matching implementation for Unix).
12 years ago
Georg Brandl
6083a4bc1c
Re #18521 : remove assignments of variables that are immediately reassigned.
12 years ago
Charles-François Natali
0cc86850b6
Issue #16201 : socket: Use inet_pton()/inet_addr() instead of ad-hoc parsing for
numeric IP addresses.
12 years ago
Charles-François Natali
24aa041731
Use INADDR_BROADCAST instead of hard-coded value (it's part of POSIX and
already appears without #ifdef a couple lines above).
12 years ago
Victor Stinner
daf455554b
Issue #18571 : Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
13 years ago
Serhiy Storchaka
9594942716
Issue #18783 : Removed existing mentions of Python long type in docstrings,
error messages and comments.
13 years ago