changeset 1031:64c0aa01e2b6 fastopen

Update priority once the socket is open
author Matt Johnston <matt@ucc.asn.au>
date Fri, 20 Feb 2015 22:13:53 +0800
parents 1fff5d7163f6
children 0da8ba489c23
files cli-session.c common-session.c
diffstat 2 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cli-session.c	Thu Feb 19 22:42:30 2015 +0800
+++ b/cli-session.c	Fri Feb 20 22:13:53 2015 +0800
@@ -100,6 +100,7 @@
 		dropbear_exit("Connect failed: %s", errstring);
 	}
 	ses.sock_in = ses.sock_out = sock;
+	update_channel_prio();
 }
 
 void cli_session(int sock_in, int sock_out, struct dropbear_progress_connection *progress) {
--- a/common-session.c	Thu Feb 19 22:42:30 2015 +0800
+++ b/common-session.c	Fri Feb 20 22:13:53 2015 +0800
@@ -552,6 +552,11 @@
 
 	TRACE(("update_channel_prio"))
 
+	if (ses.sock_out < 0) {
+		TRACE(("leave update_channel_prio: no socket"))
+		return;
+	}
+
 	new_prio = DROPBEAR_PRIO_BULK;
 	for (i = 0; i < ses.chansize; i++) {
 		struct Channel *channel = ses.channels[i];