cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: 兰天 <lantian0811_at_163.com>
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" <curl-library_at_cool.haxx.se> 写道:
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 b200.photo.store.qq.com left intact
* Re-using existing connection! (#33) with host b378.photo.store.qq.com
* Connected to b378.photo.store.qq.com (101.227.143.124) 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: 14.17.37.11
< 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].

[1]: http://curl.haxx.se/libcurl/c/CURLOPT_WRITEFUNCTION.html
[2]: http://curl.haxx.se/docs/bugs.html#What_to_report

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-11