summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2013-11-03 12:46:27 +0100
committerAndreas Schneider <asn@cryptomilk.org>2013-11-03 12:48:12 +0100
commit7c8a793b0a53182566a275fb43d5a1e868c792e4 (patch)
treee807acf4d15de3f422e577c4af85fe6101e4a536 /src
parente9b0a8210d6fda4ce6a8a9d761b151db0db9befb (diff)
socket: Fix check for pending data.
BUG: https://red.libssh.org/issues/119 Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/socket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/socket.c b/src/socket.c
index 0dbbe2bc..c76ef5ae 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -695,11 +695,11 @@ int ssh_socket_buffered_write_bytes(ssh_socket s){
int ssh_socket_get_status(ssh_socket s) {
int r = 0;
- if (s->read_wontblock) {
- r |= SSH_READ_PENDING;
+ if (buffer_get_len(s->in_buffer) > 0) {
+ r |= SSH_READ_PENDING;
}
- if (s->write_wontblock) {
+ if (buffer_get_len(s->out_buffer) > 0) {
r |= SSH_WRITE_PENDING;
}