comparison cli-chansession.c @ 1278:0c47d97aa9d5

merge
author Matt Johnston <matt@ucc.asn.au>
date Wed, 16 Mar 2016 22:53:27 +0800
parents 9169e4e7cbee
children 750ec4ec4cbe
comparison
equal deleted inserted replaced
1264:a20b6af6f182 1278:0c47d97aa9d5
41 static void send_chansess_pty_req(struct Channel *channel); 41 static void send_chansess_pty_req(struct Channel *channel);
42 static void send_chansess_shell_req(struct Channel *channel); 42 static void send_chansess_shell_req(struct Channel *channel);
43 static void cli_escape_handler(struct Channel *channel, unsigned char* buf, int *len); 43 static void cli_escape_handler(struct Channel *channel, unsigned char* buf, int *len);
44 static int cli_init_netcat(struct Channel *channel); 44 static int cli_init_netcat(struct Channel *channel);
45 45
46 static void cli_tty_setup(); 46 static void cli_tty_setup(void);
47 47
48 const struct ChanType clichansess = { 48 const struct ChanType clichansess = {
49 0, /* sepfds */ 49 0, /* sepfds */
50 "session", /* name */ 50 "session", /* name */
51 cli_initchansess, /* inithandler */ 51 cli_initchansess, /* inithandler */
436 do_escape(unsigned char c) { 436 do_escape(unsigned char c) {
437 switch (c) { 437 switch (c) {
438 case '.': 438 case '.':
439 dropbear_exit("Terminated"); 439 dropbear_exit("Terminated");
440 return 1; 440 return 1;
441 break;
442 case 0x1a: 441 case 0x1a:
443 /* ctrl-z */ 442 /* ctrl-z */
444 cli_tty_cleanup(); 443 cli_tty_cleanup();
445 kill(getpid(), SIGTSTP); 444 kill(getpid(), SIGTSTP);
446 /* after continuation */ 445 /* after continuation */
447 cli_tty_setup(); 446 cli_tty_setup();
448 cli_ses.winchange = 1; 447 cli_ses.winchange = 1;
449 return 1; 448 return 1;
450 break; 449 default:
451 } 450 return 0;
452 return 0; 451 }
453 } 452 }
454 453
455 static 454 static
456 void cli_escape_handler(struct Channel* UNUSED(channel), unsigned char* buf, int *len) { 455 void cli_escape_handler(struct Channel* UNUSED(channel), unsigned char* buf, int *len) {
457 char c; 456 char c;