summaryrefslogtreecommitdiff
path: root/lib/progress.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-03-15 16:43:00 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-03-16 11:10:06 +0100
commitf5700ea88baa5baeb63b7cd42bd12fb03f4e0f4e (patch)
tree867757824c00a87ed99eb3541ec8fb5d2fa5152f /lib/progress.h
parent236402fc2d02068b2ce3656200031ced2fa3c8b1 (diff)
downloadcurl-f5700ea88baa5baeb63b7cd42bd12fb03f4e0f4e.tar.gz
rate-limit: use three second window to better handle high speeds
Due to very frequent updates of the rate limit "window", it could attempt to rate limit within the same milliseconds and that then made the calculations wrong, leading to it not behaving correctly on very fast transfers. This new logic updates the rate limit "window" to be no shorter than the last three seconds and only updating the timestamps for this when switching between the states TOOFAST/PERFORM. Reported-by: 刘佩东 Fixes #2386 Closes #2388
Diffstat (limited to 'lib/progress.h')
-rw-r--r--lib/progress.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/progress.h b/lib/progress.h
index 3c2231cb6..2baa925db 100644
--- a/lib/progress.h
+++ b/lib/progress.h
@@ -46,6 +46,7 @@ void Curl_pgrsSetDownloadSize(struct Curl_easy *data, curl_off_t size);
void Curl_pgrsSetUploadSize(struct Curl_easy *data, curl_off_t size);
void Curl_pgrsSetDownloadCounter(struct Curl_easy *data, curl_off_t size);
void Curl_pgrsSetUploadCounter(struct Curl_easy *data, curl_off_t size);
+void Curl_ratelimit(struct Curl_easy *data, struct curltime now);
int Curl_pgrsUpdate(struct connectdata *);
void Curl_pgrsResetTransferSizes(struct Curl_easy *data);
void Curl_pgrsTime(struct Curl_easy *data, timerid timer);