diff options
Diffstat (limited to 'src/daemon/daemontest_post_loop.c')
-rw-r--r-- | src/daemon/daemontest_post_loop.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/daemon/daemontest_post_loop.c b/src/daemon/daemontest_post_loop.c index 8fbc1f70..588a02d3 100644 --- a/src/daemon/daemontest_post_loop.c +++ b/src/daemon/daemontest_post_loop.c | |||
@@ -298,7 +298,7 @@ testExternalPost () | |||
298 | FD_ZERO (&rs); | 298 | FD_ZERO (&rs); |
299 | FD_ZERO (&ws); | 299 | FD_ZERO (&ws); |
300 | FD_ZERO (&es); | 300 | FD_ZERO (&es); |
301 | curl_multi_perform (multi, &running); | 301 | while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform (multi, &running)); |
302 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); | 302 | mret = curl_multi_fdset (multi, &rs, &ws, &es, &max); |
303 | if (mret != CURLM_OK) | 303 | if (mret != CURLM_OK) |
304 | { | 304 | { |
@@ -322,19 +322,10 @@ testExternalPost () | |||
322 | (ctimeout < timeout) && | 322 | (ctimeout < timeout) && |
323 | (ctimeout >= 0) ) | 323 | (ctimeout >= 0) ) |
324 | timeout = ctimeout; | 324 | timeout = ctimeout; |
325 | if (timeout > 0) | ||
326 | timeout = 0; /* this line is needed since CURL seems to have | ||
327 | a bug -- it returns a timeout of -1 even though | ||
328 | it should be attempting to connect -- and the | ||
329 | socket for doing the connection is not yet | ||
330 | in the write-set! If the timeout is too high, | ||
331 | no progress would happen! Even a timeout of | ||
332 | 1 would cause my system to be mostly idle instead | ||
333 | of processing at maximum speed... */ | ||
334 | tv.tv_sec = timeout / 1000; | 325 | tv.tv_sec = timeout / 1000; |
335 | tv.tv_usec = (timeout % 1000) * 1000; | 326 | tv.tv_usec = (timeout % 1000) * 1000; |
336 | select (max + 1, &rs, &ws, &es, &tv); | 327 | select (max + 1, &rs, &ws, &es, &tv); |
337 | curl_multi_perform (multi, &running); | 328 | while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform (multi, &running)); |
338 | if (running == 0) | 329 | if (running == 0) |
339 | { | 330 | { |
340 | msg = curl_multi_info_read (multi, &running); | 331 | msg = curl_multi_info_read (multi, &running); |