]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sockfilt.c: fix calculation of sleep timeout on Windows
authorMarc Hoersken <info@marc-hoersken.de>
Wed, 23 Dec 2015 14:04:02 +0000 (15:04 +0100)
committerMarc Hoersken <info@marc-hoersken.de>
Wed, 23 Dec 2015 14:04:02 +0000 (15:04 +0100)
Not converting to double caused small timeouts to be skipped.

tests/server/sockfilt.c

index cf090cafb611d7b8ae647355e4b523c1121ff57e..3c549997d0eda6d6480417f1f62adc459bddd065 100644 (file)
@@ -696,7 +696,7 @@ static int select_ws(int nfds, fd_set *readfds, fd_set *writefds,
 
   /* check if we got descriptors, sleep in case we got none */
   if(!nfds) {
-    Sleep((timeout->tv_sec * 1000) + (timeout->tv_usec / 1000));
+    Sleep((timeout->tv_sec*1000)+(DWORD)(((double)timeout->tv_usec)/1000.0));
     return 0;
   }