]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
multi: Set read socket when returning READSOCK(0)
authorBjörn Stenberg <bjst@bjorn>
Mon, 11 Nov 2013 22:43:48 +0000 (23:43 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Mon, 11 Nov 2013 23:41:44 +0000 (23:41 +0000)
This patch fixes and issue introduced in commit 7d7df831981fee, if the
tunnel state was TUNNEL_CONNECT, waitconnect_getsock() would return a
bitmask indicating a readable socket but never stored the socket in the
return array.

lib/multi.c

index 722cd8625b619fad8816fb8cda7b06605569feb3..2cb46ceeca6331c2b60107e4521ee01ec2a1e3af 100644 (file)
@@ -637,8 +637,10 @@ static int waitconnect_getsock(struct connectdata *conn,
 
   /* when we've sent a CONNECT to a proxy, we should rather wait for the
      socket to become readable to be able to get the response headers */
-  if(conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT)
+  if(conn->tunnel_state[FIRSTSOCKET] == TUNNEL_CONNECT) {
+    sock[0] = conn->sock[FIRSTSOCKET];
     return GETSOCK_READSOCK(0);
+  }
 
   return rc;
 }