curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Query on CURLOPT_TIMEOUT usage with persistent connection

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 23 Feb 2018 08:16:39 +0100 (CET)

On Thu, 22 Feb 2018, Ranjan Khanna wrote:

> I am using libcurl "C" library to open a Persistent HTTP connection to
> Server with timeout set to 5 sec(using CURLOPT_TIMEOUT) and using
> curl_easy_perform for making requests. Below is the scenario:
>
> 1. Client sends request to */test1.html*
> 2. The server doesn't respond within 5 sec and *curl_easy_perform* returns
> error code 28.
> 3. The client doesn't close the connection and reuses the same connection
> to send another request to /test2.html.

libcurl will not re-use such connections it aborts due to timeout (unless
HTTP/2 is used). If it does, that's a bug.

--
  / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2018-02-23