> Am 30.10.2025 um 15:22 schrieb Cristian Rodríguez <[email protected]>:
> 
> On Thu, Oct 30, 2025 at 10:47 AM Stefan Eissing <[email protected]> wrote:
>> 
>> 
>> 
>>> Am 30.10.2025 um 14:46 schrieb Stefan Eissing <[email protected]>:
>>> 
>>> 
>>> 
>>>> Am 30.10.2025 um 14:38 schrieb Cristian Rodríguez <[email protected]>:
>>>> 
>>>> On Wed, Oct 29, 2025 at 10:47 PM Gleb Smirnoff via curl-library
>>>> <[email protected]> wrote:
>>>> 
>>>>> --- a/lib/transfer.c
>>>>> +++ b/lib/transfer.c
>>>>> @@ -280,9 +280,10 @@ static CURLcode sendrecv_dl(struct Curl_easy *data,
>>>>> 
>>>>>   if(bytestoread && data->set.max_recv_speed > 0) {
>>>>>     /* In case of speed limit on receiving: if this loop already got
>>>>> -       * data, break out. If not, limit the amount of bytes to receive.
>>>>> -       * The overall, timed, speed limiting is done in multi.c */
>>>>> -      if(total_received)
>>>>> +       * a quarter of the quota, break out. We want to stutter a bit
>>>>> +       * to keep in the limit, but too small receives will just cost
>>>>> +       * cpu unnecessarily. */
>>>>> +      if(total_received >= (data->set.max_recv_speed / 4))
>>>>>       break;
>>>>>     if(data->set.max_recv_speed < (curl_off_t)bytestoread)
>>>>>       bytestoread = (size_t)data->set.max_recv_speed;
>>>>> 
>>>>> Thanks!
>>>> 
>>>> 
>>>> This is on an special BSD system or what? because on Linux this is the
>>>> wrong way of doing it.. the kernel can ratelimit your transfers way
>>>> more efficiently using SO_MAX_PACING_RATE
>>> 
>>> That is for outgoing packets, right=
>> 
>> should have been with a question mark...
> 
> Yes, incoming will be better served by running the current program in
> a different network namespace with the tc rules or some fancy
> container runtime that enforces your limits at a different lower
> level.

That would allow individual connections with different, possibly dynamic RX 
pacing for the same application? I believe you are talking about a more narrow 
use case than what is the scope here.

- Stefan

-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to