Buy commercial curl support from WolfSSL. We help you work
out your issues, debug your libcurl applications, use the API, port to new
platforms, add new features and more. With a team lead by the curl founder
himself.
Re: Large download speed deviations for CURLOPT_MAX_RECV_SPEED_LARGE in 8.4.0
- Contemporary messages sorted: [ by date ] [ by thread ] [ by subject ] [ by author ] [ by messages with attachments ]
From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 8 Dec 2023 16:29:20 +0100 (CET)
On Tue, 5 Dec 2023, Dmitry Karpov via curl-library wrote:
> With this patch, I was able to get quite precise speed limitations (under
> 0.5% on average) for different socket buffers and speed limits.
Isn't this the same effect with a smaller change?
--- a/lib/transfer.c
+++ b/lib/transfer.c
_at__at_ -430,12 +430,11 _at__at_ static CURLcode readwrite_data(struct Curl_easy *data,
CURLcode result = CURLE_OK;
char *buf;
size_t blen;
size_t consumed;
int maxloops = 100;
- curl_off_t max_recv = data->set.max_recv_speed?
- data->set.max_recv_speed : CURL_OFF_T_MAX;
+ curl_off_t max_recv = data->set.max_recv_speed ? 0 : CURL_OFF_T_MAX;
bool data_eof_handled = FALSE;
DEBUGASSERT(data->state.buffer);
*done = FALSE;
*comeback = FALSE;
Date: Fri, 8 Dec 2023 16:29:20 +0100 (CET)
On Tue, 5 Dec 2023, Dmitry Karpov via curl-library wrote:
> With this patch, I was able to get quite precise speed limitations (under
> 0.5% on average) for different socket buffers and speed limits.
Isn't this the same effect with a smaller change?
--- a/lib/transfer.c
+++ b/lib/transfer.c
_at__at_ -430,12 +430,11 _at__at_ static CURLcode readwrite_data(struct Curl_easy *data,
CURLcode result = CURLE_OK;
char *buf;
size_t blen;
size_t consumed;
int maxloops = 100;
- curl_off_t max_recv = data->set.max_recv_speed?
- data->set.max_recv_speed : CURL_OFF_T_MAX;
+ curl_off_t max_recv = data->set.max_recv_speed ? 0 : CURL_OFF_T_MAX;
bool data_eof_handled = FALSE;
DEBUGASSERT(data->state.buffer);
*done = FALSE;
*comeback = FALSE;
-- / daniel.haxx.se | Commercial curl support up to 24x7 is available! | Private help, bug fixes, support, ports, new features | https://curl.se/support.html -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.htmlReceived on 2023-12-08