cURL / Mailing Lists / curl-library / Single Mail


Re: Continuing to use a connection after timeout

From: Mike Crowe <>
Date: Wed, 23 Feb 2011 11:48:22 +0000

On Thu, 17 Feb 2011, Mike Crowe wrote:
>> 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
>> A wireshark capture showed that libcurl was continuing to use the same
>> HTTP connection for the second request

On Fri, Feb 18, 2011 at 11:17:42PM +0100, Daniel Stenberg wrote:
> Doesn't it suffice to just read the VERBOSE output? It normally says if
> it closes connections and when it re-uses existing ones...

It probably did. I reached for Wireshark as the tool I was most
familiar with. Next time I'll try the VERBOSE output. :-)

>> 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!

Thank you for investigating and applying it so quickly.

List admin:
Received on 2011-02-23