Skip to content

Commit

Permalink
check for channel closed on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Feb 22, 2024
1 parent dda8905 commit 8b7a15f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/client/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
Expand Down

0 comments on commit 8b7a15f

Please sign in to comment.