[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.148 and 1.149

version 1.148, 2001/12/19 07:18:56 version 1.149, 2001/12/20 16:37:29
Line 263 
Line 263 
         c->cb_arg = NULL;          c->cb_arg = NULL;
         c->cb_event = 0;          c->cb_event = 0;
         c->force_drain = 0;          c->force_drain = 0;
           c->single_connection = 0;
         c->detach_user = NULL;          c->detach_user = NULL;
         c->input_filter = NULL;          c->input_filter = NULL;
         debug("channel %d: new [%s]", found, remote_name);          debug("channel %d: new [%s]", found, remote_name);
Line 1003 
Line 1004 
                 debug("X11 connection requested.");                  debug("X11 connection requested.");
                 addrlen = sizeof(addr);                  addrlen = sizeof(addr);
                 newsock = accept(c->sock, &addr, &addrlen);                  newsock = accept(c->sock, &addr, &addrlen);
                   if (c->single_connection) {
                           debug("single_connection: closing X11 listener.");
                           channel_close_fd(&c->sock);
                           chan_mark_dead(c);
                   }
                 if (newsock < 0) {                  if (newsock < 0) {
                         error("accept: %.100s", strerror(errno));                          error("accept: %.100s", strerror(errno));
                         return;                          return;
Line 1029 
Line 1035 
                         packet_start(SSH2_MSG_CHANNEL_OPEN);                          packet_start(SSH2_MSG_CHANNEL_OPEN);
                         packet_put_cstring("x11");                          packet_put_cstring("x11");
                         packet_put_int(nc->self);                          packet_put_int(nc->self);
                         packet_put_int(c->local_window_max);                          packet_put_int(nc->local_window_max);
                         packet_put_int(c->local_maxpacket);                          packet_put_int(nc->local_maxpacket);
                         /* originator ipaddr and port */                          /* originator ipaddr and port */
                         packet_put_cstring(remote_ipaddr);                          packet_put_cstring(remote_ipaddr);
                         if (datafellows & SSH_BUG_X11FWD) {                          if (datafellows & SSH_BUG_X11FWD) {
Line 2399 
Line 2405 
  * an error occurs.   * an error occurs.
  */   */
 int  int
 x11_create_display_inet(int x11_display_offset, int gateway_ports)  x11_create_display_inet(int x11_display_offset, int gateway_ports,
       int single_connection)
 {  {
           Channel *nc = NULL;
         int display_number, sock;          int display_number, sock;
         u_short port;          u_short port;
         struct addrinfo hints, *ai, *aitop;          struct addrinfo hints, *ai, *aitop;
Line 2462 
Line 2470 
         /* Allocate a channel for each socket. */          /* Allocate a channel for each socket. */
         for (n = 0; n < num_socks; n++) {          for (n = 0; n < num_socks; n++) {
                 sock = socks[n];                  sock = socks[n];
                 (void) channel_new("x11 listener",                  nc = channel_new("x11 listener",
                     SSH_CHANNEL_X11_LISTENER, sock, sock, -1,                      SSH_CHANNEL_X11_LISTENER, sock, sock, -1,
                     CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,                      CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
                     0, xstrdup("X11 inet listener"), 1);                      0, xstrdup("X11 inet listener"), 1);
                   if (nc != NULL)
                           nc->single_connection = single_connection;
         }          }
   
         /* Return the display number for the DISPLAY environment variable. */          /* Return the display number for the DISPLAY environment variable. */

Legend:
Removed from v.1.148  
changed lines
  Added in v.1.149