Skip to content
Tcl Source Code History Of Ticket 219137
Login

History Of Ticket 219137

Artifacts Associated With Ticket 219137

  1. Ticket change [dc888e265a] (rid 114497) by nobody on 2000-10-26 05:02:13:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 621 RFE
      Version: 8.1a2
      SubmitDate: '1998-05-25'
      LastModified: '1999-03-23'
      Severity: LOW
      Status: Assigned
      Submitter: hershey
      ChangedBy: surles
      OS: All
      OSVersion: NA
      Machine: NA
      FixedDate: '2000-10-25'
      FixedInVersion: NA
      ClosedDate: '2000-10-25'
      
      
      I have a Tcl script started from the inetd daemon but am unable to get
      
      [fconfigure stdin -peername] because stdin is a 'file' rather than a
      
      'socket'.  The following patch to tcl8.1a2/unix/tclUnixChan.c (v 1.217)
      
      modifies the Tcl_MakeFileChannel() function to make a channel with the
      
      socket ('tcp') channel type if it responds sucessfully to a
      
      getsockname() request.
      
      
      
      Could you please include this change in future versions of Tcl?  If you
      
      are the wrong person to send this to please let me know.
      
      
      
      I have to say that the SUPPORTS_TTY logic in Tcl_OpenFileChannel()
      
      should probably also be present in the Tcl_MakeFileChannel() function as
      
      well.
      
      ---
      
      Matthew Costello
      
      (619)485-2926
      
      [email protected]
      
      *** tclUnixChan.c.ORIG  Fri Feb 20 15:20:43 1998
      
      --- tclUnixChan.c       Thu Apr 30 16:10:49 1998
      
      ***************
      
      *** 1387,1392 ****
      
      --- 1387,1398 ----
      
            char channelName[16 + TCL_INTEGER_SPACE];
      
            int fd = (int) handle;
      
            ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
      
      +     Tcl_ChannelType *channelTypePtr;
      
      + #define SUPPORTS_SOCKET
      
      + #ifdef SUPPORTS_SOCKET
      
      +     struct sockaddr sockaddr;
      
      +     int socklen = sizeof(sockaddr);
      
      + #endif
      
        
      
            if (mode == 0) {
      
                return NULL;
      
      ***************
      
      *** 1410,1418 ****
      
            fsPtr->nextPtr = tsdPtr->firstFilePtr;
      
            tsdPtr->firstFilePtr = fsPtr;
      
        
      
            fsPtr->fd = fd;
      
            fsPtr->validMask = mode | TCL_EXCEPTION;
      
      !     fsPtr->channel = Tcl_CreateChannel(&fileChannelType, channelName,
      
                    (ClientData) fsPtr, mode);
      
            
      
            return fsPtr->channel;
      
      --- 1416,1441 ----
      
            fsPtr->nextPtr = tsdPtr->firstFilePtr;
      
            tsdPtr->firstFilePtr = fsPtr;
      
        
      
      + #ifdef SUPPORTS_SOCKET
      
      +     if (getsockname(fd,&sockaddr,&socklen ) == 0) {
      
      +       /*
      
      +       * Initialize the serial port to a set of sane parameters.
      
      +       * Especially important if the remote device is set to echo and
      
      +       * the serial port driver was also set to echo -- as soon as a char
      
      +       * were sent to the serial port, the remote device would echo it,
      
      +       * then the serial driver would echo it back to the device, etc.
      
      +       */
      
      +       
      
      +       channelTypePtr = &tcpChannelType;
      
      +     } else 
      
      + #endif        /* SUPPORTS_SOCKET */
      
      +     {
      
      +       channelTypePtr = &fileChannelType;
      
      +     }
      
      + 
      
            fsPtr->fd = fd;
      
            fsPtr->validMask = mode | TCL_EXCEPTION;
      
      !     fsPtr->channel = Tcl_CreateChannel(channelTypePtr, channelName,
      
                    (ClientData) fsPtr, mode);
      
            
      
            return fsPtr->channel;
      
      
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.1a2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "63. (unused)"
    10. title initialized to: "stdin is a "file"; it should be a socket"
    11. type initialized to: "Patch"
  2. Ticket change [7a9ab2a8f0] (rid 90356) by dkf on 2000-11-10 20:36:36:

    1. icomment:
      Sounds like a reasonable request to me, though it is a UNIX-specific change as Windows places sockets and pipes/terminals into mutually exclusive sets.  Stupid operating system...
      
      I wouldn't fix it exactly as described though; if we are going to allow stdio channels to be represented as socket channels, then they should have names from the sock* series as well.  Also ought to check errno to figure out if we've really got a socket (succeeds => yes, fails with errno==ENOTSOCK => no, other failures => machine is very short of resources!)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. priority changed to: "4"
    5. username: "dkf"
  3. Ticket change [efb5c975ed] (rid 109048) by dgp on 2001-04-01 01:47:33:

    1. subsystem changed to: "27. Channel Types"
    2. title changed to: "stdin is a "file"; it should be a socket"
  4. Ticket change [ab99fbba6b] (rid 101146) by dkf on 2001-06-06 17:38:10:

    1. foundin changed to: "None"
    2. icomment:
      
      
      File Added - 7062: chantype.patch
      
      Logged In: YES 
      user_id=79902
      
      After investigation, I've got a solution for this (well, one
      that goes a bit better and handles serial lines as well.)
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. priority changed to: "5 Medium"
    6. subsystem changed to: "None"
    7. title changed to: "stdin is a file; it should be a socket"
    8. username: "dkf"
  5. Ticket change [201e38fa5c] (rid 91259) by dkf on 2001-06-06 19:50:03:

    1. icomment:
      
      
      File Deleted - 7062: 
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [56fd092f79] (rid 94416) by dkf on 2001-06-06 19:51:49:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      (Bah! Next time check that it really works *first*; this new
      version seems to do the business though.)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  7. Add attachment "unixchantype.patch" [d6512aed10] (rid 123780) by dkf on 2001-06-06 19:51:49.

  8. Ticket change [a4f42f143c] (rid 110288) by dkf on 2001-06-06 19:51:50:

    1. icomment:
      
      
      File Added - 7067: unixchantype.patch
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  9. Ticket change [8364ec2a05] (rid 117376) by dkf on 2001-06-18 21:49:32:

    1. assignee changed to: "dkf"
    2. closedate changed to: "2001-06-18T14:49:32"
    3. closer changed to: "dkf"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  10. Ticket change [ffc87af0b0] (rid 108822) by dgp on 2001-10-24 23:27:06:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Re-opening this patch since it appears to
      have introduced new bugs.
      
      http://sf.net/tracker/?func=detail&atid=110894&aid=471374&group_id=10894
      
      http://sf.net/tracker/index.php?func=detail&aid=465761&group_id=12997&atid=112997
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. resolution changed to: "Invalid"
    5. status changed to: "Open"
    6. username: "dgp"
  11. Ticket change [caf9f79d92] (rid 95450) by dkf on 2001-10-25 22:52:56:

    1. status changed to: "Closed"
  12. Ticket change [503640cc14] (rid 125929) by dkf on 2001-10-25 22:52:57:

    1. closedate changed to: "2001-10-25T15:52:57"
    2. closer changed to: "dkf"
  13. Ticket change [8d668c02cf] (rid 127921) by dkf on 2001-10-25 23:14:14:

    1. closedate changed to: "2001-10-25T16:14:14"
    2. closer changed to: "dkf"
    3. resolution changed to: "Fixed"
    4. subsystem changed to: "27. Channel Types"