cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH 4/4] src/tool: allow timeouts to accept decimal values

From: Dave Reisner <d_at_falconindy.com>
Date: Mon, 6 May 2013 15:15:19 -0400

On Mon, May 06, 2013 at 08:47:16PM +0200, Dan Fandrich wrote:
> On Mon, May 06, 2013 at 02:19:51PM -0400, Dave Reisner wrote:
> > Implement wrappers around strtod to convert the user argument to a
> > double with sane error checking. Use this to allow --max-time and
> > --connect-timeout to accept decimal values instead of strictly integers.
>
> curl attempts to avoid use of floating point operations internally,
> with the notable exception of the progress callback. Floating point is
> inefficient and causes bloated code on some of the platforms on which libcurl
> runs, especially some of the embedded ones where size is an issue, so it's
> something to keep in mind. But given that this patch only touches the front
> end and is minimally invasive, I think it's a good idea.

Yeah, and how I wish the progress callback never used floating point =)

I now notice that this patch is actually bunk -- it doesn't switch
CURLOPT_CONNECTTIMEOUT to CURLOPT_CONNECTTIMEOUT_MS as I did with
CURLOPT_TIMEOUT. If this is still wanted despite the floating point
concerns, I'll happily send a new version.

> >>> Dan
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-05-06