English 中文(简体)
Why is this warning being shown: "Received problem 2 in the chunky parser"?
原标题:

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.

最佳回答

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?

问题回答

"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...





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签