]> git.ipfire.org Git - thirdparty/curl.git/commit
SCP/SFTP: avoid busy loop after EAGAIN
authorStefan Eissing <stefan@eissing.org>
Wed, 4 Jun 2025 13:26:55 +0000 (15:26 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 5 Jun 2025 07:11:29 +0000 (09:11 +0200)
commit34d694f89c9269bb23b9f71f58b88062142dcc5b
treea5f89e36cbfc033d0985bfd690aad6b9711c07e6
parente67a500841c019f8ab8102f4f8525a302f425cdb
SCP/SFTP: avoid busy loop after EAGAIN

The ssh 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).

Closes #17533
lib/transfer.c