From: Xia XiaoWen <haoyurenzhuxia@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net, worldhello.net@gmail.com,
Xia XiaoWen <chenan.xxw@alibaba-inc.com>
Subject: [PATCH 2/2] negative values are ignored for http.maxreceivespeed
Date: Thu, 19 Aug 2021 21:18:08 +0800 [thread overview]
Message-ID: <20210819131808.40759-2-chenan.xxw@alibaba-inc.com> (raw)
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
prev parent reply other threads:[~2021-08-19 13:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-19 13:18 [PATCH 1/2] add http.maxReceiveSpeed to limit git-receive-pack receiving speed Xia XiaoWen
2021-08-19 13:18 ` Xia XiaoWen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210819131808.40759-2-chenan.xxw@alibaba-inc.com \
--to=haoyurenzhuxia@gmail.com \
--cc=chenan.xxw@alibaba-inc.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=worldhello.net@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).