diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinSock.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 9fd3034..a5ffdfb 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinSock.c,v 1.25 2002/01/24 01:34:16 dgp Exp $ + * RCS: @(#) $Id: tclWinSock.c,v 1.26 2002/05/24 18:57:09 andreas_kupries Exp $ */ #include "tclWinInt.h" @@ -2063,26 +2063,29 @@ TcpWatchProc(instanceData, mask) SocketInfo *infoPtr = (SocketInfo *) instanceData; /* - * Update the watch events mask. + * Update the watch events mask. Only if the socket is not a + * server socket. Fix for SF Tcl Bug #557878. */ - - infoPtr->watchEvents = 0; - if (mask & TCL_READABLE) { - infoPtr->watchEvents |= (FD_READ|FD_CLOSE|FD_ACCEPT); - } - if (mask & TCL_WRITABLE) { - infoPtr->watchEvents |= (FD_WRITE|FD_CONNECT); - } - /* - * If there are any conditions already set, then tell the notifier to poll - * rather than block. - */ + if (!infoPtr->acceptProc) { + infoPtr->watchEvents = 0; + if (mask & TCL_READABLE) { + infoPtr->watchEvents |= (FD_READ|FD_CLOSE|FD_ACCEPT); + } + if (mask & TCL_WRITABLE) { + infoPtr->watchEvents |= (FD_WRITE|FD_CONNECT); + } + + /* + * If there are any conditions already set, then tell the notifier to poll + * rather than block. + */ - if (infoPtr->readyEvents & infoPtr->watchEvents) { - Tcl_Time blockTime = { 0, 0 }; - Tcl_SetMaxBlockTime(&blockTime); - } + if (infoPtr->readyEvents & infoPtr->watchEvents) { + Tcl_Time blockTime = { 0, 0 }; + Tcl_SetMaxBlockTime(&blockTime); + } + } } /* |