diff options
author | stanton <stanton> | 1998-06-09 13:09:02 (GMT) |
---|---|---|
committer | stanton <stanton> | 1998-06-09 13:09:02 (GMT) |
commit | 571cec9ea62ec5efe56305e888aaef60fe0c6eeb (patch) | |
tree | e8ed58dfc3d4a7730515332b12779afdeaf91837 /unix | |
parent | cb4a15daedc1bd750818ce0ae24098b6454e7dc0 (diff) | |
download | tcl-571cec9ea62ec5efe56305e888aaef60fe0c6eeb.zip tcl-571cec9ea62ec5efe56305e888aaef60fe0c6eeb.tar.gz tcl-571cec9ea62ec5efe56305e888aaef60fe0c6eeb.tar.bz2 |
changed so server sockets can't be trashed by fileevent
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixChan.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index c194b66..28e62e5 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -1769,12 +1769,20 @@ TcpWatchProc(instanceData, mask) { TcpState *statePtr = (TcpState *) instanceData; - if (mask) { - Tcl_CreateFileHandler(statePtr->fd, mask, - (Tcl_FileProc *) Tcl_NotifyChannel, - (ClientData) statePtr->channel); - } else { - Tcl_DeleteFileHandler(statePtr->fd); + /* + * Make sure we don't mess with server sockets since they will never + * be readable or writable at the Tcl level. This keeps Tcl scripts + * from interfering with the -accept behavior. + */ + + if (!statePtr->acceptProc) { + if (mask) { + Tcl_CreateFileHandler(statePtr->fd, mask, + (Tcl_FileProc *) Tcl_NotifyChannel, + (ClientData) statePtr->channel); + } else { + Tcl_DeleteFileHandler(statePtr->fd); + } } } |