}
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;
/* 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 */
((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)?
*/
data->set.http_follow_location = va_arg(param, long)?TRUE:FALSE;
break;
+ case CURLOPT_HTTP_VERSION:
+ /*
+ * This sets a requested HTTP version to be used. The value is one of
+ * the listed enums in curl/curl.h.
+ */
+ data->set.httpversion = va_arg(param, long);
+ break;
case CURLOPT_TRANSFERTEXT:
/*
* This option was previously named 'FTPASCII'. Renamed to work with
if(va_arg(param, long))
data->set.httpreq = HTTPREQ_PUT;
break;
-#if 0
- /* obsolete stuff, kept here a while for informational purposes */
- case CURLOPT_MUTE:
- /*
- * Stay absolutely quiet.
- */
- data->set.mute = va_arg(param, long)?TRUE:FALSE;
- break;
-#endif
case CURLOPT_TIMECONDITION:
/*
* Set HTTP time condition. This must be one of the defines in the
struct curl_slist *quote; /* before the transfer */
struct curl_slist *postquote; /* after the transfer */
struct curl_slist *telnet_options; /* linked list of telnet options */
- TimeCond timecondition; /* kind of time/date comparison */
+ curl_TimeCond timecondition; /* kind of time/date comparison */
time_t timevalue; /* what time to compare with */
curl_closepolicy closepolicy; /* connection cache close concept */
Curl_HttpReq httpreq; /* what kind of HTTP request (if any) is this */
char *customrequest; /* HTTP/FTP request to use */
+ long httpversion; /* when non-zero, a specific HTTP version requested to
+ be used in the library's request(s) */
char *auth_host; /* if set, this is the allocated string to the host name
* to which to send the authorization data to, and no other
* host (which location-following otherwise could lead to)