Reset ret in client and server after wolfSSL_dtls_got_timeout()

- Do UDP connect only with simulateWantWrite to accommodate macOS that doesn't like sendto being called on connected UDP sockets
- Call wolfSSL_dtls_get_current_timeout only on a DTLS connection
This commit is contained in:
Juliusz Sosinowicz
2022-05-12 16:48:04 +02:00
parent 9914da3046
commit 44be4e1cc8
3 changed files with 22 additions and 8 deletions

View File

@@ -330,7 +330,8 @@ static int NonBlockingSSL_Accept(SSL* ssl)
}
else {
#ifdef WOLFSSL_DTLS
currTimeout = wolfSSL_dtls_get_current_timeout(ssl);
if (wolfSSL_dtls(ssl))
currTimeout = wolfSSL_dtls_get_current_timeout(ssl);
#endif
select_ret = tcp_select(sockfd, currTimeout);
}
@@ -360,6 +361,7 @@ static int NonBlockingSSL_Accept(SSL* ssl)
error = wolfSSL_get_error(ssl, ret);
else
error = WOLFSSL_ERROR_WANT_READ;
ret = WOLFSSL_FAILURE; /* Reset error so we loop */
}
#endif
else {