cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1190943 ] Premature exit during processing of chunked respose

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sat, 30 Apr 2005 14:34:04 -0700

Bugs item #1190943, was opened at 2005-04-27 16:04
Message generated for change (Comment added) made by zaa
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1190943&group_id=976

Category: http
Group: wrong behaviour
Status: Open
Resolution: Invalid
Priority: 5
Submitted By: Alexander Zhuravlev (zaa)
Assigned to: Daniel Stenberg (bagder)
Summary: Premature exit during processing of chunked respose

Initial Comment:
[orion:/u/zaa]>uname -rms
FreeBSD 4.11-STABLE i386
[orion:/u/zaa]>curl --version
curl 7.13.1 (i386-portbld-freebsd4.11) libcurl/7.13.1 OpenSSL/0.9.7d
zlib/1.1.4 libidn/0.5.15
Protocols: ftp gopher telnet dict ldap http file https ftps
Features: IDN IPv6 Largefile NTLM SSL libz

Test case:

[orion:/u/zaa]>curl -iIl http://www.ritlabs.com/download/the_bat/
thebat_professional.msi
HTTP/1.1 302 Found
Server: nginx/0.1.19
Date: Wed, 27 Apr 2005 09:49:44 GMT
Content-Type: text/html; charset=iso-8859-1
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: PHPSESSID=0af5f1b6d1d6ab71724163df760bfba5;
path=/
Last-Modified: Wed, 27 Apr 2005 09:49:43 GMT
P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV
PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA"
Set-Cookie: RITLABS_GUEST_ID=6726684; expires=Sat, 22-Apr-
2006 09:49:44 GMT; path=/
Set-Cookie: RITLABS_LAST_VISIT=27.04.2005+04%3A49%3A44;
expires=Sat, 22-Apr-2006 09:49:44 GMT; path=/
Request-URI: http://www.ritlabs.com/download/files3/the_bat/
thebat_professional.msi
Content-Location: http://www.ritlabs.com/download/files3/the_bat/
thebat_professional.msi
Location: http://www.ritlabs.com/download/files3/the_bat/
thebat_professional.msi

curl: (18) transfer closed with outstanding read data remaining

Although wget correctly performs redirect in this case:

[orion:/u/zaa]>env -i /usr/local/bin/wget --version
GNU Wget 1.8.2
[orion:/u/zaa]>env -i /usr/local/bin/wget --spider -S http://www.
ritlabs.com/download/the_bat/thebat_professional.msi
--13:52:04-- http://www.ritlabs.com/download/the_bat/
thebat_professional.msi
           => `thebat_professional.msi'
Resolving www.ritlabs.com... done.
Connecting to www.ritlabs.com[198.63.208.135]:80... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 302 Found
 2 Server: nginx/0.1.19
 3 Date: Wed, 27 Apr 2005 09:52:11 GMT
 4 Content-Type: text/html; charset=iso-8859-1
 5 Connection: close
 6 Set-Cookie: PHPSESSID=f2e0878575e4d7b99b36078a0ac30d5a;
path=/
 7 Last-Modified: Wed, 27 Apr 2005 09:52:10 GMT
 8 P3P: policyref="/bitrix/p3p.xml", CP="NON DSP COR CUR ADM DEV
PSA PSD OUR UNR BUS UNI COM NAV INT DEM STA"
 9 Set-Cookie: RITLABS_GUEST_ID=6726956; expires=Sat, 22-Apr-
2006 09:52:10 GMT; path=/
10 Set-Cookie: RITLABS_LAST_VISIT=27.04.2005+04%3A52%
3A10; expires=Sat, 22-Apr-2006 09:52:10 GMT; path=/
11 Request-URI: http://www.ritlabs.com/download/files3/the_bat/
thebat_professional.msi
12 Content-Location: http://www.ritlabs.com/download/files3/
the_bat/thebat_professional.msi
13 Location: http://www.ritlabs.com/download/files3/the_bat/
thebat_professional.msi
Location: http://www.ritlabs.com/download/files3/the_bat/
thebat_professional.msi [following]
--13:52:06-- http://www.ritlabs.com/download/files3/the_bat/
thebat_professional.msi
           => `thebat_professional.msi'
Connecting to www.ritlabs.com[198.63.208.135]:80... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 200 OK
 2 Server: nginx/0.1.19
 3 Date: Wed, 27 Apr 2005 09:52:12 GMT
 4 Content-Length: 8776704
 5 Content-Type: application/octet-stream
 6 Last-Modified: Wed, 13 Oct 2004 07:28:48 GMT
 7 Connection: keep-alive
 8 Accept-Ranges: bytes
200 OK

----------------------------------------------------------------------

>Comment By: Alexander Zhuravlev (zaa)
Date: 2005-05-01 01:34

Message:
Logged In: YES
user_id=384490

Sorry for the delay with answering.

I've performed some tests and workaround with "--http1.0"
usage solved the problem.

Although I have once concern, actually I was invoking HEAD
requests (curl -iIL URL) and by defininition
Transfer-Encoding does not have impact on HEAD requests
(they are not transfered in chunks) . Thus, I do not really
understand why the error message comes up if the HEADER was
received correctly and we should just perform additional
redirect to an URL mentioned in Location field.

You can close the ticket. Thank you.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2005-04-30 23:30

Message:
Logged In: YES
user_id=1110

No comment?

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2005-04-27 16:10

Message:
Logged In: YES
user_id=1110

This means the server didn't send a good-looking final chunk
in the chunked-encoding stream.

wget doesn't see this problem because it speaks HTTP/1.0 and
as you can see, the server responds quite differently in
that case.

I'm sure you can work around this server bug with curl too
by using --http1.0

If you use --trace or snoop on the traffic with ethereal or
similar, I'm pretty sure you'll see that this is a server error.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1190943&group_id=976
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-tracker
Received on 2005-04-30

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET