gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 19/220: curl: avoid uncessary libcurl timeouts (in


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 19/220: curl: avoid uncessary libcurl timeouts (in parallel mode)
Date: Thu, 12 Sep 2019 17:26:19 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit a2ab576768442f669040837c7f0667e672cf7d48
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon Jul 29 08:50:25 2019 +0200

    curl: avoid uncessary libcurl timeouts (in parallel mode)
    
    When curl_multi_wait() returns OK without file descriptors to wait for,
    it might already have done a long timeout.
    
    Closes #4159
---
 src/tool_operate.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/tool_operate.c b/src/tool_operate.c
index 68cd11c56..18adf1046 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1972,14 +1972,17 @@ static CURLcode parallel_transfers(struct GlobalConfig 
*global,
 
   while(!done && !mcode && still_running) {
     int numfds;
+    struct timeval before = tvnow();
+    long delta;
 
     mcode = curl_multi_wait(multi, NULL, 0, 1000, &numfds);
+    delta = tvdiff(tvnow(), before);
 
     if(!mcode) {
-      if(!numfds) {
+      if(!numfds && (delta < 30)) {
         long sleep_ms;
 
-        /* If it returns without any filedescriptor instantly, we need to
+        /* If it returns without any file descriptor instantly, we need to
            avoid busy-looping during periods where it has nothing particular
            to wait for */
         curl_multi_timeout(multi, &sleep_ms);

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]