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

Re: behavior in non-blocking


Hi, Nikos.

Unfortunately, libssh is not completely non-blocking. It only has non-blocking mode for a set of calls.

But if you're interested in directions, you could look for ssh_get_poll_flags() function:

http://api.libssh.org/stable/group__libssh__session.html#gae9d0104fbeca17bcfb0659ad718c4606

It returns a set of flags like SSH_READ_PENDING and/or SSH_WRITE_PENDING.

Best regards, Nikolay Karikh.

31.10.2017 09:51, Nikos Mavrogiannopoulos wrote:
Hi,
  I have send a pull request to curl [0] to use libssh as an SCP back-
end, however there is an open issue with non-blocking mode on the new
code.

libssh2 supports non-blocking mode on read and writes, and provides a
function for the caller to determine whether it should wait on the
descriptor for reading or writing. I see that libssh provides a wait to
set the session to non-blocking mode:
http://api.libssh.org/stable/group__libssh__session.html#ga2a29cff08855
611be84d050e5bec73bc
but I don't see how one could determine the direction that made the
call to return SSH_AGAIN.

By seeing:
https://www.libssh.org/archive/libssh/2014-08/0000001.html
I get the impression that libssh may only return SSH_AGAIN on read,
however, that's not documented in the tutorial or individual function
reference.

Am I correct in making the assumption that libssh only returns
SSH_AGAIN on read? If not, is there some way I could obtain the
direction of the block?

regards,
Nikos

[0]. https://github.com/curl/curl/pull/2036








Attachment: smime.p7s
Description: Криптографическая подпись S/MIME


Follow-Ups:
Re: behavior in non-blockingNikos Mavrogiannopoulos <nmav@xxxxxxxxxx>
References:
behavior in non-blockingNikos Mavrogiannopoulos <nmav@xxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org