cURL / Mailing Lists / curl-library / Single Mail

curl-library

Problem posting large data using libcurl

From: Heena Sirwani <heenasirwani_at_gmail.com>
Date: Thu, 15 Jan 2015 10:55:12 +0530

Hello all,

I am using libcurl in C with the mutli socket interface along with libuv. I
add easy handles to the multi handle for each request and start the libuv
event loop together with adding sockets for polling for appropriate
activity to libuv poll interfaces.

The problem is when I post data > 5k to the server. I don't seem to get
any response. When I check this at the server side, the server seems to be
sending a 408 response meaning it did not receive the request body within
the interval it was prepared to wait. I tried increasing the request time
out value to 100 seconds (I guess that should suffice). But the problem
persists. I also don't get any response at the client side ( I assume that
the client keeps sending data event when the server has closed the
connection and the server sends the reset flag to clear the input buffers
at the client side that contains the unacknowledged responses and they are
cleared even before the client reads them). I have also reset the Expect:
100 continue header.

Also when I do a post with the same amount of data using only easy
handles(blocking), I get the response within 3 seconds. The size of the
data after which I do not get any response also varies from machine to
machine ( on another machine I do not get a response for data > 3k). I am
assuming that libcurl with libuv is slowing down the process of writing
data to send to the server. Also the event loop runs in a separate thread
from where I actually add handles to the multi interface.

I would be grateful, if you could suggest something.

Thanks.

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