1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-23 16:48:49 -05:00

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
This commit is contained in:
Daniel Stenberg 2020-08-14 16:49:42 +02:00
parent 86dc9867a5
commit d491916a4a
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 17 additions and 4 deletions

View File

@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * 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 <curl/curl.h> #include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAX_RECV_SPEED_LARGE, CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAX_RECV_SPEED_LARGE,
curl_off_t speed); curl_off_t maxspeed);
.SH DESCRIPTION .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 (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. 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. This option doesn't affect transfer speeds done with FILE:// URLs.
.SH DEFAULT .SH DEFAULT
0, disabled 0, disabled

View File

@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___ .\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____| .\" * \___|\___/|_| \_\_____|
.\" * .\" *
.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. .\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" * .\" *
.\" * This software is licensed as described in the file COPYING, which .\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms .\" * 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 less than or equal to the parameter value. Defaults to unlimited
speed. 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. This option doesn't affect transfer speeds done with FILE:// URLs.
.SH DEFAULT .SH DEFAULT
0, disabled 0, disabled