Subject: Re: [PATCH] introducing millisecond timeout resolution

Re: [PATCH] introducing millisecond timeout resolution

From: Yang Tse <yangsita_at_gmail.com>
Date: Mon, 12 May 2008 16:30:58 +0200

2007/12/27, Daniel Stenberg wrote:

> Attached here is a first patch that introduces millisecond timeout
> resolution in c-ares. I'm interested in feedback.

The whole idea is excellent.

Some minor thoughts...

To avoid problems on systems which have unsigned struct timeval
members, in ares__timedout() it would be possible to simply do
comparisons instead of substractions to get the function result. And
it could even be a macro to get rid of the function calling overhead.

Due to the now existing ares__tvnow() calls to gettimeofday() should
be replaced by the former.

ares__timeoffset() return type should be long instead of int. But
actually now that ares_tvdiff() exists probably one function or the
other should be nuked, they differentiate in which argument is
subtracted from the other. Not sure if its more confusing to have both
functions or just one ;-)

Maybe some int data type should be converted to long to avoid some
warnings, autobuilds will show the real need.

-- 
-=[Yang]=-
Received on 2008-05-12