summaryrefslogtreecommitdiffstats
path: root/ssl/d1_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-04-06 12:29:31 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-04-06 12:29:31 +0000
commit87a37cbadd4b56fb4dc21008c5bcbe929f0a52b6 (patch)
treecf0c7bff3024d899c313684a38b1d833155ef1ca /ssl/d1_lib.c
parent00a37b5a9b295c1b55ca9a1c1f207d347ad5b24a (diff)
PR: 2223
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de> Fixes for DTLS timeout bug
Diffstat (limited to 'ssl/d1_lib.c')
-rw-r--r--ssl/d1_lib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c
index 2786b61c29..c2867c92a2 100644
--- a/ssl/d1_lib.c
+++ b/ssl/d1_lib.c
@@ -283,6 +283,16 @@ struct timeval* dtls1_get_timeout(SSL *s, struct timeval* timeleft)
timeleft->tv_usec += 1000000;
}
+ /* If remaining time is less than 15 ms, set it to 0
+ * to prevent issues because of small devergences with
+ * socket timeouts.
+ */
+ if (timeleft->tv_sec == 0 && timeleft->tv_usec < 15000)
+ {
+ memset(timeleft, 0, sizeof(struct timeval));
+ }
+
+
return timeleft;
}