=== modified file 'common-session.c' --- common-session.c 2014-01-29 17:44:42 +0000 +++ common-session.c 2015-09-18 03:44:33 +0000 @@ -187,12 +187,7 @@ /* check for auth timeout, rekeying required etc */ checktimeouts(); - /* process session socket's incoming/outgoing data */ - if (ses.sock_out != -1) { - if (FD_ISSET(ses.sock_out, &writefd) && !isempty(&ses.writequeue)) { - write_packet(); - } - } + /* process session socket's incoming data */ if (ses.sock_in != -1) { if (FD_ISSET(ses.sock_in, &readfd)) { @@ -220,6 +215,11 @@ if (ses.dataallowed) { channelio(&readfd, &writefd); } + if (ses.sock_out != -1) { + if (!isempty(&ses.writequeue)) { + write_packet(); + } + } if (loophandler) { loophandler();