cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: AllowServerConnect timeout quesion

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 2 Feb 2004 12:52:10 +0100 (CET)

On Fri, 30 Jan 2004, gilad wrote:

> Hi, I thought of using the existing parameter of CONNECTTIMEOUT as in
> data->set.connecttimeout, instead of the 10 seconds by default.. Is it ok ?
> I will have no problem to check it :)
>
> instead of
> dt.tv_sec = 10;
> then
> dt.tv_sec = data->set.connecttimeout;

That's not a bad idea. But remember that the data->set.connecttimeout is 0 if
not set. It would probably be better to:

  dt.tv_sec = 60; /* probably a more sensible and more defensive default */

  if(data->set.connecttimeout)
    dt.tv_sec = data->set.connecttimeout;

... or similar. Don't you agree?

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Received on 2004-02-02