Skip to content

Conversation

@icing
Copy link
Contributor

@icing icing commented Jun 4, 2025

The libssh libraries do not reveal if they still have data buffered from the peer. Only when their buffers are read empty can curl be sure that it is safe to rely on socket polling.

This change adds detection of EAGAIN on receive in the transfer loop and allows SFTP/SCP transfers to avoid a busy loop in such a case (which should happen often when CPU exceeds network bandwidth).

The libssh libraries do not reveal if they still have data buffered
from the peer. Only when their buffers are read empty can curl be
sure that it is safe to rely on socket polling.

This change adds detection of EGAIN on receive in the transfer loop
and allows SFTP/SCP transfers to avoid a busy loop in such a case
(which should happen often when CPU exceeds network bandwidth).
@icing icing added the SCP/SFTP label Jun 4, 2025
@icing icing changed the title SCP/SFTP: avoid busy loop after EAGAIN SCP/SFTP: avoid busy loop on receive Jun 4, 2025
@icing icing requested a review from bagder June 4, 2025 14:01
@bagder bagder closed this in 34d694f Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants