cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: timeout in milliseconds doesn't seem to work

From: Paul Dix <paul_at_pauldix.net>
Date: Mon, 4 May 2009 10:08:55 -0400

This is for a Ruby library I'm writing, hence the reason for passing
the long value instead of using the constant. The library is here:
http://github.com/pauldix/typhoeus

The relevant c code is here:
http://github.com/pauldix/typhoeus/blob/cc977ca8249825a371b76b1d6eb1e932a7cbe1b3/ext/typhoeus/typhoeus_easy.c

And the Ruby code that interfaces with that is here:
http://github.com/pauldix/typhoeus/blob/cc977ca8249825a371b76b1d6eb1e932a7cbe1b3/lib/typhoeus/easy.rb

And the example where I call the ruby code is here (lines 17-23):
http://github.com/pauldix/typhoeus/blob/cc977ca8249825a371b76b1d6eb1e932a7cbe1b3/spec/typhoeus/easy_spec.rb

I'm not sure if that helps at all for narrowing it down. I'd
appreciate any ideas.

Thanks,
Paul

On Mon, May 4, 2009 at 4:28 AM, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Fri, 1 May 2009, Paul Dix wrote:
>
>> curl_easy_setopt(easy_handle, 155, 500); // for say 500 ms timeout.
>> where 155 is the CURLOPT_TIMEOUT_MS value
>
> Why on earth would you use 155 and not CURLOPT_TIMEOUT_MS ?
>
>> What I'm finding is that it automatically rounds up to the nearest second.
>> So it's really only doing full second timeouts. So a ms value of 1001 would
>> actually do timeouts at 2 seconds. I saw that I need to have it built with
>> c-ares and based on the version returned by curl_version, I think I do.
>
> If that's really the case it seems like a bug somewhere. Can you post us a
> full example that we can try with?
>
> --
>
>  / daniel.haxx.se
>
Received on 2009-05-04