Re: [reSIProcate] An other Ares problem
Great catch - not sure why no one else has noticed this - it appears this code has been like this since 2010 - but I can see exactly what you are describing by just looking at the code.
I'm thinking the time should be initialized to be as high as possible. Can you try out the following code and see if it works good for you?
unsigned int
AresDns::getTimeTillNextProcessMS()
{
struct timeval tv;
unsigned maxSystemTime = resip::Timer::getMaxSystemTimeWaitMs();
tv.tv_sec = maxSystemTime / 1000;
tv.tv_usec = 1000 * (maxSystemTime % 1000);
ares_timeout(mChannel, NULL, &tv);
return tv.tv_sec*1000 + tv.tv_usec / 1000;
}
Thanks!
Scott