cURL / Mailing Lists / curl-library / Single Mail


Re:Re: Failed writing body (-1 != 16384)

From: 兰天 <>
Date: Wed, 11 Mar 2015 11:41:52 +0800 (CST)

Thanks for answering,I use libcurl 7.36,
in the callback function ,
size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata);

all the type I use is unsigned int,does that lead to the Failed writing body (-1 != 16384) ?

在 2015-03-11 04:21:28,"Ray Satiro via curl-library" <> 写道:
On 3/10/2015 8:46 AM, 兰天 wrote:

I use multi socket ,and I run the program for few minutes ,however I get this error

* Connection #20 to host left intact
* Re-using existing connection! (#33) with host
* Connected to ( port 80 (#33)
> GET /psb?/V10nnL8j44xU4O/g8L30HY2LaPzSHGtD7VMr3oRXboYP7LnupSHjTnxJPI!/b/dK32W.GBOwAA&bo=XgH9AF4B*QACCCw! HTTP/1.1
Host: xxxxxxxxxxxxxx(for example)
Accept: */*

< HTTP/1.1 200 OK
< Cache-Control: max-age=31536000
< Client-Ip:
< Content-Length: 5328377
< Content-Type: image/gif
< Last-Modified: Mon, 18 Dec 2006 07:25:14 GMT
< Server: httpserver
< Server-Time: 77
< Size: 5328377
* Failed writing body (-1 != 16384)
* Closing connection #33

I search int google,And it tells about "So it was a problem of encoding."
Have anyone got this error before? how to fix it?

In the future please cite what you have found by searching. It looks as though you are using a version of libcurl that is at least 5 years old. As of 7.20 (Feb 2010) when there is a failure writing the body it no longer casts the bytes handled number to a signed integer it uses the unsigned value instead. A lot has happened in 5 years (over 19,000 commits) and it's possible if there was a bug it has been fixed. Also take a close look at your body callback function to see if it's actually handling the bytes. Review CURLOPT_WRITEFUNCTION [1].

If you need more help you can increase the chances of someone on the list helping you by supplying a self contained example that can be used to reproduce and the details at [2].


List admin:
Received on 2015-03-11