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

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