Blame SOURCES/0069-curl-7.29.0-file-limit-rate.patch

230636
From 4d5f2c162fe8b0a05f05c7f03573381c11ec2958 Mon Sep 17 00:00:00 2001
230636
From: Daniel Stenberg <daniel@haxx.se>
230636
Date: Sun, 22 Dec 2013 23:36:11 +0100
230636
Subject: [PATCH 1/2] FILE: don't wait due to CURLOPT_MAX_RECV_SPEED_LARGE
230636
230636
The FILE:// code doesn't support this option - and it doesn't make sense
230636
to support it as long as it works as it does since then it'd only block
230636
even longer.
230636
230636
But: setting CURLOPT_MAX_RECV_SPEED_LARGE would make the transfer first
230636
get done and then libcurl would wait until the average speed would get
230636
low enough. This happened because the transfer happens completely in the
230636
DO state for FILE:// but then it would still unconditionally continue in
230636
to the PERFORM state where the speed check is made.
230636
230636
Starting now, the code will skip from DO_DONE to DONE immediately if no
230636
socket is set to be recv()ed or send()ed to.
230636
230636
Bug: http://curl.haxx.se/bug/view.cgi?id=1312
230636
Reported-by: Mohammad AlSaleh
230636
230636
Upstream-commit: 2715d7f948c8eb7cd3cba38f3dff6d4148e7cfaf
230636
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
230636
---
230636
 lib/multi.c | 8 +++++++-
230636
 1 file changed, 7 insertions(+), 1 deletion(-)
230636
230636
diff --git a/lib/multi.c b/lib/multi.c
230636
index 39a0938..f27a18f 100644
230636
--- a/lib/multi.c
230636
+++ b/lib/multi.c
230636
@@ -1398,7 +1398,13 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
230636
       moveHandleFromSendToRecvPipeline(data, easy->easy_conn);
230636
       /* Check if we can move pending requests to send pipe */
230636
       checkPendPipeline(easy->easy_conn);
230636
-      multistate(easy, CURLM_STATE_WAITPERFORM);
230636
+      /* Only perform the transfer if there's a good socket to work with.
230636
+         Having both BAD is a signal to skip immediately to DONE */
230636
+      if((easy->easy_conn->sockfd != CURL_SOCKET_BAD) ||
230636
+         (easy->easy_conn->writesockfd != CURL_SOCKET_BAD))
230636
+        multistate(easy, CURLM_STATE_WAITPERFORM);
230636
+      else
230636
+        multistate(easy, CURLM_STATE_DONE);
230636
       result = CURLM_CALL_MULTI_PERFORM;
230636
       break;
230636
 
230636
-- 
230636
2.17.2
230636
230636
230636
From 876a1e81ff44157bbd5e48ca5e120f4266aefc9e Mon Sep 17 00:00:00 2001
230636
From: Daniel Stenberg <daniel@haxx.se>
230636
Date: Sun, 22 Dec 2013 23:45:10 +0100
230636
Subject: [PATCH 2/2] docs: mention CURLOPT_MAX_RECV/SEND_SPEED_LARGE don't
230636
 work for FILE://
230636
230636
Upstream-commit: f718415bc7914f4c238c88d8f76b22ddf4d470c9
230636
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
230636
---
230636
 docs/libcurl/curl_easy_setopt.3 | 10 ++++++++--
230636
 1 file changed, 8 insertions(+), 2 deletions(-)
230636
230636
diff --git a/docs/libcurl/curl_easy_setopt.3 b/docs/libcurl/curl_easy_setopt.3
230636
index 226e0ca..d720b95 100644
230636
--- a/docs/libcurl/curl_easy_setopt.3
230636
+++ b/docs/libcurl/curl_easy_setopt.3
230636
@@ -2053,12 +2053,18 @@ it too slow and abort.
230636
 Pass a curl_off_t as parameter.  If an upload exceeds this speed (counted in
230636
 bytes per second) on cumulative average during the transfer, the transfer will
230636
 pause to keep the average rate less than or equal to the parameter value.
230636
-Defaults to unlimited speed. (Added in 7.15.5)
230636
+Defaults to unlimited speed.
230636
+
230636
+This option doesn't affect transfer speeds done with FILE:// URLs. (Added in
230636
+ 7.15.5)
230636
 .IP CURLOPT_MAX_RECV_SPEED_LARGE
230636
 Pass a curl_off_t as parameter.  If a download exceeds this speed (counted in
230636
 bytes per second) on cumulative average during the transfer, the transfer will
230636
 pause to keep the average rate less than or equal to the parameter
230636
-value. Defaults to unlimited speed. (Added in 7.15.5)
230636
+value. Defaults to unlimited speed.
230636
+
230636
+This option doesn't affect transfer speeds done with FILE:// URLs. (Added in
230636
+7.15.5)
230636
 .IP CURLOPT_MAXCONNECTS
230636
 Pass a long. The set number will be the persistent connection cache size. The
230636
 set amount will be the maximum amount of simultaneously open connections that
230636
-- 
230636
2.17.2
230636