cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Always get connection timeout

From: Price, Robert <Robert.Price_at_netscout.com>
Date: Mon, 18 Aug 2008 10:52:47 -0700

For the benefit of others:

Turns out my problem was related to the following bug logged against
curl:
http://curl.haxx.se/mail/tracker-2008-06/0016.html
Bug#1999181

I hacked the configure script so that it would not use "clock_gettime"
and use "gettimeofday" instead and that seems to have cleaned things up
for me.

rp

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Price, Robert
Sent: August 15, 2008 3:09 PM
To: libcurl development
Subject: RE: Always get connection timeout

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 moved
Received on 2008-08-18