cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Error about chunky parser

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 21 Jan 2003 21:57:14 +0100 (CET)

On Tue, 21 Jan 2003, Brad Settlemyer wrote:

(I moved this discussion from curl-users to curl-library since we're now
talking about some possible modifications of the library.)

> > This indicates that the stream was malformated, not just ending
> > prematurely.

As your dump showed in the other mail, the server is *NOT* at all sending the
data using chunked encoding. It's a bloody liar! ;-)

> Great, given that the server I am talking to does not send the terminating
> character, how do I use curl with this server. I am actually interested in
> using lib curl rather than the command line tool, so any solution there
> would help as well.

Right. I acknowledge your problem here.

I'm not quite sure what the best solution would be.

I mean, we could possibly come up with a way where you can filter out a given
header before libcurl parses it. That would solve this particular case, but I
doubt that you want to do that as a generic solution as that would
effectively prevent all the normal and functioning chunked downloads to
work...

Another approach would be that libcurl, in a case where it finds a problem
with the chunked data somehow allows you to take care of it anyway, even
though it was not using correct syntax.

A third possibility, is that if the very first byte of the chunked-transfer
is found to be illegal (as in this case), we switch it off and get it all
(and the rest of this transfer) without using chunked transfer...

> I tried changing the code to ignore the illegal hex error, and I received a
> response size error (off by 14 bytes), which I already ignore in some of my
> code.

That server sure isn't playing very nice.

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
Received on 2003-01-21