diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2002-09-02 22:31:18 +0000 | 
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2002-09-02 22:31:18 +0000 | 
| commit | 64bbe9dfafc6693a96b742f3133c636385835a19 (patch) | |
| tree | 012bda8b5d41f89cd774b0aa7cc8cacc23aac175 /src | |
| parent | 2e8a9416af0b59e98132e64c29f3919d9a7b9570 (diff) | |
James Gallagher's Content-Encoding work
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile.am | 2 | ||||
| -rw-r--r-- | src/main.c | 18 | 
2 files changed, 16 insertions, 4 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 82433a659..27c4a0bcd 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -18,7 +18,7 @@ curl_SOURCES = main.c hugehelp.c urlglob.c writeout.c setup.h \  	config-win32.h config-mac.h config-vms.h config-riscos.h \  	urlglob.h version.h writeout.h writeenv.c writeenv.h -curl_LDADD = ../lib/libcurl.la +curl_LDADD = ../lib/libcurl.la -lz  curl_DEPENDENCIES = ../lib/libcurl.la  BUILT_SOURCES = hugehelp.c  CLEANFILES = hugehelp.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 <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) &&  | 
