1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-02 01:17:52 +03:00

Implement ssh_blocking_flush()

Based on code from Jan Willamowius
This commit is contained in:
Aris Adamantiadis
2011-03-22 11:49:57 +01:00
parent 79b74bdf64
commit dff4e4e6d3
4 changed files with 39 additions and 0 deletions

View File

@@ -644,6 +644,18 @@ int ssh_socket_data_writable(ssh_socket s) {
return s->write_wontblock;
}
/** @internal
* @brief returns the number of outgoing bytes currently buffered
* @param s the socket
* @returns numbers of bytes buffered, or 0 if the socket isn't connected
*/
int ssh_socket_buffered_write_bytes(ssh_socket s){
if(s==NULL || s->out_buffer == NULL)
return 0;
return buffer_get_rest_len(s->out_buffer);
}
int ssh_socket_get_status(ssh_socket s) {
int r = 0;