From 64bbe9dfafc6693a96b742f3133c636385835a19 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 2 Sep 2002 22:31:18 +0000 Subject: James Gallagher's Content-Encoding work --- src/main.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/main.c') 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 CA certifciate to verify peer against (SSL)\n" " --capath CA directory (made using c_rehash) to verify\n" " peer against (SSL, NOT Windows)\n" - " --ciphers What SSL ciphers to use (SSL)"); + " --ciphers What SSL ciphers to use (SSL)\n" + " --compressed Request a compressed response (using deflate)."); puts(" --connect-timeout 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 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) && -- cgit v1.2.3