diff options
author | oehhar <harald.oehlmann@elmicron.de> | 2014-03-05 15:15:43 (GMT) |
---|---|---|
committer | oehhar <harald.oehlmann@elmicron.de> | 2014-03-05 15:15:43 (GMT) |
commit | 2910497fce32aefc629cfe738e7f2d5e0e941877 (patch) | |
tree | ce26cc820e8f3656129704bb36ebef223c27edfb /win | |
parent | f320ea76a37f8837d998a6400000d59b72d1e376 (diff) | |
download | tcl-2910497fce32aefc629cfe738e7f2d5e0e941877.zip tcl-2910497fce32aefc629cfe738e7f2d5e0e941877.tar.gz tcl-2910497fce32aefc629cfe738e7f2d5e0e941877.tar.bz2 |
"gets" blocked after async cannect: SOCKET_ASYNC_CONNECT was not cleared
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinSock.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c index d7b1b5b..162cbd4 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -1259,7 +1259,7 @@ CreateClientSocket( */ if (async) { ThreadSpecificData *tsdPtr = TclThreadDataKeyGet(&dataKey); - infoPtr->selectEvents |= FD_CONNECT | FD_READ | FD_WRITE; + infoPtr->selectEvents |= FD_CONNECT; ioctlsocket(infoPtr->sockets->fd, (long) FIONBIO, &flag); SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, @@ -2653,18 +2653,18 @@ SocketProc( if (event & FD_CONNECT) { DEBUG("FD_CONNECT"); - /* - * The socket is now connected, clear the async connect - * flag. - */ - //infoPtr->flags &= ~(SOCKET_ASYNC_CONNECT); - - /* - * Remember any error that occurred so we can report - * connection failures. - */ - if (error != ERROR_SUCCESS) { + if (error == ERROR_SUCCESS) { + /* + * The socket is now connected, clear the async connect + * flag. + */ + infoPtr->flags &= ~(SOCKET_ASYNC_CONNECT); + } else { + /* + * Remember any error that occurred so we can report + * connection failures. + */ TclWinConvertError((DWORD) error); infoPtr->lastError = Tcl_GetErrno(); } |