summaryrefslogtreecommitdiffstats
path: root/win/tclWinSock.c
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2002-05-24 18:57:09 (GMT)
committerandreas_kupries <akupries@shaw.ca>2002-05-24 18:57:09 (GMT)
commitd77d232574a42bc3399bd68a7f826c5cc25d86f4 (patch)
treebe013bb298c501528cae5c706760f0b2ad791fcf /win/tclWinSock.c
parent6894740029f61262bf530094fe3975e078f69321 (diff)
downloadtcl-d77d232574a42bc3399bd68a7f826c5cc25d86f4.zip
tcl-d77d232574a42bc3399bd68a7f826c5cc25d86f4.tar.gz
tcl-d77d232574a42bc3399bd68a7f826c5cc25d86f4.tar.bz2
* 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.
Diffstat (limited to 'win/tclWinSock.c')
-rw-r--r--win/tclWinSock.c39
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);
+ }
+ }
}
/*