diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2012-07-17 18:03:34 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2012-07-17 18:05:51 +0200 |
commit | 43e3a8e497935fd28f1df43933d5c97d02545e4f (patch) | |
tree | c4e37f77757820a863ba7682b1a8bbc0d9934897 /src/session.c | |
parent | 8ef45e00c7dbb5d35f26cb23676d7988e8f833df (diff) | |
download | libssh-43e3a8e497935fd28f1df43933d5c97d02545e4f.tar.gz libssh-43e3a8e497935fd28f1df43933d5c97d02545e4f.tar.xz libssh-43e3a8e497935fd28f1df43933d5c97d02545e4f.zip |
socket: Add a SSH_WRITE_PENDING socket status.
Diffstat (limited to 'src/session.c')
-rw-r--r-- | src/session.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/session.c b/src/session.c index 1e81edc4..174d4613 100644 --- a/src/session.c +++ b/src/session.c @@ -527,9 +527,10 @@ int ssh_handle_packets_termination(ssh_session session, int timeout, * * @param session The ssh session to use. * - * @returns A bitmask including SSH_CLOSED, SSH_READ_PENDING or SSH_CLOSED_ERROR - * which respectively means the session is closed, has data to read on - * the connection socket and session was closed due to an error. + * @returns A bitmask including SSH_CLOSED, SSH_READ_PENDING, SSH_WRITE_PENDING + * or SSH_CLOSED_ERROR which respectively means the session is closed, + * has data to read on the connection socket and session was closed + * due to an error. */ int ssh_get_status(ssh_session session) { int socketstate; @@ -547,6 +548,9 @@ int ssh_get_status(ssh_session session) { if (socketstate & SSH_READ_PENDING) { r |= SSH_READ_PENDING; } + if (socketstate & SSH_WRITE_PENDING) { + r |= SSH_WRITE_PENDING; + } if (session->closed && (socketstate & SSH_CLOSED_ERROR)) { r |= SSH_CLOSED_ERROR; } |