diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-04-06 12:29:08 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-04-06 12:29:08 +0000 |
commit | 4a052f0bb94e5e6932b8c09102279ed2e79eaad2 (patch) | |
tree | 68f5750b816ee87fee4dceb47b44838c4fb54783 /ssl/d1_lib.c | |
parent | f34e79f27be516077133b391cf548b52f3c66f07 (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.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c index 63bfbacc82..54e16403e6 100644 --- a/ssl/d1_lib.c +++ b/ssl/d1_lib.c @@ -305,6 +305,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; } |