cURL / Mailing Lists / curl-library / Single Mail


Re: Continuing to use a connection after timeout

From: Daniel Stenberg <>
Date: Fri, 18 Feb 2011 23:17:42 +0100 (CET)

On Thu, 17 Feb 2011, Mike Crowe wrote:

Thanks for your report and research on this!

> One of our unit tests for code that sits on top of libcurl identified a
> problem when we upgraded from curl-7.20.0 to curl-7.21.3. The test starts an
> HTTP GET with a timeout (via CURLOPT_TIMEOUT_MS) from a URI that provides
> the body only very slowly. After a while the request times out and the test
> tries to continue from where it left off using CURLOPT_RESUME_FROM. This
> second request fails immediately with CURLE_RANGE_ERROR.
> A wireshark capture showed that libcurl was continuing to use the same
> HTTP connection for the second request

Doesn't it suffice to just read the VERBOSE output? It normally says if it
closes connections and when it re-uses existing ones...

> The following patch stops the connection being re-used and fixes the
> problem for me but I'm not convinced that this is the best way to fix
> it.

Since the problem is detected before the switch() we cannot easily use the
"disconnect_conn = TRUE" logic for it, so I think your fix is accurate and
good. I'll commit and push it, thanks!

List admin:
Received on 2011-02-18