diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | win/tclWinSock.c | 39 |
2 files changed, 30 insertions, 20 deletions
@@ -1,3 +1,10 @@ +2002-05-24 Andreas Kupries <andreas_kupries@users.sourceforge.net> + + * win/tclWinSock.c (TcpWatchProc): Fixed SF Tcl Bug #557878. We + are not allowed to mess with the watch mask if the socket is a + server socket. I believe that the original reporter is George + Peter Staplin. + 2002-05-21 Mo DeJong <mdejong@users.sourceforge.net> * unix/configure: Regen. @@ -307,8 +314,8 @@ * generic/tclExecute.c: * tests/compile.test: made bytecodes check for a catch before - returning; the compiled [return] is otherwise non-catchable. - [Bug 542588] reported by Andreas Kupries. + returning; the compiled [return] is otherwise non-catchable. + [Bug 542588] reported by Andreas Kupries. 2002-04-15 Don Porter <dgp@users.sourceforge.net> 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); + } + } } /* |