Skip to content
Snippets Groups Projects
Commit f75ba41a authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Protocols.HTTP [do_async_proxied_method]: Check whether CONNECT failed.

Do not attempt to start a TLS connection over a socket where
the proxy has returned a failure code.

Fixes [PIKE-198].
parent 0c808b83
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,8 @@ constant DAV_STORAGE_FULL = 507; // RFC 2518 10.6: Insufficient Storage
m_delete(proxy_headers, "authorization"); // Keep the proxy in the dark.
con = do_method("CONNECT", proxy, 0, proxy_headers);
con->data(0);
if (con->status/100 > 2) {
if (con->status >= 300) {
// Proxy did not like us or failed to connect to the remote.
return con;
}
con->headers["connect"] = "keep-alive";
......@@ -382,6 +383,13 @@ protected void https_proxy_connect_ok(Protocols.HTTP.Query con,
mapping(string:string) request_headers,
string data)
{
if (con->status >= 300) {
// Proxy did not like us or failed to connect to the remote.
https_proxy_connect_fail(con, orig_cb_info, url, method,
query_variables, request_headers,
data);
return;
}
con->set_callbacks(@orig_cb_info);
con->headers["connect"] = "keep-alive";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment