]> granicus.if.org Git - curl/commitdiff
connection setup: if HTTP is disabled asking for HTTP proxy is bad
authorDaniel Stenberg <daniel@haxx.se>
Thu, 17 Mar 2011 10:45:58 +0000 (11:45 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 17 Mar 2011 10:45:58 +0000 (11:45 +0100)
lib/url.c

index 5faefd931fce1c3588867168bbaebfeee886290c..ecb3d33bb365b6060e5ae545fa20844c8d349f93 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -4832,9 +4832,14 @@ static CURLcode create_conn(struct SessionHandle *data,
   if(proxy && !(conn->handler->flags & PROTOPT_BANPROXY)) {
     if((conn->proxytype == CURLPROXY_HTTP) ||
        (conn->proxytype == CURLPROXY_HTTP_1_0)) {
+#ifdef CURL_DISABLE_HTTP
+      /* 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;
       conn->bits.httpproxy = TRUE;
+#endif
     }
     conn->bits.proxy = TRUE;
   }