[darcs-users] [patch336] Add environment variable DARCS_CONNECTION_TIMEOUT

Eric Kow kowey at darcs.net
Wed Aug 11 11:10:08 UTC 2010


Some more thoughts: maybe the 30 second value should be #defined in
hscurl.h as DEFAULT_CONNECTION_TIMEOUT.  This would be clearer and
also allow you to avoid duplication in the documentation later

Add environment variable DARCS_CONNECTION_TIMEOUT
-------------------------------------------------
> +int set_time_out(CURL *handle)
> +{
> +  int error;
> +  long time_out = 30;
> +  const char *stime_out;
> +
> +  stime_out = getenv("DARCS_CONNECTION_TIMEOUT");
> +  if (stime_out != NULL){
> +    long result = atol (stime_out);
> +    if ( result > 0 )
> +      time_out = result;
> +  }

Does this mean that parse errors are treated as 0? (which your code
would then just silently treat as the default 30s)?  Maybe set_time_out
should return an error instead so that you can notify the user that
something went wrong.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, please try +44 (0)1273 64 2905.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20100811/7a2da78d/attachment-0001.pgp>


More information about the darcs-users mailing list