cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl Error 18 Timeout

From: Matt Horrocks <matt.polyvisual_at_gmail.com>
Date: Sat, 4 Dec 2010 11:10:22 +0000

On Sat, Dec 4, 2010 at 10:59 AM, Matt Horrocks <matt.polyvisual_at_gmail.com>wrote:

> On Sat, Dec 4, 2010 at 10:04 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
>> On Sat, 4 Dec 2010, Matt Horrocks wrote:
>>
>> I'm using curl 7.19.7 (i486-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k
>>> zlib/1.2.3.3 libidn/1.15
>>>
>>> Approximately 1 in 50 transfers will result in an error 18:
>>> CURLE_PARTIAL_FILE failure. (This is OK, as I can log the failure and url
>>> and try it again later).
>>>
>>> The problem is with a timeout... when this error 18 occurs, the CURL
>>> transfer hangs for 3 minutes before failing.
>>>
>>> Is there a way to shorten this timeout?
>>>
>>
>> What timeout is this? What protocol are you using here?
>>
>>
>> / daniel.haxx.se
>> -------------------------------------------------------------------
>> List admin: http://cool.haxx.se/list/listinfo/curl-library
>> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
>
>
> It's http, through the PHP Curl library.
>
> I don't know what timeout it is... I assume it's adding one, as every curl
> request which fails with an error 18 hangs for 3 minutes. The only timeout
> I've set is the connecttimeout below.
>
> curl_setopt($i1, CURLOPT_PROXYUSERPWD, $proxylogin);
> curl_setopt($i1, CURLOPT_URL, $url);
> curl_setopt($i1, CURLOPT_HEADER, 1);
> curl_setopt($i1, CURLOPT_RETURNTRANSFER, 1);
> curl_setopt($i1, CURLOPT_PROXY, $proxy);
> curl_setopt($i1, CURLOPT_CONNECTTIMEOUT, 5);
> curl_setopt($i1, CURLOPT_REFERER, $referrer);
> curl_setopt($i1, CURLOPT_USERAGENT, $agent);
>
> Thanks,
> Matt
>
>
>
Hi,

Here's a dump of a failed transfer showing the error message and
the total_time of 3 minutes:

Array
(
    [INF] => Array
        (
            [url] =>
http://www.google.co.uk/search?q=wedding+florists+poole&start=10
            [content_type] => text/html; charset=UTF-8
            [http_code] => 200
            [header_size] => 630
            [request_size] => 311
            [filetime] => -1
            [ssl_verify_result] => 0
            [redirect_count] => 0
            [total_time] => 180.486281
            [namelookup_time] => 1.9E-5
            [connect_time] => 0.112318
            [pretransfer_time] => 0.112344
            [size_upload] => 0
            [size_download] => 15096
            [speed_download] => 83
            [speed_upload] => 0
            [download_content_length] => -1
            [upload_content_length] => 0
            [starttransfer_time] => 0.263132
            [redirect_time] => 0
            [certinfo] => Array
                (
                )

        )

    [ERR] => transfer closed with outstanding read data remaining
)

Thanks,
Matt

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-12-04