Why is this warning being shown: "Received problem 2 in the chunky parser"?
Asked Answered
J

2

6

I am trying to use PHP and cURL to log in to a website (namely Craigslist). When accessing the script, I get this warning message:

Received problem 2 in the chunky parser

Searches showed that it is not a problem associated with cURL. I am unable to find the source of the problem. What may be the reason?

Thank you.

Jobholder answered 6/3, 2010 at 9:42 Comment(2)
Can't help myself: Put the parser on a diet.Concave
@Concave that was what I was thinking first, too. There's a number of parsers and one of them is a bit on the heavy side. The error message uses that fact to identify it - much nicer than "Parser 28"Boulevardier
B
5

Update: Googling for the error message, I also find this:

The chunky-parser error message occurs when curl expects a chunked HTTP response body and then doesn't get one. Your reply sends the Transfer-Encoding: chunked header, so curl expects to see a body chunked according to RFC2616 and it doesn't get one.

Obviously, a redirect shouldn't have a response body or even the Transfer-Encoding header to begin with. You could try overriding the header, but maybe CouchDB inserts it unconditional in which case we should fix that, if you find out you can't override the Transfer-Encoding header, can you file a bug report?

I have no idea what to make out of this in the context of fetching an arbitrary page, though.

Original post:

There's a CouchDB Bug report dealing with the same issue in conjunction with multi-byte data. Craigslist seems to run in ISO-8859-1, maybe the ad (or whatever you are fetching) has UTF-8 characters in it?

Boulevardier answered 6/3, 2010 at 9:45 Comment(2)
I set Content-type: text/html; charset=utf-8 and it is working fine. Thank you for the suggestion.Jobholder
you can also do easy.version = Curl::HTTP_1_0Foursome
O
1

"Received problem 2 in the chunky parser" is an error message from libcurl. The specific "problem 2" refers to CHUNKE_ILLEGAL_HEX which is an internal error code identifying an illegal chunked-encoded stream.

Pretty much what Pekka's answer already said...

Oskar answered 6/3, 2010 at 18:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.