curl / Mailing Lists / curl-library / Single Mail
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

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Tue, 5 Dec 2023 11:02:38 +0100 (CET)

On Tue, 5 Dec 2023, Dmitry Karpov via curl-library wrote:

> In the do-while loop, we keep reading from socket until we can, so with
> relatively big socket buffers we can read a lot of data before we can have a
> chance to check for throttling again

It does initialize the max_recv like this:

   curl_off_t max_recv = data->set.max_recv_speed?
                         data->set.max_recv_speed : CURL_OFF_T_MAX;

... so it *is* limited. That might just not be a very effective limit after it
already has reached the limit. Maybe we can improve this logic?

Even just getting a smaller portion of the max speed could probably be a
better take:

   curl_off_t max_recv = data->set.max_recv_speed?
                         data->set.max_recv_speed / 4 : CURL_OFF_T_MAX;

-- 
  / 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.html
Received on 2023-12-05