| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Add "#ifdef WITH_THREAD" around cals to:
* PyGILState_Check()
* _PyImport_AcquireLock()
* _PyImport_ReleaseLock()
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
result of sendto() instead of the C int type.
|
| |
| |
| |
| | |
accept() returns INVALID_SOCKET on error, it's not necessary a negative number.
|
| |
| |
| |
| | |
Patch courtesy of Joe Jevnik.
|
| |
| |
| |
| |
| |
| |
| | |
poll() is not available.
select() doesn't accept negative timeout, the timeout parameter must be NULL to
block on select().
|
| |
| |
| |
| | |
Use -1 second by default, not -1 nanosecond.
|
| |
| |
| |
| |
| | |
Call internal_select() with a timeout of 0 second, not a timeout of -1 second
(blocking)!
|
| |
| |
| |
| |
| | |
each time data is sent successfuly. The socket timeout is now the maximum total
duration to send all data.
|
| |
| |
| |
| |
| |
| | |
Use _PyTime_FromSeconds() to initialize the default socket timeout to -1
second, instead of -1 nanosecond which causes rounding issues in
internal_select().
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Use the new _PyTime_FromSeconds() function to set the timeout to -1 second
for socket.settimeout(None). It avoids a special case in internal_select()
because of a rounding issue: -1 nanosecond is rounded to 0 millisecond which
means non-blocking, instead of blocking.
* Check if the interval the negative in sock_call_ex() instead of doing the
check in internal_select(). sock_call_ex() remembers if the socket has a
timeout or not, which avoids a race condition if the timeout is modified in a
different thread.
|
| | |
|
| |
| |
| |
| |
| | |
sock_call_ex() gets the socket error code when the socket function fails.
sock_connect_impl() didn't set the error correctly.
|
| |
| |
| |
| |
| |
| |
| |
| | |
instead of raising InterruptedError if the connection is interrupted by
signals, signal handlers don't raise an exception and the socket is blocking or
has a timeout.
socket.socket.connect() still raise InterruptedError for non-blocking sockets.
|
| | |
|
| | |
|
| |
| |
| |
| | |
sock_send_impl()
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The BEGIN_SELECT_LOOP and END_SELECT_LOOP macros of socketmodule.c don't handle
EINTR. Functions using these macros use an inner loop to handle EINTR, but they
don't recompute the timeout.
This changes replaces the two macros with a new sock_call() function which
takes a function as a parameter. sock_call() recomputes the timeout, handle
false positive and handle EINTR.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| | |
Windows uses WSAEINTR error code, not EINTR, for socket functions.
|
| |
| |
| |
| |
| |
| |
| | |
Call PyErr_CheckSignals() immediatly if connect() or select() fails with EINTR
in internal_connect().
Refactor also the code to limit indentaton and make it more readable.
|
| |
| |
| |
| |
| | |
Call PyErr_CheckSignals() if connect(), select() or getsockopt() failed with
EINTR.
|
| |
| |
| |
| |
| | |
On Windows, it looks like using the C type socklen_t for getsockopt() (instead
of int) is fine, it was already used in socket.getsockopt().
|
| |
| |
| |
| |
| | |
On Windows, internal_connect() now reuses internal_connect_select() and always
calls getsockopt().
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
* Inline internal_select() function
* Rename internal_select_ex() internal_select()
|
| |
| |
| |
| |
| | |
All these functions only accept positive timeouts, so this change has no effect
in practice.
|
| |
| |
| |
| |
| | |
Add _PyTime_AsTimeval_noraise() function. Call it when it's not possible (or
not useful) to raise a Python exception on overflow.
|
| | |
|
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| | |
codecs, that accepted only read-only bytes-like object now accept writable
bytes-like object too.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| |
| |
| | |
Fix regression of changeset 7c6e3358221a on GCC < 4.4. The _socket module
cannot be compiled on "x86 FreeBSD 7.2 3.x" buildbot anymore.
|
| | |
|
|\ \
| |/
| |
| | |
overflows. Added few missed PyErr_NoMemory().
|
| |
| |
| |
| | |
overflows. Added few missed PyErr_NoMemory().
|
| | |
|
| |
| |
| |
| | |
which will be used for the official 3.5 release.
|
|\ \
| |/ |
|
| | |
|
| | |
|
| |
| |
| |
| | |
argument contains not permitted null character or byte.
|