diff options
| author | max@tclers.tk (Reinhard Max) <max> | 2014-03-10 18:11:08 (GMT) |
|---|---|---|
| committer | max@tclers.tk (Reinhard Max) <max> | 2014-03-10 18:11:08 (GMT) |
| commit | 605d5616a5c744fff2c6cbcc06470ee7627a1116 (patch) | |
| tree | fc99721f9ac6869e4f7cad85a7209198940d905d /unix/tclUnixSock.c | |
| parent | 8a790342688f572df77301cb71877d05954adfbd (diff) | |
| download | tcl-605d5616a5c744fff2c6cbcc06470ee7627a1116.zip tcl-605d5616a5c744fff2c6cbcc06470ee7627a1116.tar.gz tcl-605d5616a5c744fff2c6cbcc06470ee7627a1116.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 */ |
