Skip to content

Commit

Permalink
QUIC APL: Unify event handling mode into QUIC_OBJ
Browse files Browse the repository at this point in the history
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #24037)
  • Loading branch information
hlandau committed Apr 19, 2024
1 parent 08cc2f4 commit a0fbdcc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
22 changes: 8 additions & 14 deletions ssl/quic/quic_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions ssl/quic/quic_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions ssl/quic/quic_obj_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a0fbdcc

Please sign in to comment.