aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ftp.c1
-rw-r--r--lib/http.c8
-rw-r--r--lib/url.c14
3 files changed, 15 insertions, 8 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 0723abe7e..3cc259d69 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1894,6 +1894,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
break;
#endif /* CURL_DISABLE_PROXY */
case CURLPROXY_HTTP:
+ case CURLPROXY_HTTP_1_0:
/* do nothing here. handled later. */
break;
default:
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:"",
diff --git a/lib/url.c b/lib/url.c
index bd9a7e690..7cbe3cec0 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1453,7 +1453,7 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
case CURLOPT_PROXYTYPE:
/*
- * Set proxy type. HTTP/SOCKS4/SOCKS4a/SOCKS5/SOCKS5_HOSTNAME
+ * Set proxy type. HTTP/HTTP_1_0/SOCKS4/SOCKS4a/SOCKS5/SOCKS5_HOSTNAME
*/
data->set.proxytype = (curl_proxytype)va_arg(param, long);
break;
@@ -2857,6 +2857,7 @@ static CURLcode ConnectPlease(struct SessionHandle *data,
break;
#endif /* CURL_DISABLE_PROXY */
case CURLPROXY_HTTP:
+ case CURLPROXY_HTTP_1_0:
/* do nothing here. handled later. */
break;
default:
@@ -4214,9 +4215,11 @@ static CURLcode create_conn(struct SessionHandle *data,
conn->bits.proxy = (bool)(data->set.str[STRING_PROXY] &&
*data->set.str[STRING_PROXY]);
- conn->bits.httpproxy = (bool)(conn->bits.proxy
- && (conn->proxytype == CURLPROXY_HTTP));
- conn->bits.proxy_user_passwd = (bool)(NULL != data->set.str[STRING_PROXYUSERNAME]);
+ conn->bits.httpproxy = (bool)(conn->bits.proxy &&
+ (conn->proxytype == CURLPROXY_HTTP ||
+ conn->proxytype == CURLPROXY_HTTP_1_0));
+ conn->bits.proxy_user_passwd =
+ (bool)(NULL != data->set.str[STRING_PROXYUSERNAME]);
conn->bits.tunnel_proxy = data->set.tunnel_thru_httpproxy;
#endif /* CURL_DISABLE_PROXY */
@@ -4315,7 +4318,8 @@ static CURLcode create_conn(struct SessionHandle *data,
if(proxy && *proxy) {
long bits = conn->protocol & (PROT_HTTPS|PROT_SSL|PROT_MISSING);
- if(conn->proxytype == CURLPROXY_HTTP) {
+ if((conn->proxytype == CURLPROXY_HTTP) ||
+ (conn->proxytype == CURLPROXY_HTTP_1_0)) {
/* force this connection's protocol to become HTTP */
conn->protocol = PROT_HTTP | bits;
conn->bits.httpproxy = TRUE;