summaryrefslogtreecommitdiff
path: root/lib/multiif.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-12-02 15:33:32 +0100
committerDaniel Stenberg <daniel@haxx.se>2013-12-15 22:53:41 +0100
commitbe28223f350ebd5a07de86d28b98a129952ccc60 (patch)
treeeda18b3610fea61db51de91322105c8e59891b5b /lib/multiif.h
parent8e2d73bbde36066c67fe47f600355be788a5e1a8 (diff)
downloadcurl-be28223f350ebd5a07de86d28b98a129952ccc60.tar.gz
multi: add timer inaccuracy margin to timeout/connecttimeout
Since all systems have inaccuracy in the timeout handling it is imperative that we add an inaccuracy margin to the general timeout and connecttimeout handling with the multi interface. This way, when the timeout fires we should be fairly sure that it has passed the timeout value and will be suitably detected. For cases where the timeout fire before the actual timeout, we would otherwise consume the timeout action and still not run the timeout code since the condition wasn't met. Reported-by: He Qin Bug: http://curl.haxx.se/bug/view.cgi?id=1298
Diffstat (limited to 'lib/multiif.h')
-rw-r--r--lib/multiif.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/multiif.h b/lib/multiif.h
index e61c5c6f2..15163da98 100644
--- a/lib/multiif.h
+++ b/lib/multiif.h
@@ -30,6 +30,8 @@
#define MULTI_TIMEOUT_INACCURACY 3000
#endif
+#define MULTI_TIMEOUT_INACCURACY_MS (MULTI_TIMEOUT_INACCURACY / 1000)
+
/*
* Prototypes for library-wide functions provided by multi.c
*/