]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
SSL_poll(): Handle blocking with no poll items
authorTomas Mraz <tomas@openssl.org>
Mon, 14 Oct 2024 11:26:07 +0000 (13:26 +0200)
committerNeil Horman <nhorman@openssl.org>
Mon, 17 Feb 2025 16:27:33 +0000 (11:27 -0500)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25416)

ssl/rio/poll_immediate.c

index 76b2db7a807a72c3ef04b518f3544234d3df59ac..fb18e9e5fea54a3faa8cd60162e7f8e0b1837999 100644 (file)
@@ -412,8 +412,12 @@ int SSL_poll(SSL_POLL_ITEM *items,
     OSSL_TIME deadline;
 
     /* Trivial case. */
-    if (num_items == 0)
+    if (num_items == 0) {
+        if (timeout == NULL)
+            goto out;
+        OSSL_sleep(ossl_time2ms(ossl_time_from_timeval(*timeout)));
         goto out;
+    }
 
     /* Convert timeout to deadline. */
     if (timeout == NULL)