From d491916a4af268b7bb2cf6ec2fa00a5deb3479f0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 14 Aug 2020 16:49:42 +0200 Subject: [PATCH] docs: clarify MAX_SEND/RECV_SPEED functionality ... in particular what happens if the maximum speed limit is set to a value that's smaller than the transfer buffer size in use. Reported-by: Tomas Berger Fixes #5788 Closes #5813 --- docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.3 | 12 +++++++++--- docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.3 | 9 ++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.3 b/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.3 index e4ced8643..23bb16d31 100644 --- a/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.3 +++ b/docs/libcurl/opts/CURLOPT_MAX_RECV_SPEED_LARGE.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. .\" * .\" * This software is licensed as described in the file COPYING, which .\" * you should have received as part of this distribution. The terms @@ -28,12 +28,18 @@ CURLOPT_MAX_RECV_SPEED_LARGE \- rate limit data download speed #include CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAX_RECV_SPEED_LARGE, - curl_off_t speed); + curl_off_t maxspeed); .SH DESCRIPTION -Pass a curl_off_t as parameter. If a download exceeds this \fIspeed\fP +Pass a curl_off_t as parameter. If a download exceeds this \fImaxspeed\fP (counted in bytes per second) the transfer will pause to keep the speed less than or equal to the parameter value. Defaults to unlimited speed. +This is not an exact science. libcurl attempts to keep the average speed below +the given threshold over a period time. + +If you set \fImaxspeed\fP to a value lower than \fICURLOPT_BUFFERSIZE(3)\fP, +libcurl might download faster than the set limit initially. + This option doesn't affect transfer speeds done with FILE:// URLs. .SH DEFAULT 0, disabled diff --git a/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.3 b/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.3 index d9f5c8bf0..ba86a67a3 100644 --- a/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.3 +++ b/docs/libcurl/opts/CURLOPT_MAX_SEND_SPEED_LARGE.3 @@ -5,7 +5,7 @@ .\" * | (__| |_| | _ <| |___ .\" * \___|\___/|_| \_\_____| .\" * -.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. +.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. .\" * .\" * This software is licensed as described in the file COPYING, which .\" * you should have received as part of this distribution. The terms @@ -35,6 +35,13 @@ this speed (counted in bytes per second) the transfer will pause to keep the speed less than or equal to the parameter value. Defaults to unlimited speed. +This is not an exact science. libcurl attempts to keep the average speed below +the given threshold over a period time. + +If you set \fImaxspeed\fP to a value lower than +\fICURLOPT_UPLOAD_BUFFERSIZE(3)\fP, libcurl might "shoot over" the limit on +its first send and still send off a full buffer. + This option doesn't affect transfer speeds done with FILE:// URLs. .SH DEFAULT 0, disabled