Skip to content

Commit 23a9333

Browse files
add check for channel closed error
1 parent 524b5c6 commit 23a9333

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

examples/scpclient/scpclient.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ THREAD_RETURN WOLFSSH_THREAD scp_client(void* args)
313313

314314
ret = wolfSSH_shutdown(ssh);
315315
/* do not continue on with shutdown process if peer already disconnected */
316-
if (ret != WS_SOCKET_ERROR_E && wolfSSH_get_error(ssh) != WS_SOCKET_ERROR_E) {
316+
if (ret != WS_CHANNEL_CLOSED && ret != WS_SOCKET_ERROR_E &&
317+
wolfSSH_get_error(ssh) != WS_SOCKET_ERROR_E &&
318+
wolfSSH_get_error(ssh) != WS_CHANNEL_CLOSED) {
317319
if (ret != WS_SUCCESS) {
318320
err_sys("Sending the shutdown messages failed.");
319321
}

0 commit comments

Comments
 (0)