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

Diff for /src/usr.bin/ssh/nchan.c between version 1.68 and 1.69

version 1.68, 2018/10/04 00:10:11 version 1.69, 2018/10/04 07:47:35
Line 78 
Line 78 
 /* helper */  /* helper */
 static void     chan_shutdown_write(struct ssh *, Channel *);  static void     chan_shutdown_write(struct ssh *, Channel *);
 static void     chan_shutdown_read(struct ssh *, Channel *);  static void     chan_shutdown_read(struct ssh *, Channel *);
   static void     chan_shutdown_extended_read(struct ssh *, Channel *);
   
 static const char *ostates[] = { "open", "drain", "wait_ieof", "closed" };  static const char *ostates[] = { "open", "drain", "wait_ieof", "closed" };
 static const char *istates[] = { "open", "drain", "wait_oclose", "closed" };  static const char *istates[] = { "open", "drain", "wait_oclose", "closed" };
Line 287 
Line 288 
         switch (c->istate) {          switch (c->istate) {
         case CHAN_INPUT_OPEN:          case CHAN_INPUT_OPEN:
                 chan_shutdown_read(ssh, c);                  chan_shutdown_read(ssh, c);
                   chan_shutdown_extended_read(ssh, c);
                 chan_set_istate(c, CHAN_INPUT_CLOSED);                  chan_set_istate(c, CHAN_INPUT_CLOSED);
                 break;                  break;
         case CHAN_INPUT_WAIT_DRAIN:          case CHAN_INPUT_WAIT_DRAIN:
                 if (!(c->flags & CHAN_LOCAL))                  if (!(c->flags & CHAN_LOCAL))
                         chan_send_eof2(ssh, c);                          chan_send_eof2(ssh, c);
                   chan_shutdown_extended_read(ssh, c);
                 chan_set_istate(c, CHAN_INPUT_CLOSED);                  chan_set_istate(c, CHAN_INPUT_CLOSED);
                 break;                  break;
         }          }
Line 413 
Line 416 
                             c->self, __func__, c->rfd, c->istate, c->ostate,                              c->self, __func__, c->rfd, c->istate, c->ostate,
                             strerror(errno));                              strerror(errno));
                 }                  }
           }
   }
   
   static void
   chan_shutdown_extended_read(struct ssh *ssh, Channel *c)
   {
           if (c->type == SSH_CHANNEL_LARVAL || c->efd == -1)
                   return;
           if (c->extended_usage != CHAN_EXTENDED_READ &&
               c->extended_usage != CHAN_EXTENDED_IGNORE)
                   return;
           debug2("channel %d: %s (i%d o%d sock %d wfd %d efd %d [%s])",
               c->self, __func__, c->istate, c->ostate, c->sock, c->rfd, c->efd,
               channel_format_extended_usage(c));
           if (channel_close_fd(ssh, &c->efd) < 0) {
                   logit("channel %d: %s: close() failed for "
                       "extended fd %d [i%d o%d]: %.100s",
                       c->self, __func__, c->efd, c->istate, c->ostate,
                       strerror(errno));
         }          }
 }  }

Legend:
Removed from v.1.68  
changed lines
  Added in v.1.69