Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http_proxy: multiple CONNECT with hyper done better #7888

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 17 additions & 2 deletions lib/http_proxy.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -936,6 +943,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;
Expand Down
1 change: 0 additions & 1 deletion tests/data/DISABLED
Expand Up @@ -40,7 +40,6 @@
# hyper support remains EXPERIMENTAL as long as there's a test number
# listed below
%if hyper
206
207
209
213
Expand Down