After sending the shutdown messages, client needs to wait for the server to respond before closing its socket.

pull/368/head
John Safranek 2021-10-07 15:28:40 -07:00
parent 3c8b2a622a
commit f95e0995cc
No known key found for this signature in database
GPG Key ID: 8CE817DE0D3CCB4A
1 changed files with 7 additions and 0 deletions

View File

@ -1142,6 +1142,13 @@ THREAD_RETURN WOLFSSH_THREAD client_test(void* args)
#endif
}
ret = wolfSSH_shutdown(ssh);
if (ret != WS_SUCCESS) {
err_sys("Sending the shutdown messages failed.");
}
ret = wolfSSH_worker(ssh, NULL);
if (ret != WS_SUCCESS) {
err_sys("Failed to listen for close messages from the peer.");
}
WCLOSESOCKET(sockFd);
wolfSSH_free(ssh);
wolfSSH_CTX_free(ctx);