From 28b932fb4ef14b8b9ebda6823c98fbedad6be4b2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 12 Feb 2007 21:13:47 +0000 Subject: - Shmulik Regev fixed so that the final CRLF of HTTP response headers are sent to the debug callback. - Shmulik Regev added CURLOPT_HTTP_CONTENT_DECODING and CURLOPT_HTTP_TRANSFER_DECODING that if set to zero will disable libcurl's internal decoding of content or transfer encoded content. This may be preferable in cases where you use libcurl for proxy purposes or similar. The command line tool got a --raw option to disable both at once. --- src/main.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index e35050025..d0b885151 100644 --- a/src/main.c +++ b/src/main.c @@ -20,7 +20,6 @@ * * $Id$ ***************************************************************************/ - #include "setup.h" #include @@ -470,7 +469,7 @@ struct Configurable { bool disable_sessionid; char *libcurl; /* output libcurl code to this file name */ - + bool raw; struct OutStruct *outs; }; @@ -683,6 +682,7 @@ static void help(void) " -Q/--quote Send command(s) to server before file transfer (F)", " -r/--range Retrieve a byte range from a HTTP/1.1 or FTP server", " --random-file File for reading random data from (SSL)", + " --raw Pass HTTP \"raw\", without any transfer decoding (H)", " -R/--remote-time Set the remote file's time on the local output", " --retry Retry request times if transient problems occur", " --retry-delay When retrying, wait this many seconds between each", @@ -1473,6 +1473,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ {"$x", "ftp-ssl-control", FALSE}, {"$y", "ftp-ssl-ccc", FALSE}, {"$z", "libcurl", TRUE}, + {"$#", "raw", FALSE}, {"0", "http1.0", FALSE}, {"1", "tlsv1", FALSE}, @@ -1903,6 +1904,9 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ case 'z': /* --libcurl */ GetStr(&config->libcurl, nextarg); break; + case '#': /* --raw */ + config->raw ^= TRUE; + break; } break; case '#': /* --progress-bar */ @@ -4253,6 +4257,12 @@ operate(struct Configurable *config, int argc, char *argv[]) my_setopt(curl, CURLOPT_SSL_SESSIONID_CACHE, !config->disable_sessionid); + /* curl 7.16.2 */ + if(config->raw) { + my_setopt(curl, CURLOPT_HTTP_CONTENT_DECODING, FALSE); + my_setopt(curl, CURLOPT_HTTP_TRANSFER_DECODING, FALSE); + } + retry_numretries = config->req_retry; retrystart = curlx_tvnow(); -- cgit v1.2.3