]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC APL: Unify event handling mode into QUIC_OBJ
authorHugo Landau <hlandau@openssl.org>
Thu, 4 Apr 2024 10:50:08 +0000 (11:50 +0100)
committerNeil Horman <nhorman@openssl.org>
Mon, 17 Feb 2025 16:27:32 +0000 (11:27 -0500)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24037)

ssl/quic/quic_impl.c
ssl/quic/quic_local.h
ssl/quic/quic_obj_local.h

index 505920f707b7ee4aab59b53b05595b2f8e581ff1..db547ba8a2906a5c2eebb189f0afa65f94a72bb8 100644 (file)
@@ -3520,14 +3520,13 @@ QUIC_NEEDS_LOCK
 static int qctx_should_autotick(QCTX *ctx)
 {
     int event_handling_mode;
+    QUIC_OBJ *obj = ctx->obj;
 
-    if (ctx->is_stream) {
-        event_handling_mode = ctx->xso->event_handling_mode;
-        if (event_handling_mode != SSL_VALUE_EVENT_HANDLING_MODE_INHERIT)
-            return event_handling_mode != SSL_VALUE_EVENT_HANDLING_MODE_EXPLICIT;
-    }
+    for (; (event_handling_mode = obj->event_handling_mode)
+            == SSL_VALUE_EVENT_HANDLING_MODE_INHERIT
+            && obj->parent_obj != NULL;
+         obj = obj->parent_obj);
 
-    event_handling_mode = ctx->qc->event_handling_mode;
     return event_handling_mode != SSL_VALUE_EVENT_HANDLING_MODE_EXPLICIT;
 }
 
@@ -3537,7 +3536,7 @@ static void qctx_maybe_autotick(QCTX *ctx)
     if (!qctx_should_autotick(ctx))
         return;
 
-    ossl_quic_reactor_tick(ossl_quic_channel_get_reactor(ctx->qc->ch), 0);
+    ossl_quic_reactor_tick(ossl_quic_obj_get0_reactor(ctx->obj), 0);
 }
 
 QUIC_TAKES_LOCK
@@ -3569,14 +3568,9 @@ static int qc_getset_event_handling(QCTX *ctx, uint32_t class_,
         }
 
         value_out = *p_value_in;
-        if (ctx->is_stream)
-            ctx->xso->event_handling_mode = (int)value_out;
-        else
-            ctx->qc->event_handling_mode = (int)value_out;
+        ctx->obj->event_handling_mode = (int)value_out;
     } else {
-        value_out = ctx->is_stream
-            ? ctx->xso->event_handling_mode
-            : ctx->qc->event_handling_mode;
+        value_out = ctx->obj->event_handling_mode;
     }
 
     ret = 1;
index f75d128362843081a406ab1ec237e01e9f9c96d6..af24b484af184624b45773f4008616beda3555ab 100644 (file)
@@ -72,9 +72,6 @@ struct quic_xso_st {
     /* Is an AON write in progress? */
     unsigned int                    aon_write_in_progress   : 1;
 
-    /* Event handling mode. One of SSL_QUIC_VALUE_EVENT_HANDLING. */
-    unsigned int                    event_handling_mode     : 2;
-
     /*
      * The base buffer pointer the caller passed us for the initial AON write
      * call. We use this for validation purposes unless
@@ -209,9 +206,6 @@ struct quic_conn_st {
     unsigned int                    addressed_mode_w        : 1;
     unsigned int                    addressed_mode_r        : 1;
 
-    /* Event handling mode. One of SSL_QUIC_VALUE_EVENT_HANDLING. */
-    unsigned int                    event_handling_mode     : 2;
-
     /* Default stream type. Defaults to SSL_DEFAULT_STREAM_MODE_AUTO_BIDI. */
     uint32_t                        default_stream_mode;
 
index efd11bac2589ea9922ed17a60806b063ddf3e678..b7216165fb70c19234414d863d1b8a49cc31d2de 100644 (file)
@@ -109,6 +109,9 @@ struct quic_obj_st {
      * by default inherits from the parent SSL object.
      */
     unsigned int            req_blocking_mode       : 2; /* QUIC_BLOCKING_MODE */
+
+    /* Event handling mode. One of SSL_QUIC_VALUE_EVENT_HANDLING. */
+    unsigned int            event_handling_mode     : 2;
 };
 
 enum {