From 8b7a15f0fdd4c24a548d348616d0dbb23d31f1fe Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Thu, 22 Feb 2024 07:44:24 -0800 Subject: [PATCH] check for channel closed on shutdown --- examples/client/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/client/client.c b/examples/client/client.c index 4d56575f6..9fed6fac2 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -977,7 +977,8 @@ THREAD_RETURN WOLFSSH_THREAD client_test(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_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."); }