]> granicus.if.org Git - openssl/commitdiff
PR: 2223
authorDr. Stephen Henson <steve@openssl.org>
Tue, 6 Apr 2010 12:29:21 +0000 (12:29 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 6 Apr 2010 12:29:21 +0000 (12:29 +0000)
Submitted By: Robin Seggelmann <seggelmann@fh-muenster.de>

Fixes for DTLS timeout bug

ssl/d1_lib.c

index eeffce3ccc4bb078088183ceb1e303301db98327..96b220e87ce0f52a21f60f1486c0dae6f7e33c7c 100644 (file)
@@ -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;
        }