[BACK]Return to channels.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/channels.c between version 1.280 and 1.281

version 1.280, 2008/06/12 15:19:17 version 1.281, 2008/06/15 20:06:26
Line 217 
Line 217 
  */   */
 static void  static void
 channel_register_fds(Channel *c, int rfd, int wfd, int efd,  channel_register_fds(Channel *c, int rfd, int wfd, int efd,
     int extusage, int nonblock)      int extusage, int nonblock, int isatty)
 {  {
         /* Update the maximum file descriptor value. */          /* Update the maximum file descriptor value. */
         channel_max_fd = MAX(channel_max_fd, rfd);          channel_max_fd = MAX(channel_max_fd, rfd);
Line 233 
Line 233 
         c->efd = efd;          c->efd = efd;
         c->extended_usage = extusage;          c->extended_usage = extusage;
   
         /* XXX ugly hack: nonblock is only set by the server */          if ((c->isatty = isatty) != 0)
         if (nonblock && isatty(c->rfd)) {  
                 debug2("channel %d: rfd %d isatty", c->self, c->rfd);                  debug2("channel %d: rfd %d isatty", c->self, c->rfd);
                 c->isatty = 1;  
                 if (!isatty(c->wfd)) {  
                         error("channel %d: wfd %d is not a tty?",  
                             c->self, c->wfd);  
                 }  
         } else {  
                 c->isatty = 0;  
         }  
   
         /* enable nonblocking mode */          /* enable nonblocking mode */
         if (nonblock) {          if (nonblock) {
Line 303 
Line 294 
         c->ostate = CHAN_OUTPUT_OPEN;          c->ostate = CHAN_OUTPUT_OPEN;
         c->istate = CHAN_INPUT_OPEN;          c->istate = CHAN_INPUT_OPEN;
         c->flags = 0;          c->flags = 0;
         channel_register_fds(c, rfd, wfd, efd, extusage, nonblock);          channel_register_fds(c, rfd, wfd, efd, extusage, nonblock, 0);
         c->self = found;          c->self = found;
         c->type = type;          c->type = type;
         c->ctype = ctype;          c->ctype = ctype;
Line 746 
Line 737 
   
 void  void
 channel_set_fds(int id, int rfd, int wfd, int efd,  channel_set_fds(int id, int rfd, int wfd, int efd,
     int extusage, int nonblock, u_int window_max)      int extusage, int nonblock, int isatty, u_int window_max)
 {  {
         Channel *c = channel_lookup(id);          Channel *c = channel_lookup(id);
   
         if (c == NULL || c->type != SSH_CHANNEL_LARVAL)          if (c == NULL || c->type != SSH_CHANNEL_LARVAL)
                 fatal("channel_activate for non-larval channel %d.", id);                  fatal("channel_activate for non-larval channel %d.", id);
         channel_register_fds(c, rfd, wfd, efd, extusage, nonblock);          channel_register_fds(c, rfd, wfd, efd, extusage, nonblock, isatty);
         c->type = SSH_CHANNEL_OPEN;          c->type = SSH_CHANNEL_OPEN;
         c->local_window = c->local_window_max = window_max;          c->local_window = c->local_window_max = window_max;
         packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST);          packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST);

Legend:
Removed from v.1.280  
changed lines
  Added in v.1.281