diff options
author | Daniel Stenberg <daniel@haxx.se> | 2009-02-02 16:19:23 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2009-02-02 16:19:23 +0000 |
commit | bdd4294e79eea15cb6f312f7ee7d388ad40a65e3 (patch) | |
tree | bfd4285bac21f3c71ad770df722bf87ed0d14c42 /lib/http.c | |
parent | dcf92bffd2a22909a44b45bd7490e2575e14f82c (diff) | |
download | curl-bdd4294e79eea15cb6f312f7ee7d388ad40a65e3.tar.gz |
- Craig A West brought us: libcurl now defaults to do CONNECT with HTTP
version 1.1 instead of 1.0 like before. This change also introduces the new
proxy type for libcurl called 'CURLPROXY_HTTP_1_0' that then allows apps to
switch (back) to CONNECT 1.0 requests. The curl tool also got a --proxy1.0
option that works exactly like --proxy but sets CURLPROXY_HTTP_1_0.
I updated all test cases cases that use CONNECT and I tried to do some using
--proxy1.0 and some updated to do CONNECT 1.1 to get both versions run.
Diffstat (limited to 'lib/http.c')
-rw-r--r-- | lib/http.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/http.c b/lib/http.c index b96d51d78..dc5066f8a 100644 --- a/lib/http.c +++ b/lib/http.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -1343,6 +1343,8 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn, char *host=(char *)""; const char *proxyconn=""; const char *useragent=""; + const char *http = (conn->proxytype == CURLPROXY_HTTP_1_0) ? + "1.0" : "1.1"; if(!checkheaders(data, "Host:")) { host = aprintf("Host: %s\r\n", host_port); @@ -1363,12 +1365,12 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn, /* BLOCKING */ result = add_bufferf(req_buffer, - "CONNECT %s:%d HTTP/1.0\r\n" + "CONNECT %s:%d HTTP/%s\r\n" "%s" /* Host: */ "%s" /* Proxy-Authorization */ "%s" /* User-Agent */ "%s", /* Proxy-Connection */ - hostname, remote_port, + hostname, remote_port, http, host, conn->allocptr.proxyuserpwd? conn->allocptr.proxyuserpwd:"", |