mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-02 01:17:52 +03:00
socket: Add a SSH_WRITE_PENDING socket status.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user