Document that ssh_channel_read_nonblocking() may return SSH_EOF

The current documentation incorrectly states that it will return 0 on EOF, but
the function calls ssh_channel_poll() internally, which will return SSH_EOF,
which will then be returned by ssh_channel_read_nonblocking().

Signed-off-by: James Wrigley <james@puiterwijk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Norbert Pocs <norbertpocs0@gmail.com>
This commit is contained in:
JamesWrigley
2023-12-11 18:21:17 +01:00
committed by Jakub Jelen
parent 24dfc59264
commit a5cc515f02

View File

@@ -3150,10 +3150,8 @@ int ssh_channel_read_timeout(ssh_channel channel,
*
* @param[in] is_stderr A boolean to select the stderr stream.
*
* @return The number of bytes read, 0 if nothing is available or
* SSH_ERROR on error.
*
* @warning Don't forget to check for EOF as it would return 0 here.
* @return The number of bytes read (0 if nothing is available),
* SSH_ERROR on error, and SSH_EOF if the channel is EOF.
*
* @see ssh_channel_is_eof()
*/