From f05bcb30e014237f873d8a17bc75ba1b2819ab94 Mon Sep 17 00:00:00 2001 From: Anthony Hu Date: Tue, 21 Jun 2022 10:48:48 -0400 Subject: [PATCH] div by 4 in milliseconds --- src/wolfio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wolfio.c b/src/wolfio.c index 875811aa1..89dad8116 100644 --- a/src/wolfio.c +++ b/src/wolfio.c @@ -2150,12 +2150,12 @@ int MicriumReceive(WOLFSSL *ssl, char *buf, int sz, void *ctx) /* needs timeout in milliseconds */ #ifdef WOLFSSL_DTLS13 if (wolfSSL_dtls13_use_quick_timeout(ssl) && - IsAtLeastTLSv1_3(ssl->version) && (dtls_timeout >= 4)) { - dtls_timeout = dtls_timeout / 4; + IsAtLeastTLSv1_3(ssl->version)) { + dtls_timeout = (1000 * dtls_timeout) / 4; } #endif /* WOLFSSL_DTLS13 */ - NetSock_CfgTimeoutRxQ_Set(sd, dtls_timeout * 1000, &err); + NetSock_CfgTimeoutRxQ_Set(sd, dtls_timeout, &err); if (err != NET_SOCK_ERR_NONE) { WOLFSSL_MSG("NetSock_CfgTimeoutRxQ_Set failed"); } @@ -2228,12 +2228,12 @@ int MicriumReceiveFrom(WOLFSSL *ssl, char *buf, int sz, void *ctx) /* needs timeout in milliseconds */ #ifdef WOLFSSL_DTLS13 if (wolfSSL_dtls13_use_quick_timeout(ssl) && - IsAtLeastTLSv1_3(ssl->version) && (dtls_timeout >= 4)) { - dtls_timeout = dtls_timeout / 4; + IsAtLeastTLSv1_3(ssl->version)) { + dtls_timeout = (1000 * dtls_timeout) / 4; } #endif /* WOLFSSL_DTLS13 */ - NetSock_CfgTimeoutRxQ_Set(sd, dtls_timeout * 1000, &err); + NetSock_CfgTimeoutRxQ_Set(sd, dtls_timeout, &err); if (err != NET_SOCK_ERR_NONE) { WOLFSSL_MSG("NetSock_CfgTimeoutRxQ_Set failed"); }