From ca9bb089081d0458bff098436e54b81f9e1e3779 Mon Sep 17 00:00:00 2001 From: Will Cosgrove Date: Fri, 10 Jul 2020 10:45:47 -0700 Subject: [PATCH] transport.c: socket is disconnected, return error (#500) File: transport.c Notes: This is to fix #102, instead of continuing to attempt to read a disconnected socket, it will now error out. Credit: TDi-jonesds --- src/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transport.c b/src/transport.c index 11e5614..0723b77 100644 --- a/src/transport.c +++ b/src/transport.c @@ -323,7 +323,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session) do { if(session->socket_state == LIBSSH2_SOCKET_DISCONNECTED) { - return LIBSSH2_ERROR_NONE; + return LIBSSH2_ERROR_SOCKET_DISCONNECT; } if(session->state & LIBSSH2_STATE_NEWKEYS) {