On Fri, 5 Aug 2016, Sean Miller wrote:

Please don't top-post.

For a large request (>64 KiB) with a timeout of 5 sec, I see libcurl requesting up to 4 buffers worth of data from my READFUNC, with one call to TIMERFUNC with timeout_ms=198. After the 4th chunk, libcurl calls TIMERFUNC with timeout_ms=4800, which consumes all the remaining time until the timeout. I don't understand why libcurl wants to wait so long when I haven't told it that I'm done providing data.

libcurl will wait for the socket to become writable until it asks for data from you, so that it knows it can send at least parts of the data you give it. libcurl avoids to buffer data by itself. So, until the socket signals "writable", your read callback won't get called. And then it won't ask for more data from you again until it has managed to send the data you gave it in the previous callback call.

I suppose that indicates a slow/bad network or slow server.

--

 / daniel.haxx.se
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html

Reply via email to