forked from wolfSSL/wolfssl
Only try shutdown once in example
This commit is contained in:
@@ -762,13 +762,15 @@ static int SMTP_Shutdown(WOLFSSL* ssl, int wc_shutdown)
|
|||||||
printf("%s\n", tmpBuf);
|
printf("%s\n", tmpBuf);
|
||||||
|
|
||||||
ret = wolfSSL_shutdown(ssl);
|
ret = wolfSSL_shutdown(ssl);
|
||||||
while (wc_shutdown && ret == WOLFSSL_SHUTDOWN_NOT_DONE) {
|
if (wc_shutdown && ret == WOLFSSL_SHUTDOWN_NOT_DONE) {
|
||||||
if (tcp_select(wolfSSL_get_fd(ssl), DEFAULT_TIMEOUT_SEC) ==
|
if (tcp_select(wolfSSL_get_fd(ssl), DEFAULT_TIMEOUT_SEC) ==
|
||||||
TEST_RECV_READY) {
|
TEST_RECV_READY) {
|
||||||
ret = wolfSSL_shutdown(ssl); /* bidirectional shutdown */
|
ret = wolfSSL_shutdown(ssl); /* bidirectional shutdown */
|
||||||
if (ret == WOLFSSL_SUCCESS)
|
if (ret == WOLFSSL_SUCCESS)
|
||||||
printf("Bidirectional shutdown complete\n");
|
printf("Bidirectional shutdown complete\n");
|
||||||
}
|
}
|
||||||
|
if (ret != WOLFSSL_SUCCESS)
|
||||||
|
printf("Bidirectional shutdown failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return WOLFSSL_SUCCESS;
|
return WOLFSSL_SUCCESS;
|
||||||
@@ -3051,12 +3053,14 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||||||
|
|
||||||
if (dtlsUDP == 0) { /* don't send alert after "break" command */
|
if (dtlsUDP == 0) { /* don't send alert after "break" command */
|
||||||
ret = wolfSSL_shutdown(ssl);
|
ret = wolfSSL_shutdown(ssl);
|
||||||
while (wc_shutdown && ret == WOLFSSL_SHUTDOWN_NOT_DONE) {
|
if (wc_shutdown && ret == WOLFSSL_SHUTDOWN_NOT_DONE) {
|
||||||
if (tcp_select(sockfd, DEFAULT_TIMEOUT_SEC) == TEST_RECV_READY) {
|
if (tcp_select(sockfd, DEFAULT_TIMEOUT_SEC) == TEST_RECV_READY) {
|
||||||
ret = wolfSSL_shutdown(ssl); /* bidirectional shutdown */
|
ret = wolfSSL_shutdown(ssl); /* bidirectional shutdown */
|
||||||
if (ret == WOLFSSL_SUCCESS)
|
if (ret == WOLFSSL_SUCCESS)
|
||||||
printf("Bidirectional shutdown complete\n");
|
printf("Bidirectional shutdown complete\n");
|
||||||
}
|
}
|
||||||
|
if (ret != WOLFSSL_SUCCESS)
|
||||||
|
printf("Bidirectional shutdown failed\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(ATOMIC_USER) && !defined(WOLFSSL_AEAD_ONLY)
|
#if defined(ATOMIC_USER) && !defined(WOLFSSL_AEAD_ONLY)
|
||||||
|
Reference in New Issue
Block a user