From 23a9333b2d189ca8fa8bb3fd7a775dabdb25487a Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Mon, 10 Jun 2024 15:54:42 -0600 Subject: [PATCH] add check for channel closed error --- examples/scpclient/scpclient.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/scpclient/scpclient.c b/examples/scpclient/scpclient.c index e3622c3f..042a5b7f 100644 --- a/examples/scpclient/scpclient.c +++ b/examples/scpclient/scpclient.c @@ -313,7 +313,9 @@ THREAD_RETURN WOLFSSH_THREAD scp_client(void* args) ret = wolfSSH_shutdown(ssh); /* do not continue on with shutdown process if peer already disconnected */ - if (ret != WS_SOCKET_ERROR_E && wolfSSH_get_error(ssh) != WS_SOCKET_ERROR_E) { + if (ret != WS_CHANNEL_CLOSED && ret != WS_SOCKET_ERROR_E && + wolfSSH_get_error(ssh) != WS_SOCKET_ERROR_E && + wolfSSH_get_error(ssh) != WS_CHANNEL_CLOSED) { if (ret != WS_SUCCESS) { err_sys("Sending the shutdown messages failed."); }