summaryrefslogtreecommitdiffstats
path: root/win/tclWinSock.c
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2014-05-29 14:56:10 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2014-05-29 14:56:10 (GMT)
commit46ad08baa493c06c277895adba74c64fce774dd4 (patch)
tree8a2c2e44e267cfc9402cf9e353825b9fc81856f2 /win/tclWinSock.c
parent99881838a7e2f2f15331858f6654beb534bfccc8 (diff)
downloadtcl-46ad08baa493c06c277895adba74c64fce774dd4.zip
tcl-46ad08baa493c06c277895adba74c64fce774dd4.tar.gz
tcl-46ad08baa493c06c277895adba74c64fce774dd4.tar.bz2
Try not to loose FD_CONNECT by switching monitoring off.bug_336441ed59
Diffstat (limited to 'win/tclWinSock.c')
-rw-r--r--win/tclWinSock.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index e18a3dd..ae9ba17 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -1239,13 +1239,17 @@ WaitForSocketEvent(
/*
* Reset WSAAsyncSelect so we have a fresh set of events pending.
+ * Don't do that if we are waiting for a connect as this may ignore
+ * a failed connect.
*/
- SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) UNSELECT,
- (LPARAM) infoPtr);
-
- SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT,
- (LPARAM) infoPtr);
+ if ( 0 == (events & FD_CONNECT) ) {
+ SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) UNSELECT,
+ (LPARAM) infoPtr);
+
+ SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT,
+ (LPARAM) infoPtr);
+ }
while (1) {
if (infoPtr->lastError) {