]> granicus.if.org Git - curl/commitdiff
create_conn: don't switch to HTTP protocol if tunneling is enabled
authorDaniel Stenberg <daniel@haxx.se>
Fri, 9 Dec 2011 21:51:08 +0000 (22:51 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 9 Dec 2011 21:51:08 +0000 (22:51 +0100)
This is a regression since who knows when. When spotting that a HTTP
proxy is used we must not uncondititionally enable the HTTP protocol
since if we do tunneling through the proxy we're still using the target
protocol.

Reported by: Naveen Chandran

lib/url.c

index 2c5cb39b843c39ea9ccf16829bfb0b3df852d27c..42e1756f969cb8172cbe59d75b317ba3b95a9fd7 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -4900,8 +4900,9 @@ static CURLcode create_conn(struct SessionHandle *data,
       return CURLE_UNSUPPORTED_PROTOCOL;
 #else
       /* force this connection's protocol to become HTTP if not already
-         compatible */
-      if(!(conn->handler->protocol & CURLPROTO_HTTP))
+         compatible - if it isn't tunneling through */
+      if(!(conn->handler->protocol & CURLPROTO_HTTP) &&
+         !conn->bits.tunnel_proxy)
         conn->handler = &Curl_handler_http;
 
       conn->bits.httpproxy = TRUE;