diff options
author | Hugo Landau <hlandau@openssl.org> | 2024-04-04 11:50:08 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2024-04-19 09:33:53 +0100 |
commit | a0fbdcc537fbee90ad03a75d74ca01950011ab4b (patch) | |
tree | a263e52b357d8ce9392e9d1bdd7be9421b18e607 | |
parent | 08cc2f41a4b573220dd82c66c1b2a0df28ecb1db (diff) |
QUIC APL: Unify event handling mode into QUIC_OBJ
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24037)
-rw-r--r-- | ssl/quic/quic_impl.c | 22 | ||||
-rw-r--r-- | ssl/quic/quic_local.h | 6 | ||||
-rw-r--r-- | ssl/quic/quic_obj_local.h | 3 |
3 files changed, 11 insertions, 20 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index a45adb0949..18715c3621 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -3502,14 +3502,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; } @@ -3519,7 +3518,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 @@ -3551,14 +3550,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 f75d128362..af24b484af 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 efd11bac25..b7216165fb 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 { |