Mercurial > dropbear
comparison cli-chansession.c @ 941:5daedffd0769
Set tcp priority as follows:
if (connecting || ptys || x11) tos = LOWDELAY;
else if (tcp_forwards) tos = 0;
else tos = BULK;
TCP forwards could be either lowdelay or bulk, hence the default priority.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 16 Jul 2014 22:53:32 +0800 |
parents | a287954a16d6 |
children | 0bb16232e7c4 |
comparison
equal
deleted
inserted
replaced
940:e9dfb6d15193 | 941:5daedffd0769 |
---|---|
39 static int cli_initchansess(struct Channel *channel); | 39 static int cli_initchansess(struct Channel *channel); |
40 static void cli_chansessreq(struct Channel *channel); | 40 static void cli_chansessreq(struct Channel *channel); |
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 | 44 static int cli_init_netcat(struct Channel *channel); |
45 | 45 |
46 static void cli_tty_setup(); | 46 static void cli_tty_setup(); |
47 | 47 |
48 const struct ChanType clichansess = { | 48 const struct ChanType clichansess = { |
49 0, /* sepfds */ | 49 0, /* sepfds */ |
355 | 355 |
356 channel->extrabuf = cbuf_new(opts.recv_window); | 356 channel->extrabuf = cbuf_new(opts.recv_window); |
357 return 0; | 357 return 0; |
358 } | 358 } |
359 | 359 |
360 static int cli_init_netcat(struct Channel *channel) { | |
361 channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE; | |
362 return cli_init_stdpipe_sess(channel); | |
363 } | |
364 | |
360 static int cli_initchansess(struct Channel *channel) { | 365 static int cli_initchansess(struct Channel *channel) { |
361 | 366 |
362 cli_init_stdpipe_sess(channel); | 367 cli_init_stdpipe_sess(channel); |
363 | 368 |
364 #ifdef ENABLE_CLI_AGENTFWD | 369 #ifdef ENABLE_CLI_AGENTFWD |
367 } | 372 } |
368 #endif | 373 #endif |
369 | 374 |
370 if (cli_opts.wantpty) { | 375 if (cli_opts.wantpty) { |
371 send_chansess_pty_req(channel); | 376 send_chansess_pty_req(channel); |
377 channel->prio = DROPBEAR_CHANNEL_PRIO_INTERACTIVE; | |
372 } else { | 378 } else { |
373 set_sock_priority(ses.sock_out, DROPBEAR_PRIO_BULK); | 379 channel->prio = DROPBEAR_CHANNEL_PRIO_BULK; |
374 } | 380 } |
375 | 381 |
376 send_chansess_shell_req(channel); | 382 send_chansess_shell_req(channel); |
377 | 383 |
378 if (cli_opts.wantpty) { | 384 if (cli_opts.wantpty) { |
387 #ifdef ENABLE_CLI_NETCAT | 393 #ifdef ENABLE_CLI_NETCAT |
388 | 394 |
389 static const struct ChanType cli_chan_netcat = { | 395 static const struct ChanType cli_chan_netcat = { |
390 0, /* sepfds */ | 396 0, /* sepfds */ |
391 "direct-tcpip", | 397 "direct-tcpip", |
392 cli_init_stdpipe_sess, /* inithandler */ | 398 cli_init_netcat, /* inithandler */ |
393 NULL, | 399 NULL, |
394 NULL, | 400 NULL, |
395 cli_closechansess | 401 cli_closechansess |
396 }; | 402 }; |
397 | 403 |