diff options
author | Eli Zaretskii <eliz@gnu.org> | 2015-03-27 12:44:31 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2015-03-27 12:44:31 +0300 |
commit | d133cf839421462280ac0bfd9bd84c591f0e0249 (patch) | |
tree | d964223f8da827058aece69ed66ca25ba82ebbf4 /lisp/emacs-lisp/bytecomp.el | |
parent | 792d44b3c31d2a682607ab8b79ae7d26b7402f41 (diff) | |
download | emacs-d133cf839421462280ac0bfd9bd84c591f0e0249.tar.gz emacs-d133cf839421462280ac0bfd9bd84c591f0e0249.tar.bz2 emacs-d133cf839421462280ac0bfd9bd84c591f0e0249.zip |
Support non-blocking connect on MS-Windows (Bug#20207)
Based on ideas from Kim F. Storm <storm@cua.dk>, see
http://lists.gnu.org/archive/html/emacs-devel/2006-12/msg00873.html.
src/w32proc.c (reader_thread): If the FILE_CONNECT flag is set, call
'_sys_wait_connect'. If it returns STATUS_CONNECT_FAILED, exit
the thread with code 2.
(sys_select): Support 'wfds' in addition to 'rfds'. If a
descriptor in 'wfds' has its bit set, but the corresponding
fd_info member doesn't have its FILE_CONNECT flag set, ignore the
descriptor. Otherwise, acknowledge a successful non-blocking
connect by resetting the FILE_CONNECT flag and setting cp->status
to STATUS_READ_ACKNOWLEDGED.
src/w32.h (STATUS_CONNECT_FAILED): New enumeration value.
(struct _child_process): New member 'errcode'.
(FILE_CONNECT): New flag.
(_sys_wait_connect): Add prototype.
src/w32.c (pfn_WSAEnumNetworkEvents): New function pointer.
(init_winsock): Load WSAEnumNetworkEvents from winsock DLL.
(set_errno): Map WSAEWOULDBLOCK and WSAENOTCONN.
(sys_connect): Support non-blocking 'connect' calls by setting the
FILE_CONNECT flag in the fd_info member and returning EINPROGRESS.
(_sys_read_ahead): Add debug message if this function is called
for a descriptor that waits for a non-blocking connect to complete.
(_sys_wait_connect): New function.
(sys_read): Support STATUS_CONNECT_FAILED. Return the error code
recorded by _sys_wait_connect when the non-blocking connect
failed. Don't call WSAGetLastError before a call to set_errno had
a chance to use its value, since WSAGetLastError clears the last
error.
nt/inc/ms-w32.h (BROKEN_NON_BLOCKING_CONNECT): Don't define.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
0 files changed, 0 insertions, 0 deletions