From: Hugo Landau Date: Thu, 4 Apr 2024 10:50:08 +0000 (+0100) Subject: QUIC APL: Unify event handling mode into QUIC_OBJ X-Git-Tag: openssl-3.5.0-alpha1~413 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60c9ce78f56cb677e968560eef9a5edb23d61892;p=thirdparty%2Fopenssl.git QUIC APL: Unify event handling mode into QUIC_OBJ Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/24037) --- diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 505920f707b..db547ba8a29 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -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; diff --git a/ssl/quic/quic_local.h b/ssl/quic/quic_local.h index f75d1283628..af24b484af1 100644 --- a/ssl/quic/quic_local.h +++ b/ssl/quic/quic_local.h @@ -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; diff --git a/ssl/quic/quic_obj_local.h b/ssl/quic/quic_obj_local.h index efd11bac258..b7216165fb7 100644 --- a/ssl/quic/quic_obj_local.h +++ b/ssl/quic/quic_obj_local.h @@ -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 {