curl-library
Re: Bug: curl 7.18.2/7.19.2 looses timeouts
Date: Wed, 19 Nov 2008 16:58:17 +0100 (CET)
On Sat, 15 Nov 2008, koettermarkus_at_gmx.de wrote:
> Extending the hiperfifo code by:
>
> curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_TIME, 3L);
> curl_easy_setopt(conn->easy, CURLOPT_LOW_SPEED_LIMIT, 10L);
I reviewed the code right now and quite clearly these options have never
worked properly for the multi interface. The speed check is only ever done in
the lib/transfer.c:Curl_readwrite() function, and that is only called when one
of the curl_multi_perform() or curl_multi_socket*() functions are called and
the multi handle is in the CURLM_STATE_PERFORM state.
This of course breaks for the cases when the state never enters the
CURLM_STATE_PERFORM state (which seems to be what the
listening-only-on-a-socket test case will show) or if not called enough times
(with no or slow enough traffic) in that state.
How to fix: the Curl_speedcheck() function needs to be called in just all
multi states. It should also set the timeout timer properly so that when these
options are used, the speed is checked at some clever interval even if no
traffic at all is detected.
-- / daniel.haxx.seReceived on 2008-11-19