Blame SOURCES/0020-curl-7.29.0-d529f388.patch

9d7d3f
From 4274decb62daca78c9d43a025fc08f8d6fd3a341 Mon Sep 17 00:00:00 2001
9d7d3f
From: Daniel Stenberg <daniel@haxx.se>
9d7d3f
Date: Sun, 14 Jul 2013 17:33:24 +0200
9d7d3f
Subject: [PATCH] curl_easy_perform: gradually increase the delay time
9d7d3f
9d7d3f
Instead of going 50,100,150 etc millisecond delay time when nothing has
9d7d3f
been found to do or wait for, we now start lower and double each loop as
9d7d3f
in 4,8,16,32 etc.
9d7d3f
9d7d3f
This lowers the minimum wait without sacrifizing the longer wait too
9d7d3f
much with unnecessary CPU cycles burnt.
9d7d3f
9d7d3f
Bug: http://curl.haxx.se/mail/lib-2013-07/0103.html
9d7d3f
Reported-by: Andreas Malzahn
9d7d3f
9d7d3f
[upstream commit d529f3882b9bca2c3eb32295dd6b2609d0c9b51f]
9d7d3f
9d7d3f
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
9d7d3f
---
9d7d3f
 lib/easy.c | 4 +---
9d7d3f
 1 file changed, 1 insertion(+), 3 deletions(-)
9d7d3f
9d7d3f
diff --git a/lib/easy.c b/lib/easy.c
9d7d3f
index a7051dd..13801b2 100644
9d7d3f
--- a/lib/easy.c
9d7d3f
+++ b/lib/easy.c
9d7d3f
@@ -465,9 +465,7 @@ CURLcode curl_easy_perform(CURL *easy)
9d7d3f
         if(curlx_tvdiff(after, before) <= 10) {
9d7d3f
           without_fds++;
9d7d3f
           if(without_fds > 2) {
9d7d3f
-            int sleep_ms = without_fds * 50;
9d7d3f
-            if(sleep_ms > 1000)
9d7d3f
-              sleep_ms = 1000;
9d7d3f
+            int sleep_ms = without_fds < 10 ? (1 << (without_fds-1)): 1000;
9d7d3f
             Curl_wait_ms(sleep_ms);
9d7d3f
           }
9d7d3f
         }
9d7d3f
-- 
9d7d3f
1.9.3
9d7d3f