diff --git a/examples/scpclient/scpclient.c b/examples/scpclient/scpclient.c index e3622c3f3..042a5b7f4 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."); } diff --git a/src/ssh.c b/src/ssh.c index 52a7eb534..563e2d421 100644 --- a/src/ssh.c +++ b/src/ssh.c @@ -1000,7 +1000,7 @@ int wolfSSH_shutdown(WOLFSSH* ssh) if (ssh != NULL && ssh->channelList == NULL) { WLOG(WS_LOG_DEBUG, "channel list was already removed"); - ret = WS_SUCCESS; + ret = WS_CHANNEL_CLOSED; } WLOG(WS_LOG_DEBUG, "Leaving wolfSSH_shutdown(), ret = %d", ret);