# HG changeset patch # User Matt Johnston # Date 1425223602 -28800 # Node ID 4c733310c21dc41b95b023a6c6f60134f2ae87cd # Parent 703c7cdd25772445a7d02a1b0d7f66293852e0b3 reword comment for clarity diff -r 703c7cdd2577 -r 4c733310c21d common-session.c --- a/common-session.c Sun Mar 01 23:02:06 2015 +0800 +++ b/common-session.c Sun Mar 01 23:26:42 2015 +0800 @@ -152,8 +152,10 @@ FD_ZERO(&readfd); dropbear_assert(ses.payload == NULL); - /* during initial setup we flush out the KEXINIT packet before - * attempting to read the remote version string, which might block */ + /* We delay reading from the input socket during initial setup until + after we have written out our initial KEXINIT packet (empty writequeue). + This means our initial packet can be in-flight while we're doing a blocking + read for the remote ident */ if (ses.sock_in != -1 && (ses.remoteident || isempty(&ses.writequeue))) { FD_SET(ses.sock_in, &readfd); }