[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switching between blocking and non-blocking mode


On Mon, Mar 24, 2025 at 1:15 PM James Wrigley <james@xxxxxxxxxxxxxx> wrote:
> Do you have an idea of how difficult it would be to extend the SFTP API to work in non-blocking mode as well?

We are trying to make the new APIs (such as the SFTP AIO) in a way
that it should be ready to work in async mode. But as far as I know,
all the old ones will have to be rewritten. Some functions might need
just internal changes (the simple one returning int/ssize_t, for
example sftp_fsync()), but others will likely need a new API as they
return now an object (such as sftp_new()), where it is not possible to
return SSH_AGAIN while waiting for the response.

We have a abandoned draft for the change of sftp_new() and sftp_init()
to work with non-blocking mode here:

https://gitlab.com/libssh/libssh-mirror/-/merge_requests/404/

Jakub


References:
Switching between blocking and non-blocking modeJames Wrigley <james@xxxxxxxxxxxxxx>
Re: Switching between blocking and non-blocking modeJakub Jelen <jjelen@xxxxxxxxxx>
Re: Switching between blocking and non-blocking modeJames Wrigley <james@xxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org