]> git.ipfire.org Git - thirdparty/curl.git/commit
readwrite_data: loop less
authorDaniel Stenberg <daniel@haxx.se>
Mon, 11 Dec 2023 18:36:27 +0000 (19:36 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 14 Dec 2023 15:13:28 +0000 (16:13 +0100)
commit1da640abb6886aab822ff0c0da71b1df0ca89d0f
treead667b549e540e9a0cd9552ed8f28b2bcc67ec31
parent8706b680108919d9cdca1acd3a17fff6a57e245c
readwrite_data: loop less

This function is made to loop in order to drain incoming data
faster. Completely removing the loop has a measerably negative impact on
transfer speeds.

Downsides with the looping include

- it might call the progress callback much more seldom. Especially if
  the write callback is slow.

- rate limiting becomes less exact

- a single transfer might "starve out" other parallel transfers

- QUIC timers for other connections can't be maintained correctly

The long term fix should be to remove the loop and optimize coming back
to avoid the transfer speed penalty.

This fix lower the max loop count to reduce the starvation problem, and
avoids the loop completely for when rate-limiting is in progress.

Ref: #12488
Ref: https://curl.se/mail/lib-2023-12/0012.html
Closes #12504
lib/transfer.c