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)
commit78bb5378e9246dab5774d2d17c3397f36f0658cf (patch)
tree8a2c2e44e267cfc9402cf9e353825b9fc81856f2 /win/tclWinSock.c
parentbf498960d9c30a5bfa7c6b1d1f157b68706a7e04 (diff)
downloadtcl-78bb5378e9246dab5774d2d17c3397f36f0658cf.zip
tcl-78bb5378e9246dab5774d2d17c3397f36f0658cf.tar.gz
tcl-78bb5378e9246dab5774d2d17c3397f36f0658cf.tar.bz2
Try not to loose FD_CONNECT by switching monitoring off.
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) {