curl-library
RE: Always get connection timeout
Date: Fri, 15 Aug 2008 14:09:29 -0700
Right...it is used here:
timeout_ms -= Curl_tvdiff(*nowp, data->progress.t_startsingle);
But, my problem is that Curl_tvdiff() is ALWAYS returning the same value
- which doesn't use the timeout value.
Currently, not using a 64-bit architecture (x386) on a 2.40.20 kernel.
I am debugging using gdb, maybe I'll spend some cycles looking to see if
the values in nowp and data->progress.t_startsingle are actually
changing from execution to execution.
rp
-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Dan Fandrich
Sent: August 15, 2008 2:52 PM
To: curl-library_at_cool.haxx.se
Subject: Re: Always get connection timeout
On Fri, Aug 15, 2008 at 01:20:28PM -0700, Price, Robert wrote:
> The option for defining the timeout is:
> curl_easy_setopt(easyhandle,CURLOPT_CONNECTTIMEOUT,30);
This is wrong; it should be:
curl_easy_setopt(easyhandle,CURLOPT_CONNECTTIMEOUT,30L);
You didn't say what architecture you're using, but if it's x86_64, this
will cause you grief (potentially the kind you're seeing).
> How, though, does that affect the calculation for Curl_timeleft()?
Because that value for CURLOPT_CONNECTTIMEOUT is used in
Curl_timeleft().
> Because it doesn't even look at that. The initial value for
timeout_ms
> = 30000, which is correct. The result I'm getting from
Curl_timeleft()
> is ALWAYS 3532134. So, by subtracting that value from my timeout set,
I
> end up with -3502134 - and it thinks I'm outta time.
>
> I've tried setting options to forbid reuse and force a fresh connect,
> but that doesn't seem to change anything. I'm beginning to wonder if
I
> have some problem with Curl_tvnow() or something???
You could see what values are being returned by using gdb or adding some
debug prints in the code to try to narrow the problem.
>>> Dan
-- http://www.MoveAnnouncer.com The web change of address service Let webmasters know that your web site has movedReceived on 2008-08-15