cURL / Mailing Lists / curl-library / Single Mail


Re: libcurl stuck with half-open connection

From: Daniel Stenberg <>
Date: Fri, 17 Apr 2009 22:08:08 +0200 (CEST)

On Fri, 17 Apr 2009, Joe Eggleston wrote:

> Read event on that socket, but wasn't waiting for a timeout event for that
> connection. I believe this means that that connection will sit forever. I
> was expecting curl to handle this situation because I had set the
> CURLOPT_TIMEOUT for the connection to 120 seconds. But, without a timeout
> event, curl will never wake up to timeout the connection.

Without a timeout, it is expected to never notice.

However, using the multi_socket() API and the multi interface in general I
believe, there's a bug in the CURLOPT_TIMEOUT handling that makes it
malfunction at times.

But I always stress that you can make that timeout handling yourself with the
multi interface. Just remove the easy handle at whatever time you think it's
done waiting.

Received on 2009-04-17