curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: Read idle time out

From: Stefan Eissing via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 17 Mar 2023 12:56:11 +0100

> Am 17.03.2023 um 11:25 schrieb Nithin Das via curl-library <curl-library_at_lists.haxx.se>:
>
> Hi,
>
> I am running into an issue where a curl client is timing out while transferring a file to the server that uses lighttpd as the web server. It looks like the timeout is because of the setting on the lighttpd (server.max-read-idle = 60) . The client is doing some background processing during which the server times out. One option is to increase the server timeout value to a bigger number. I was wondering whether they are any settings or options on the curl client side to prevent the server from being timed out.
>
> ## Time to read from a socket before we consider it idle.
> ##
> ## Default: 60
> ##
> server.max-read-idle = 60

Servers do this to protect themselves against a Denial-of-Service attack. So, in general, it is not wise to increase this timeout.

If you do a http: transfer that needs intensive processing on the client side (or accessing systems like a database where it is not certain how fast that responds), you should consider buffering the response. Or do the processing in a separate thread. Or start the processing only after the full response has been received. All depends on your application.

Both is more complexity on the client side, but I see no way around this. Curl cannot tell the server "I am a good client, please keep on waiting".

Even if you use HTTP/2 and PING frames to keep the connection alive, servers will apply timeouts to your requests, e.g. the HTTP/2 streams you have opened.

Kind Regards,
Stefan

> --
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
> Etiquette: https://curl.se/mail/etiquette.html


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-03-17