aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-10-09 06:53:11 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-10-09 06:53:11 +0000
commit56bc31e9f9082e404ef813fb5a670f1f743b081d (patch)
tree0c3d30eda809235f8c0c272836e7f7503a62f89b /src
parenta9181f8f00d5bdfda39e227ed2ec4076ee4d2baa (diff)
Added -0/--http1.0 to enforce HTTP 1.0 requests
Diffstat (limited to 'src')
-rw-r--r--src/main.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 3b6d8e2c3..460785b00 100644
--- a/src/main.c
+++ b/src/main.c
@@ -363,6 +363,7 @@ static void help(void)
" -Y/--speed-limit Stop transfer if below speed-limit for 'speed-time' secs\n"
" -z/--time-cond <time> Includes a time condition to the server (H)\n"
" -Z/--max-redirs <num> Set maximum number of redirections allowed (H)\n"
+ " -0/--http1.0 Force usage of HTTP 1.0 (H)\n"
" -2/--sslv2 Force usage of SSLv2 (H)\n"
" -3/--sslv3 Force usage of SSLv3 (H)");
puts(" -#/--progress-bar Display transfer progress as a progress bar\n"
@@ -421,6 +422,7 @@ struct Configurable {
bool crlf;
char *customrequest;
char *krb4level;
+ long httpversion;
bool progressmode;
bool nobuffer;
bool globoff;
@@ -434,7 +436,7 @@ struct Configurable {
struct curl_slist *postquote;
long ssl_version;
- TimeCond timecond;
+ curl_TimeCond timecond;
time_t condtime;
struct curl_slist *headers;
@@ -860,6 +862,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
{"5c", "connect-timeout", TRUE},
{"5d", "ciphers", TRUE},
+ {"0", "http1.0", FALSE},
{"2", "sslv2", FALSE},
{"3", "sslv3", FALSE},
{"a", "append", FALSE},
@@ -1053,6 +1056,10 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
case '#': /* added 19990617 larsa */
config->progressmode ^= CURL_PROGRESS_BAR;
break;
+ case '0':
+ /* HTTP version 1.0 */
+ config->httpversion = CURL_HTTP_VERSION_1_0;
+ break;
case '2':
/* SSL version 2 */
config->ssl_version = 2;
@@ -2285,9 +2292,11 @@ operate(struct Configurable *config, int argc, char *argv[])
curl_easy_setopt(curl, CURLOPT_EGDSOCKET, config->egd_file);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, config->connecttimeout);
- /* debug */
if(config->cipher_list)
curl_easy_setopt(curl, CURLOPT_SSL_CIPHER_LIST, config->cipher_list);
+
+ if(config->httpversion)
+ curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, config->httpversion);
res = curl_easy_perform(curl);