git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] negative values are ignored for http.maxreceivespeed

From
XXXia XiaoWen <haoyurenzhuxia@gmail.com>
Date
Aug 19, 2021, 13:18 UTC
Message-ID
<20210819131808.40759-2-chenan.xxw@alibaba-inc.com>
In-Reply-To
<20210819131808.40759-1-chenan.xxw@alibaba-inc.com>
---
 http.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/http.c b/http.c
index 12030cf3bc..2e01ebf559 100644
--- a/http.c
+++ b/http.c
@@ -84,7 +84,7 @@ static const char *ssl_cainfo;
 static long curl_low_speed_limit = -1;
 static long curl_low_speed_time = -1;
 #if LIBCURL_VERSION_NUM >= 0x070f05
-static ssize_t curl_max_receive_speed = -1;
+static ssize_t curl_max_receive_speed = 0;
 #endif
 static int curl_ftp_no_epsv;
 static const char *curl_http_proxy;
@@ -983,7 +983,9 @@ static CURL *get_curl_handle(void)
 	}
 
 #if LIBCURL_VERSION_NUM >= 0x070f05
-	if (curl_max_receive_speed > 0)
+	if (curl_max_receive_speed < 0)
+		warning("negative values are ignored for http.maxreceivespeed");
+	else if (curl_max_receive_speed > 0)
 		curl_easy_setopt(result, CURLOPT_MAX_RECV_SPEED_LARGE,
 				 curl_max_receive_speed);
 #endif
-- 
2.28.1.49.gafcb914ae4.dirty.agit.6.3.1
Previous: Xia XiaoWen
Message 2 of 2 in “add http.maxReceiveSpeed to limit git-receive-pack receiving speed”
  1. 1/2 add http.maxReceiveSpeed to limit git-receive-pack receiving speedXia XiaoWen, Aug 19, 2021
  2. 2/2 negative values are ignored for http.maxreceivespeedXia XiaoWen, Aug 19, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.