]> git.ipfire.org Git - thirdparty/curl.git/commit
rate-limit: use three second window to better handle high speeds
authorDaniel Stenberg <daniel@haxx.se>
Thu, 15 Mar 2018 15:43:00 +0000 (16:43 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 16 Mar 2018 10:10:06 +0000 (11:10 +0100)
commitf5700ea88baa5baeb63b7cd42bd12fb03f4e0f4e
tree867757824c00a87ed99eb3541ec8fb5d2fa5152f
parent236402fc2d02068b2ce3656200031ced2fa3c8b1
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
lib/multi.c
lib/progress.c
lib/progress.h