summaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-05-22 23:34:10 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-05-23 00:20:40 +0200
commit8e34b022d52227936136a69ea06aca7b24be952e (patch)
tree9571f9cfd593ad7f7dd62bb7a4acf812285e1d75 /lib/url.c
parent945919db5b42f40a174598ba73e54b775bf85faf (diff)
downloadcurl-bagder/non-http-no-http-proxy.tar.gz
http-proxy: only attempt FTP over HTTP proxybagder/non-http-no-http-proxy
... all other non-HTTP protocol schemes are now defaulting to "tunnel trough" mode if a HTTP proxy is specified. In reality there are no HTTP proxies out there that allow those other schemes. Assisted-by: Ray Satiro, Michael Kaufmann
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/url.c b/lib/url.c
index 8e470b0e1..21f0e3d5e 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -5317,12 +5317,15 @@ static CURLcode create_conn_helper_init_proxy(struct connectdata *conn)
result = CURLE_UNSUPPORTED_PROTOCOL;
goto out;
#else
- /* force this connection's protocol to become HTTP if not already
- compatible - if it isn't tunneling through */
- if(!(conn->handler->protocol & PROTO_FAMILY_HTTP) &&
- !conn->bits.tunnel_proxy)
- conn->handler = &Curl_handler_http;
-
+ /* force this connection's protocol to become HTTP if compatible */
+ if(!(conn->handler->protocol & PROTO_FAMILY_HTTP)) {
+ if((conn->handler->flags & PROTOPT_HTTP_PROXY) &&
+ !conn->bits.tunnel_proxy)
+ conn->handler = &Curl_handler_http;
+ else
+ /* if not converting to HTTP over the proxy, enforce tunneling */
+ conn->bits.tunnel_proxy = TRUE;
+ }
conn->bits.httpproxy = TRUE;
#endif
}