diff options
author | Matt Johnston <matt@ucc.asn.au> | 2015-02-28 23:24:30 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2015-02-28 23:24:30 +0800 |
commit | 125a970d71d5b43b7b648412fcc614e782c42a1d (patch) | |
tree | 8bbc278b055fd573a9d40ba171d9031626551371 /common-session.c | |
parent | 59bb1777be18b8f1b263aaeabe54a32933fc871d (diff) | |
parent | 89c0b2a6d863e54bd0253355146f09b92edeccda (diff) |
merge tcp fastopen
Diffstat (limited to 'common-session.c')
-rw-r--r-- | common-session.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/common-session.c b/common-session.c index 971955a..be8f776 100644 --- a/common-session.c +++ b/common-session.c @@ -34,6 +34,7 @@ #include "kex.h" #include "channel.h" #include "runopts.h" +#include "netio.h" static void checktimeouts(); static long select_timeout(); @@ -167,6 +168,9 @@ void session_loop(void(*loophandler)()) { /* set up for channels which can be read/written */ setchannelfds(&readfd, &writefd); + /* Pending connections to test */ + set_connect_fds(&writefd); + val = select(ses.maxfd+1, &readfd, &writefd, NULL, &timeout); if (exitflag) { @@ -214,11 +218,13 @@ void session_loop(void(*loophandler)()) { process_packet(); } } - + /* if required, flush out any queued reply packets that were being held up during a KEX */ maybe_flush_reply_queue(); + handle_connect_fds(&writefd); + /* process pipes etc for the channels, ses.dataallowed == 0 * during rekeying ) */ channelio(&readfd, &writefd); @@ -275,6 +281,8 @@ void session_cleanup() { other session state is freed. */ remove_all_listeners(); + remove_connect_pending(); + while (!isempty(&ses.writequeue)) { buf_free(dequeue(&ses.writequeue)); } @@ -577,6 +585,11 @@ void update_channel_prio() { 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]; |