QUIC Thread Assisted Mode: Fix typos and use of CRYPTO_RWLOCK type
authorHugo Landau <hlandau@openssl.org>
Thu, 23 Feb 2023 05:02:29 +0000 (05:02 +0000)
committerHugo Landau <hlandau@openssl.org>
Thu, 30 Mar 2023 10:14:10 +0000 (11:14 +0100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20348)

include/internal/quic_thread_assist.h
ssl/quic/quic_channel.c
ssl/quic/quic_channel_local.h
ssl/quic/quic_local.h
ssl/quic/quic_reactor.c
ssl/quic/quic_thread_assist.c
ssl/quic/quic_tserver.c

index 94fcaec004b8732fc3b7923ee395c8d5b7e888c4..7d1b47453a1549fddba9854e08418e82d5e78f94 100644 (file)
@@ -30,7 +30,7 @@
  * SSL_tick() is called  on  time. This is not needed if the application always
  * has a call blocking to SSL_read() or SSL_write() (or another I/O function) on
  * a QUIC SSL object, but if the application goes for long periods of time
- * without makingany such call to a QUIC SSL object, libssl cannot ordinarily
+ * without making any such call to a QUIC SSL object, libssl cannot ordinarily
  * guarantee that QUIC timeout events will be serviced in a timely fashion.
  * Thread assisted  mode is therefore of use to applications which do not always
  * have an ongoing call to an I/O function on a QUIC SSL object but also do not
index 2360809295ae7ec59b9495ad442ef5dab54d66a9..9d8acd17fd1fc18cc1f3cf51dcf341728f4ed988 100644 (file)
@@ -1609,7 +1609,7 @@ static int ch_tx(QUIC_CHANNEL *ch)
         /*
          * RFC 9000 s. 10.1. 'An endpoint also restarts its idle timer when
          * sending an ack-eliciting packet if no other ack-eliciting packets
-         * have been sentsince last receiving and processing a packet.'
+         * have been sent since last receiving and processing a packet.'
          */
         if (sent_ack_eliciting && !ch->have_sent_ack_eliciting_since_rx) {
             ch_update_idle(ch);
index bd8f95b7a54f0edb10a9cf084a6a311c33a05c6e..1e9e0e1e68bc3413e9c07e2342e2f3c1154ac35e 100644 (file)
@@ -31,7 +31,7 @@ struct quic_channel_st {
      * passes it to us and is responsible for freeing it after channel
      * destruction.
      */
-    CRYPTO_RWLOCK                   *mutex;
+    CRYPTO_MUTEX                    *mutex;
 
     /*
      * Callback used to get the current time.
index a20e92df2ada38b2bd01b4f9a1187a15a9877ea5..9aad63b742eb1aac2ee9e1e1a9ebde88de630136 100644 (file)
@@ -55,7 +55,7 @@ struct quic_conn_st {
      * The mutex used to synchronise access to the QUIC_CHANNEL. We own this but
      * provide it to the channel.
      */
-    CRYPTO_RWLOCK                   *mutex;
+    CRYPTO_MUTEX                    *mutex;
 
     /* Our single bidirectional application data stream. */
     QUIC_STREAM                     *stream0;
index cae8dffe0eb52a1557abf692b928913081a77587..d9826e7e940cb190375516bb7103fa9b02f66619 100644 (file)
@@ -133,7 +133,7 @@ int ossl_quic_reactor_tick(QUIC_REACTOR *rtor, uint32_t flags)
 static int poll_two_fds(int rfd, int rfd_want_read,
                         int wfd, int wfd_want_write,
                         OSSL_TIME deadline,
-                        CRYPTO_RWLOCK *mutex)
+                        CRYPTO_MUTEX *mutex)
 {
 #if defined(OPENSSL_SYS_WINDOWS) || !defined(POLLIN)
     fd_set rfd_set, wfd_set, efd_set;
@@ -282,7 +282,7 @@ static int poll_descriptor_to_fd(const BIO_POLL_DESCRIPTOR *d, int *fd)
 static int poll_two_descriptors(const BIO_POLL_DESCRIPTOR *r, int r_want_read,
                                 const BIO_POLL_DESCRIPTOR *w, int w_want_write,
                                 OSSL_TIME deadline,
-                                CRYPTO_RWLOCK *mutex)
+                                CRYPTO_MUTEX *mutex)
 {
     int rfd, wfd;
 
@@ -307,7 +307,7 @@ static int poll_two_descriptors(const BIO_POLL_DESCRIPTOR *r, int r_want_read,
 int ossl_quic_reactor_block_until_pred(QUIC_REACTOR *rtor,
                                        int (*pred)(void *arg), void *pred_arg,
                                        uint32_t flags,
-                                       CRYPTO_RWLOCK *mutex)
+                                       CRYPTO_MUTEX *mutex)
 {
     int res;
 
index 93d246ea8e1ebd08451660b45ed10cd25ab43ccc..b2917871abc9b1ec45a6bac7856597e9d437703c 100644 (file)
@@ -14,7 +14,7 @@
 #include "internal/thread_arch.h"
 #include "internal/quic_thread_assist.h"
 
-#if !defined(OPENSSL_NO_QUIC) && !defined(OPENSSL_NO_THREAD_POOL)
+#if !defined(OPENSSL_NO_QUIC) && defined(OPENSSL_THREADS)
 
 /* Main loop for the QUIC assist thread. */
 static unsigned int assist_thread_main(void *arg)
index 27addc9be51c1edbf96f795aaad944c7caed9c88..a0660458d497848a44bb97391b1754e840867c0b 100644 (file)
@@ -25,7 +25,7 @@ struct quic_tserver_st {
     QUIC_CHANNEL    *ch;
 
     /* The mutex we give to the QUIC channel. */
-    CRYPTO_RWLOCK   *mutex;
+    CRYPTO_MUTEX    *mutex;
 
     /* SSL_CTX for creating the underlying TLS connection */
     SSL_CTX *ctx;