Commit db688e3e authored by Matt Johnston's avatar Matt Johnston
Browse files

Experiment of always writing data if available. Might waste a writev() with

EAGAIN but always saves a select() - needs testing with bandwidth-limited
and CPU-limited situations.
parent e767bbb4
......@@ -186,13 +186,7 @@ void session_loop(void(*loophandler)()) {
/* 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)) {
if (!ses.remoteident) {
......@@ -218,6 +212,14 @@ void session_loop(void(*loophandler)()) {
* during rekeying ) */
channelio(&readfd, &writefd);
/* process session socket's outgoing data */
if (ses.sock_out != -1) {
if (!isempty(&ses.writequeue)) {
write_packet();
}
}
if (loophandler) {
loophandler();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment