diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-12-07 11:43:45 +0000 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-12-10 12:49:59 +0100 |
commit | dd20c2b6490c0641ab3a1d874b90a1d4d579c699 (patch) | |
tree | ecb331a42af858d651cf35189b2c839171191d6e | |
parent | bb7018a48f095b76abe286cf2093ee613971b2b5 (diff) | |
download | pacrunner-dd20c2b6490c0641ab3a1d874b90a1d4d579c699.tar.gz |
curl: Add timer more precisely if it's less than a second
-rw-r--r-- | plugins/curl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/curl.c b/plugins/curl.c index 0214ed2..e87432b 100644 --- a/plugins/curl.c +++ b/plugins/curl.c @@ -247,8 +247,12 @@ static int timer_callback(CURLM *multi, long timeout_ms, void *user_data) if (timeout_ms < 0) return 0; - timeout_source = g_timeout_add_seconds(interval, - timeout_callback, multi); + if (interval) + timeout_source = g_timeout_add_seconds(interval, + timeout_callback, multi); + else + timeout_source = g_timeout_add(timeout_ms, + timeout_callback, multi); return 0; } |