[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.136 and 1.137

version 1.136, 2001/10/04 15:05:40 version 1.137, 2001/10/07 17:49:40
Line 241 
Line 241 
         }          }
         /* Initialize and return new channel. */          /* Initialize and return new channel. */
         c = channels[found] = xmalloc(sizeof(Channel));          c = channels[found] = xmalloc(sizeof(Channel));
           memset(c, 0, sizeof(Channel));
         buffer_init(&c->input);          buffer_init(&c->input);
         buffer_init(&c->output);          buffer_init(&c->output);
         buffer_init(&c->extended);          buffer_init(&c->extended);
Line 974 
Line 975 
         int have, ret;          int have, ret;
   
         have = buffer_len(&c->input);          have = buffer_len(&c->input);
           c->delayed = 0;
         debug2("channel %d: pre_dynamic: have %d", c->self, have);          debug2("channel %d: pre_dynamic: have %d", c->self, have);
         /* buffer_dump(&c->input); */          /* buffer_dump(&c->input); */
         /* check if the fixed size part of the packet is in buffer. */          /* check if the fixed size part of the packet is in buffer. */
Line 1133 
Line 1134 
                     "to %.100s port %d requested.",                      "to %.100s port %d requested.",
                     c->listening_port, c->path, c->host_port);                      c->listening_port, c->path, c->host_port);
   
                 rtype = (c->type == SSH_CHANNEL_RPORT_LISTENER) ?                  if (c->type == SSH_CHANNEL_RPORT_LISTENER) {
                     "forwarded-tcpip" : "direct-tcpip";                          nextstate = SSH_CHANNEL_OPENING;
                 nextstate = (c->host_port == 0 &&                          rtype = "forwarded-tcpip";
                     c->type != SSH_CHANNEL_RPORT_LISTENER) ?                  } else {
                     SSH_CHANNEL_DYNAMIC : SSH_CHANNEL_OPENING;                          if (c->host_port == 0) {
                                   nextstate = SSH_CHANNEL_DYNAMIC;
                                   rtype = "direct-tcpip";
                           } else {
                                   nextstate = SSH_CHANNEL_OPENING;
                                   rtype = "direct-tcpip";
                           }
                   }
   
                 addrlen = sizeof(addr);                  addrlen = sizeof(addr);
                 newsock = accept(c->sock, &addr, &addrlen);                  newsock = accept(c->sock, &addr, &addrlen);
Line 1158 
Line 1166 
                 nc->host_port = c->host_port;                  nc->host_port = c->host_port;
                 strlcpy(nc->path, c->path, sizeof(nc->path));                  strlcpy(nc->path, c->path, sizeof(nc->path));
   
                 if (nextstate != SSH_CHANNEL_DYNAMIC)                  if (nextstate == SSH_CHANNEL_DYNAMIC) {
                           /*
                            * do not call the channel_post handler until
                            * this flag has been reset by a pre-handler.
                            * otherwise the FD_ISSET calls might overflow
                            */
                           nc->delayed = 1;
                   } else {
                         port_open_helper(nc, rtype);                          port_open_helper(nc, rtype);
                   }
         }          }
 }  }
   
Line 1409 
Line 1425 
 static void  static void
 channel_post_open_1(Channel *c, fd_set * readset, fd_set * writeset)  channel_post_open_1(Channel *c, fd_set * readset, fd_set * writeset)
 {  {
           if (c->delayed)
                   return;
         channel_handle_rfd(c, readset, writeset);          channel_handle_rfd(c, readset, writeset);
         channel_handle_wfd(c, readset, writeset);          channel_handle_wfd(c, readset, writeset);
 }  }
Line 1416 
Line 1434 
 static void  static void
 channel_post_open_2(Channel *c, fd_set * readset, fd_set * writeset)  channel_post_open_2(Channel *c, fd_set * readset, fd_set * writeset)
 {  {
           if (c->delayed)
                   return;
         channel_handle_rfd(c, readset, writeset);          channel_handle_rfd(c, readset, writeset);
         channel_handle_wfd(c, readset, writeset);          channel_handle_wfd(c, readset, writeset);
         channel_handle_efd(c, readset, writeset);          channel_handle_efd(c, readset, writeset);

Legend:
Removed from v.1.136  
changed lines
  Added in v.1.137