diff options
author | max <max@tclers.tk> | 2014-03-10 18:11:08 (GMT) |
---|---|---|
committer | max <max@tclers.tk> | 2014-03-10 18:11:08 (GMT) |
commit | ca31b05c9d550db49feff41e523fd9262c362308 (patch) | |
tree | fc99721f9ac6869e4f7cad85a7209198940d905d /unix/tclUnixSock.c | |
parent | 75cae59053356df95302e2d97fe9855f37ca18ab (diff) | |
download | tcl-ca31b05c9d550db49feff41e523fd9262c362308.zip tcl-ca31b05c9d550db49feff41e523fd9262c362308.tar.gz tcl-ca31b05c9d550db49feff41e523fd9262c362308.tar.bz2 |
WaitForConnect may only call back to CreateClientSocket when the socket is writable or something. When it does so for a pending socket, it is falsely assumed to have succeeded and a subsequent read/write operation will fail.
Diffstat (limited to 'unix/tclUnixSock.c')
-rw-r--r-- | unix/tclUnixSock.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 41d729e..6e84ed5 100644 --- a/unix/tclUnixSock.c +++ b/unix/tclUnixSock.c @@ -417,7 +417,9 @@ WaitForConnect( errno = 0; state = TclUnixWaitForFile(statePtr->fds.fd, TCL_WRITABLE | TCL_EXCEPTION, timeOut); - CreateClientSocket(NULL, statePtr); + if (state != 0) { + CreateClientSocket(NULL, statePtr); + } if (statePtr->flags & TCP_ASYNC_CONNECT) { /* We are still in progress, so ignore the result of the last * attempt */ |