aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-05-25 15:57:38 +0200
committerDaniel Stenberg <daniel@haxx.se>2011-05-25 15:57:38 +0200
commit017ee34bbad9885e524f735401be7ad859cdbd84 (patch)
tree4f38cd10b439a7c3b7be873f7adc4951fabf8c17
parent340228cc8121270adbde1d49326327d48165e463 (diff)
create_conn: only switch protocol handler if necessary
When switching to HTTP because a HTTP proxy is being used, the existing handler is now checked if it already is "compatible". This allows the https handler remain while other non-http handlers will be redirected. Bug: http://curl.haxx.se/mail/lib-2011-05/0214.html Reported by: Jerome Robert
-rw-r--r--lib/url.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/url.c b/lib/url.c
index ac3399b9e..d37fe6dfc 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -4812,8 +4812,11 @@ static CURLcode create_conn(struct SessionHandle *data,
/* asking for a HTTP proxy is a bit funny when HTTP is disabled... */
return CURLE_UNSUPPORTED_PROTOCOL;
#else
- /* force this connection's protocol to become HTTP */
- conn->handler = &Curl_handler_http;
+ /* force this connection's protocol to become HTTP if not already
+ compatible */
+ if(!(conn->handler->protocol & CURLPROTO_HTTP))
+ conn->handler = &Curl_handler_http;
+
conn->bits.httpproxy = TRUE;
#endif
}