Steve Holme wrote:
> * waitconnect_getsock() then returns 1 due to the TUNNEL_CONNECT test at
> multi.c:640 but it doesn't set any of the socket handles

Yes, this is the bug. Looks like I introduced it in my original Happy Eyeballs 
patch. Here is a patch to fix it.

-- 
Björn
From 1d2639df6d63abadf59fa736b6e8221f3c2808d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Stenberg?= <bjst@bjorn>
Date: Mon, 11 Nov 2013 23:43:48 +0100
Subject: [PATCH] multi: Set read sock when returning READSOCK(0)

Bug: If tunnel state was TUNNEL_CONNECT, waitconnect_getsock()
returned a bitmask indicating a readable socket but never stored the
socket in the return array.

This patch fixes that.
---
 lib/multi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/multi.c b/lib/multi.c
index 722cd86..2cb46ce 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -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;
 }
-- 
1.8.4.rc3

Attachment: signature.asc
Description: Digital signature

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to