From 69e00a3f97251e686835d09b49930d446833003d Mon Sep 17 00:00:00 2001 From: John Safranek Date: Mon, 22 Feb 2016 21:13:05 -0800 Subject: [PATCH] allow dtls timeout to be 0 in the recvfrom callback, set to 0 if the handshake is done --- src/io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/io.c b/src/io.c index 026c66e7a..c710754ae 100644 --- a/src/io.c +++ b/src/io.c @@ -404,7 +404,10 @@ int EmbedReceiveFrom(WOLFSSL *ssl, char *buf, int sz, void *ctx) WOLFSSL_ENTER("EmbedReceiveFrom()"); - if (!wolfSSL_get_using_nonblock(ssl) && dtls_timeout != 0) { + if (ssl->options.handShakeDone) + dtls_timeout = 0; + + if (!wolfSSL_get_using_nonblock(ssl)) { #ifdef USE_WINDOWS_API DWORD timeout = dtls_timeout * 1000; #else