aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-10-09 06:52:37 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-10-09 06:52:37 +0000
commita9181f8f00d5bdfda39e227ed2ec4076ee4d2baa (patch)
treee7f0023696b916783bbea5546a205a24f648301b /lib/http.c
parent3685f792cbd271ecdc623de2e0b48e1debab6109 (diff)
added the option CURLOPT_HTTP_VERSION that can specify which HTTP version
libcurl should use in its request
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/http.c b/lib/http.c
index 353ab5c7c..ea1e4b6c0 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -555,6 +555,10 @@ CURLcode Curl_http(struct connectdata *conn)
}
do {
+ /* Use 1.1 unless the use specificly asked for 1.0 */
+ const char *httpstring=
+ data->set.httpversion==CURL_HTTP_VERSION_1_0?"1.0":"1.1";
+
send_buffer *req_buffer;
struct curl_slist *headers=data->set.headers;
@@ -564,7 +568,7 @@ CURLcode Curl_http(struct connectdata *conn)
/* add the main request stuff */
add_bufferf(req_buffer,
"%s " /* GET/HEAD/POST/PUT */
- "%s HTTP/1.1\r\n" /* path */
+ "%s HTTP/%s\r\n" /* path */
"%s" /* proxyuserpwd */
"%s" /* userpwd */
"%s" /* range */
@@ -580,7 +584,7 @@ CURLcode Curl_http(struct connectdata *conn)
((HTTPREQ_POST == data->set.httpreq) ||
(HTTPREQ_POST_FORM == data->set.httpreq))?"POST":
(HTTPREQ_PUT == data->set.httpreq)?"PUT":"GET"),
- ppath,
+ ppath, httpstring,
(conn->bits.proxy_user_passwd &&
conn->allocptr.proxyuserpwd)?conn->allocptr.proxyuserpwd:"",
(conn->bits.user_passwd && conn->allocptr.userpwd)?