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

Diff for /src/usr.bin/ssh/clientloop.c between version 1.29 and 1.30

version 1.29, 2000/07/16 08:27:21 version 1.30, 2000/08/19 18:48:11
Line 29 
Line 29 
 #include "channels.h"  #include "channels.h"
 #include "dispatch.h"  #include "dispatch.h"
   
   #include "buffer.h"
   #include "bufaux.h"
   
 /* Flag indicating that stdin should be redirected from /dev/null. */  /* Flag indicating that stdin should be redirected from /dev/null. */
 extern int stdin_null_flag;  extern int stdin_null_flag;
   
Line 722 
Line 725 
         dispatch_run(DISPATCH_NONBLOCK, &quit_pending);          dispatch_run(DISPATCH_NONBLOCK, &quit_pending);
 }  }
   
   /* scan stdin buf[] for '~' before sending data to the peer */
   
   int
   simple_escape_filter(Buffer *bin, char *buf, int len)
   {
           unsigned int i;
           unsigned char ch;
           for (i = 0; i < len; i++) {
                   ch = buf[i];
                   if (escape_pending) {
                           escape_pending = 0;
                           if (ch == '.') {
                                   quit_pending = 1;
                                   return -1;
                           }
                           if (ch != escape_char)
                                   buffer_put_char(bin, escape_char);
                   } else {
                           if (last_was_cr && ch == escape_char) {
                                   escape_pending = 1;
                                   continue;
                           }
                   }
                   last_was_cr = (ch == '\n' || ch == '\r');
                   buffer_put_char(bin, ch);
           }
           return 0;
   }
   
 /*  /*
  * Implements the interactive session with the server.  This is called after   * Implements the interactive session with the server.  This is called after
  * the user has been authenticated, and a command has been started on the   * the user has been authenticated, and a command has been started on the
Line 730 
Line 762 
  */   */
   
 int  int
 client_loop(int have_pty, int escape_char_arg)  client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
 {  {
         extern Options options;          extern Options options;
         double start_time, total_time;          double start_time, total_time;
Line 780 
Line 812 
         if (!compat20)          if (!compat20)
                 client_check_initial_eof_on_stdin();                  client_check_initial_eof_on_stdin();
   
           if (compat20 && escape_char != -1)
                   channel_register_filter(ssh2_chan_id, simple_escape_filter);
   
         /* Main loop of the client for the interactive session mode. */          /* Main loop of the client for the interactive session mode. */
         while (!quit_pending) {          while (!quit_pending) {
                 fd_set readset, writeset;                  fd_set readset, writeset;
Line 989 
Line 1024 
                 /* XXX move to channels.c */                  /* XXX move to channels.c */
                 sock = x11_connect_display();                  sock = x11_connect_display();
                 if (sock >= 0) {                  if (sock >= 0) {
   /*XXX MAXPACK */
                         id = channel_new("x11", SSH_CHANNEL_X11_OPEN,                          id = channel_new("x11", SSH_CHANNEL_X11_OPEN,
                             sock, sock, -1, 4*1024, 32*1024, 0,                              sock, sock, -1, 4*1024, 32*1024, 0,
                             xstrdup("x11"));                              xstrdup("x11"));

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30