check for channel closed on shutdown

pull/658/head
JacobBarthelmeh 2024-02-22 07:44:24 -08:00
parent dda8905daa
commit 8b7a15f0fd
1 changed files with 2 additions and 1 deletions

View File

@ -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.");
}