curl-library
Re: Bypassing libcurl's handling of content-encoding and
Date: Tue, 6 Feb 2007 21:46:32 +0200
Hi,
> Attached is your patch slightly edited to be more the way I'd prefer it.
But
> as you can easily see, the CURLOPT_HTTP_TRANSFER_DECODING option doesn't
work
> properly.
>
> I added a --raw option to the command line tool to test this, and here's a
> tiny teeny chunked-encoded response:
>
> curl --raw daniel.haxx.se/chunky.cgi --trace dump2 -o dump1
>
> ... if you analyze the dump2 and compare it with dump1, you'll see that
they
> don't contain the same info when they in fact should.
While debugging the patch I noticed that I don't get consistent results from
your server. Below please find the output from 2 consecutive runs. One
returned chunked encoding while the other returned plain textual body. Am I
dreaming?
Cheers,
Shmul
------- first run -------
$ ./curl -v daniel.haxx.se/chunky.cgi
* About to connect() to daniel.haxx.se port 80 (#0)
* Trying 193.15.23.131... connected
* Connected to daniel.haxx.se (193.15.23.131) port 80 (#0)
> GET /chunky.cgi HTTP/1.1
> User-Agent: curl/7.16.1-20070206 (i386-pc-win32) libcurl/7.16.1-20070206
> Host: daniel.haxx.se
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 06 Feb 2007 19:40:59 GMT
< Server: Apache
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Content-Type: text/xml
{ [data not shown]
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
0 10 0 10 0 0 13 0 --:--:-- --:--:-- --:--:--
0here 20,0
a
b
c
d
e
* Connection #0 to host daniel.haxx.se left intact
* Closing connection #0
------- second run -------
shmul_at_araq /mnt/c/dev/sandbox/curl-cvs/curl-7.16.1-20070206/src
$ ./curl -v daniel.haxx.se/chunky.cgi
* About to connect() to daniel.haxx.se port 80 (#0)
* Trying 193.15.23.131... connected
* Connected to daniel.haxx.se (193.15.23.131) port 80 (#0)
> GET /chunky.cgi HTTP/1.1
> User-Agent: curl/7.16.1-20070206 (i386-pc-win32) libcurl/7.16.1-20070206
> Host: daniel.haxx.se
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Tue, 06 Feb 2007 19:41:03 GMT
< Server: Apache
< Vary: Accept-Encoding
< Content-Length: 10
< Content-Type: text/xml
{ [data not shown]
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
0 10 0 10 0 0 13 0 --:--:-- --:--:-- --:--:--
0a
b
c
d
e
* Connection #0 to host daniel.haxx.se left intact
* Closing connection #0
Received on 2007-02-06