aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-09-02 22:31:18 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-09-02 22:31:18 +0000
commit64bbe9dfafc6693a96b742f3133c636385835a19 (patch)
tree012bda8b5d41f89cd774b0aa7cc8cacc23aac175 /src/main.c
parent2e8a9416af0b59e98132e64c29f3919d9a7b9570 (diff)
James Gallagher's Content-Encoding work
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index fa2b43f38..9c8172477 100644
--- a/src/main.c
+++ b/src/main.c
@@ -352,8 +352,10 @@ static void help(void)
" --cacert <file> CA certifciate to verify peer against (SSL)\n"
" --capath <directory> CA directory (made using c_rehash) to verify\n"
" peer against (SSL, NOT Windows)\n"
- " --ciphers <list> What SSL ciphers to use (SSL)");
+ " --ciphers <list> What SSL ciphers to use (SSL)\n"
+ " --compressed Request a compressed response (using deflate).");
puts(" --connect-timeout <seconds> Maximum time allowed for connection\n"
+ " --crlf Convert LF to CRLF in upload. Useful for MVS (OS/390)\n"
" -f/--fail Fail silently (no output at all) on errors (H)\n"
" -F/--form <name=content> Specify HTTP POST data (H)\n"
" -g/--globoff Disable URL sequences and ranges using {} and []\n"
@@ -408,8 +410,7 @@ static void help(void)
" -1/--tlsv1 Force usage of TLSv1 (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"
- " --crlf Convert LF to CRLF in upload. Useful for MVS (OS/390)");
+ puts(" -#/--progress-bar Display transfer progress as a progress bar");
}
struct LongShort {
@@ -427,6 +428,7 @@ struct Configurable {
char *cookiejar; /* write to this file */
char *cookiefile; /* read from this file */
bool cookiesession; /* new session? */
+ bool encoding; /* Accept-Encoding please */
bool use_resume;
bool resume_from_current;
bool disable_epsv;
@@ -999,6 +1001,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
{"5g", "trace", TRUE},
{"5h", "trace-ascii", TRUE},
{"5i", "limit-rate", TRUE},
+ {"5j", "compressed", FALSE}, /* might take an arg someday */
{"0", "http1.0", FALSE},
{"1", "tlsv1", FALSE},
{"2", "sslv2", FALSE},
@@ -1213,6 +1216,11 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
config->sendpersecond = value;
}
break;
+
+ case 'j': /* --compressed */
+ config->encoding ^= TRUE;
+ break;
+
default: /* the URL! */
{
struct getout *url;
@@ -2806,6 +2814,10 @@ operate(struct Configurable *config, int argc, char *argv[])
}
curl_easy_setopt(curl, CURLOPT_VERBOSE, config->conf&CONF_VERBOSE);
+ /* new in curl 7.10 */
+ curl_easy_setopt(curl, CURLOPT_ENCODING,
+ (config->encoding) ? "deflate" : NULL);
+
res = curl_easy_perform(curl);
if((config->progressmode == CURL_PROGRESS_BAR) &&