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: HTTP request timeout and multi interface

From: Andrei Bica via curl-library <>
Date: Fri, 12 Mar 2021 15:45:20 +0200

I've managed to produce this behavior by using a modified multi-poll.c
example (see which makes 10 HTTP requests to
"", set CURLOPT_TIMEOUT_MS to 1000 for each request and
CURLMOPT_MAX_TOTAL_CONNECTIONS to 1 for the multi handle.

I've used iptables to drop all packets going to URL address:
    iptables -A OUTPUT -p tcp --destination-port 8200 -j DROP

I would expect the runtime to be around 1000 ms (the value of
CURLOPT_TIMEOUT_MS), but instead I get a runtime of about 7000 ms.

On Mon, Mar 8, 2021 at 11:47 PM Daniel Stenberg <> wrote:

> On Mon, 8 Mar 2021, Andrei Bica via curl-library wrote:
> > By using CURLOPT_TIMEOUT we can only set the transfer timeout, which
> doesn't
> > include the time it waits for the transfer to begin.
> I believe this is wrong.
> CURLOPT_TIMEOUT sets the maximum time allowed for the entire operation to
> use,
> no matter what state the transfer is in and how long it waits in what
> queues.
> Technically, it means that the timeout value is counted from the
> time-stamp which is set in the INIT state, before the transfer gets queued
> up
> in the PENDING state waiting for a connection.
> --
> /
> | Commercial curl support up to 24x7 is available!
> | Private help, bug fixes, support, ports, new features
> |

Received on 2021-03-12