summaryrefslogtreecommitdiffhomepage
path: root/cli-chansession.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2014-07-16 22:53:32 +0800
committerMatt Johnston <matt@ucc.asn.au>2014-07-16 22:53:32 +0800
commitda57dd13c5352efd63c8692bbc12d19c9f882a2b (patch)
treeec18c7626bb47b3c4540f78d65d2a49b8a2d2fbf /cli-chansession.c
parentf1826ea389bfddb6a0d52314d01e3d8b8f46eec8 (diff)
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.
Diffstat (limited to 'cli-chansession.c')
-rw-r--r--cli-chansession.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/cli-chansession.c b/cli-chansession.c
index fa97a6a..c16443e 100644
--- a/cli-chansession.c
+++ b/cli-chansession.c
@@ -41,7 +41,7 @@ static void cli_chansessreq(struct Channel *channel);
static void send_chansess_pty_req(struct Channel *channel);
static void send_chansess_shell_req(struct Channel *channel);
static void cli_escape_handler(struct Channel *channel, unsigned char* buf, int *len);
-
+static int cli_init_netcat(struct Channel *channel);
static void cli_tty_setup();
@@ -357,6 +357,11 @@ static int cli_init_stdpipe_sess(struct Channel *channel) {
return 0;
}
+static int cli_init_netcat(struct Channel *channel) {
+ channel->prio = DROPBEAR_CHANNEL_PRIO_UNKNOWABLE;
+ return cli_init_stdpipe_sess(channel);
+}
+
static int cli_initchansess(struct Channel *channel) {
cli_init_stdpipe_sess(channel);
@@ -369,8 +374,9 @@ static int cli_initchansess(struct Channel *channel) {
if (cli_opts.wantpty) {
send_chansess_pty_req(channel);
+ channel->prio = DROPBEAR_CHANNEL_PRIO_INTERACTIVE;
} else {
- set_sock_priority(ses.sock_out, DROPBEAR_PRIO_BULK);
+ channel->prio = DROPBEAR_CHANNEL_PRIO_BULK;
}
send_chansess_shell_req(channel);
@@ -389,7 +395,7 @@ static int cli_initchansess(struct Channel *channel) {
static const struct ChanType cli_chan_netcat = {
0, /* sepfds */
"direct-tcpip",
- cli_init_stdpipe_sess, /* inithandler */
+ cli_init_netcat, /* inithandler */
NULL,
NULL,
cli_closechansess