diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-10-21 16:42:42 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-10-21 17:28:27 +0200 |
commit | 823d3ab855c55e26d595cfda1a13814baa0f684c (patch) | |
tree | 3233bee57528eac170b2e602bdff31b2fdd142a7 /lib/http_proxy.c | |
parent | 5276ec941f09de411d5c00ba2dbc8ac043b705d8 (diff) | |
download | curl-823d3ab855c55e26d595cfda1a13814baa0f684c.tar.gz |
http_proxy: multiple CONNECT with hyper done better
Enabled test 206
Closes #7888
Diffstat (limited to 'lib/http_proxy.c')
-rw-r--r-- | lib/http_proxy.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/http_proxy.c b/lib/http_proxy.c index d144990c5..8fc9c6222 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -284,8 +284,7 @@ static CURLcode CONNECT(struct Curl_easy *data, /* This only happens if we've looped here due to authentication reasons, and we don't really use the newly cloned URL here then. Just free() it. */ - free(data->req.newurl); - data->req.newurl = NULL; + Curl_safefree(data->req.newurl); /* initialize send-buffer */ Curl_dyn_init(req, DYN_HTTP_REQUEST); @@ -805,6 +804,14 @@ static CURLcode CONNECT(struct Curl_easy *data, goto error; } + infof(data, "Establish HTTP proxy tunnel to %s:%d", + hostname, remote_port); + + /* This only happens if we've looped here due to authentication + reasons, and we don't really use the newly cloned URL here + then. Just free() it. */ + Curl_safefree(data->req.newurl); + result = CONNECT_host(data, conn, hostname, remote_port, &hostheader, &host); if(result) @@ -945,6 +952,14 @@ static CURLcode CONNECT(struct Curl_easy *data, default: break; } + + /* If we are supposed to continue and request a new URL, which basically + * means the HTTP authentication is still going on so if the tunnel + * is complete we start over in INIT state */ + if(data->req.newurl && (TUNNEL_COMPLETE == s->tunnel_state)) { + infof(data, "CONNECT request done, loop to make another"); + connect_init(data, TRUE); /* reinit */ + } } while(data->req.newurl); result = CURLE_OK; |