aboutsummaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-06-15 13:45:57 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-06-15 13:46:48 +0200
commitefc83d6d541ab62c7beb1ddca09f6c1986fbeac7 (patch)
treec09449b442a0ff2dcc4a5c57427041ed5d26b1c9 /lib/url.c
parent4d1147ae20756925ccd6e2d4ace31fe92ae0d681 (diff)
http-proxy: only attempt FTP over 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 Closes #1505
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 51e50a80b..20fdbbbb9 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -5348,12 +5348,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_PROXY_AS_HTTP) &&
+ !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
}