Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a193f760df4b3b899920d529d313a2f33aac8dd0
Ticket: 3394732fffffffffffffffffffffffffffffffff
socket -server
User & Date: rmax on 2011-08-20 22:34:34
Changes

  1. icomment:
    Ah - I recently removed the check for server sockets from TcpWatchProc() after I didn't find a way for it to ever get called for server sockets. But as a result of [chan configure -encoding] it does get called and removes the FileHandler for the first file descriptor in the socket. It is only the first, because connected sockets for which TcpWatchProc() is normally called, only ever have one fd and so it doesn't need to loop over them.
    
    I could re-add the check to skip server sockets, but suggest to further investigate if changing the encoding really needs to call the watchproc. Also, it might be cleaner to not specify a watchproc in the Tcl_ChannelType struct for server sockets at all, so that TcpWatchProc() doesn't need to check for them. This would mean that separate Tcl_ChannelType structs would have to be maintained for client and server sockets, which might not be so bad, because there are more members in the struct that don't make much sense for server socckets.
    
    In any case, we should add a test case for this, so that it can't re-appear.
    
    As a quick fix the following line can be added at the start of TcpWatchProc():
    if (statePtr->acceptProc != NULL) return;
    
    
    
  2. login: "rmax"
  3. mimetype: "text/plain"
  4. username: "rmax"