Calling curl_multi_perform() in a loop is actually
busy waiting for data being available on the socket.
The whole logic in lr_perform() can be simplified
allowing more efficient processing. The function has
to repeatedly do:
1) call curl_multi_perform() for curl to fetch data if needed/available
2) call check_transfer_statuses() to check download status
3) if curl needs more data, wait for the socket to have some
Once there's no need for more data, and there's no other
transfer pending, lr_perform() can return TRUE.
Calling curl_multi_perform() in a loop is actually busy waiting for data being available on the socket.
The whole logic in lr_perform() can be simplified allowing more efficient processing. The function has to repeatedly do:
1) call curl_multi_perform() for curl to fetch data if needed/available 2) call check_transfer_statuses() to check download status 3) if curl needs more data, wait for the socket to have some
Once there's no need for more data, and there's no other transfer pending, lr_perform() can return TRUE.
The function can be further simplified by
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1691856
Fixes: 208edbecf3b0 ('Reduce download delays by using still_running correctly.')