cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl_easy_perform() failed: Transferred a partial file

From: Sanchay Harneja <sanchay.h_at_gmail.com>
Date: Fri, 9 Oct 2015 23:47:56 -0700

I'm following libcurl's getinmemory
<http://curl.haxx.se/libcurl/c/getinmemory.html> example. I started a
simple http server which serves a 40MB data blob. With code similar to the
example I get the following output. I'm printing the realsize variable in
write callback.

* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)
> GET /abcd/1/ HTTP/1.1
Host: 127.0.0.1:8000
User-Agent: libcurl-agent/1.0
Accept: */*

< HTTP/1.1 200 OK
< Connection: close
< Content-Length: 41973760
< Content-Type: application/octet-stream
<
realsize=16280
realsize=16280
realsize=16384
realsize=16384
realsize=16384
realsize=16384
realsize=16384
realsize=16384
realsize=16384
realsize=16384
realsize=16384
realsize=16384
realsize=16384
realsize=16384
realsize=16384
realsize=16384
* transfer closed with 41842792 bytes remaining to read
* Closing connection 0
curl_easy_perform() failed: Transferred a partial file

But the inbuilt curl binary handles this fine:
$ curl 127.0.0.1:8000/abcd/1/ | wc

  % Total % Received % Xferd Average Speed Time Time Time
Current

                                 Dload Upload Total Spent Left
Speed

100 40.0M 100 40.0M 0 0 22.4M 0 0:00:01 0:00:01 --:--:--
22.4M
   10240 20480 41973760

any ideas as to what might be going on? I've verified that the
content-length is as expected. Note on the server side I'm additionally
setting "Connection: closed" header.

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