curl-library
Re: PATCH coming soon: CURLOPT_FTP_RESPONSE_TIMEOUT
Date: Thu, 28 Aug 2003 09:17:41 -0500
"Daniel Stenberg" <daniel_at_haxx.se> wrote:
> On Wed, 27 Aug 2003, Early Ehlinger wrote:
>
> > However, this problem does expose a shortcoming in libcURL. I can
detect
> > this hang by using CURLOPT_TIMEOUT, but that appears to limit the entire
> > transfer's time. Since my customers often be upload *very* large files
> > (100+ megabyte animated texture maps are not uncommon), I cannot use
this
> > option to govern the transfer time. I had hoped that
> > CURLOPT_LOW_SPEED_LIMIT and CURLOPT_LOW_SPEED_TIME would detect this
> > problem, but this appears to not have any effect on Curl_GetFTPResponse.
>
> Right. CURLOPT_TIMEOUT is for the full opertion, and
CURLOPT_LOW_SPEED_LIMIT
> and CURLOPT_LOW_SPEED_TIME are for the actual transfer of data.
Makes sense.
> IMGO, what you should use (and probably make working properly) is the
> CURLOPT_CONNECTTIMEOUT option, which is a timeout option for the full
connect
> operation, including the login-stuff for ftp.
I'm not sure this is appropriate; at the point where the timeout is
happening, we're already connected and in fact have already accomplished
some transfers, and are attempting to re-use the existing connection for
another transfer. From the doc, "This only limits the connection phase,
once it has connected, this option is of no more use."
The problem in this case is not that the connect is taking to long, it's
that the connection goes stale "mid-session," while we're traversing the
directory tree in-between downloads/uploads.
Also, I don't want to set an aggressive timeout on the connect; all the
TCP/IP stuff can easily make the session painfully slow to set up, even
though there's actual progress being made the whole time. I.e., a 60-second
or even 90-second timeout for connect is not unreasonable, even though a 10
second timeout for server response is probably conservative! I only want to
govern how long things like CWD, MDTM, MKD, etc., are allowed to take before
we assume that the connection is dead and allow the application code to
re-init the curl connection.
-- -- Early Ehlinger CEO, ResPower Inc - Toll-Free : 866-737-7697 -- www.respower.com -- 500+ GHz Supercomputer Starting At USD$0.50/GHz*Hour ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sfReceived on 2003-08-28