diff common-session.c @ 1062:210982935887 coverity

merge
author Matt Johnston <matt@ucc.asn.au>
date Mon, 02 Mar 2015 21:17:41 +0800
parents 4c733310c21d
children 2fa71c3b2827 10f198d4a308
line wrap: on
line diff
--- a/common-session.c	Sat Feb 28 23:25:16 2015 +0800
+++ b/common-session.c	Mon Mar 02 21:17:41 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);
 		}