From: Pekka Riikonen Date: Tue, 23 Nov 2004 15:51:07 +0000 (+0000) Subject: Timer loop fixes. A patch from Juha Räsänen. X-Git-Tag: silc.server.0.9.19~58 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=230a5312b48eb77f4affd32920aadf6d1cabdb4a;p=silc.git Timer loop fixes. A patch from Juha Räsänen. --- diff --git a/lib/silcutil/win32/silcwin32schedule.c b/lib/silcutil/win32/silcwin32schedule.c index 22445aef..c3dedee3 100644 --- a/lib/silcutil/win32/silcwin32schedule.c +++ b/lib/silcutil/win32/silcwin32schedule.c @@ -53,7 +53,8 @@ int silc_select(SilcScheduleFd fds, SilcUInt32 fds_count, struct timeval *timeout) { HANDLE handles[MAXIMUM_WAIT_OBJECTS]; - DWORD ready, curtime, timeo; + DWORD ready, curtime; + LONG timeo; int nhandles = 0, i; MSG msg; @@ -99,6 +100,7 @@ int silc_select(SilcScheduleFd fds, SilcUInt32 fds_count, struct timeval *timeou KillTimer(NULL, timer); if (timeo != INFINITE) { timeo -= GetTickCount() - curtime; + curtime = GetTickCount(); if (timeo < 0) timeo = 0; } @@ -137,6 +139,7 @@ int silc_select(SilcScheduleFd fds, SilcUInt32 fds_count, struct timeval *timeou return and we will give the wait another try. */ if (timeo != INFINITE) { timeo -= GetTickCount() - curtime; + curtime = GetTickCount(); if (timeo < 0) timeo = 0; }