curl timeouts

Bryan Blackburn 0x62_0x6c_0x62 at pobox.com
Sun Sep 28 20:34:51 PDT 2008


On Mon, Sep 29, 2008 at 07:04:18AM +1000, Joshua Root said:
> Would there be any problem with reducing _CURL_MINIMUM_XFER_TIMEOUT and
> _CURL_CONNECTION_TIMEOUT in pextlib1.0/curl.c? Some FTP servers seem to
> sometimes do something that leaves curl waiting for the full 15 minutes
> while receiving no data.
> 

If I'm reading the curl API docs right [1], the combination of xfer_timeout
and xfer_speed (which are CURLOPT_LOW_SPEED_TIME and
CURLOPT_LOW_SPEED_LIMIT, respectively, in libcurl) are what would need
tweaking.  Seems like 1KB/s for 10 minutes would be way too long to wait,
maybe drop the xfer_timeout to 1-2 minutes at most would be better.  The
connection_timeout should be definitely shorter too (for me, I'd like to see
it 10-15 seconds, but others might want to be more patient).

Note that there's a typo in the pextlib1.0/curl.c comment about xfer_speed,
it is actually (according to the libcurl docs) bytes per second, not bits...

The better solution would be either expose these values to macports.conf or
have a high speed/low switch setting that selects sane values for them.

Bryan

[1] - <http://curl.haxx.se/libcurl/c/curl_easy_setopt.html>


> Or better yet, does anyone know how we could work around such servers?
> 
> - Josh


More information about the macports-dev mailing list