]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC Front End I/O API: Remove unnecessary code from SSL_get_tick_timeout
authorHugo Landau <hlandau@openssl.org>
Wed, 30 Nov 2022 08:02:50 +0000 (08:02 +0000)
committerHugo Landau <hlandau@openssl.org>
Fri, 13 Jan 2023 13:20:20 +0000 (13:20 +0000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19703)

ssl/quic/quic_impl.c

index 9dab1a92748dc736bad56e3c34d2ee5e8cff66a3..682ca6484f82c2904e179d52a5b71f73b5e9a74a 100644 (file)
@@ -411,7 +411,7 @@ int ossl_quic_tick(QUIC_CONNECTION *qc)
  */
 int ossl_quic_get_tick_timeout(QUIC_CONNECTION *qc, struct timeval *tv)
 {
-    OSSL_TIME now, deadline = ossl_time_infinite();
+    OSSL_TIME deadline = ossl_time_infinite();
 
     if (qc->ch != NULL)
         deadline
@@ -423,14 +423,7 @@ int ossl_quic_get_tick_timeout(QUIC_CONNECTION *qc, struct timeval *tv)
         return 1;
     }
 
-    now = ossl_time_now();
-    if (ossl_time_compare(now, deadline) >= 0) {
-        tv->tv_sec  = 0;
-        tv->tv_usec = 0;
-        return 1;
-    }
-
-    *tv = ossl_time_to_timeval(ossl_time_subtract(deadline, now));
+    *tv = ossl_time_to_timeval(ossl_time_subtract(deadline, ossl_time_now()));
     return 1;
 }