QUIC QSM: Allow QSM to know if we are in the server role

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20856)
This commit is contained in:
Hugo Landau 2023-04-28 16:56:34 +01:00
parent fca44cfc1c
commit 5915a900af
4 changed files with 10 additions and 5 deletions

View File

@ -255,6 +255,7 @@ typedef struct quic_stream_map_st {
void *get_stream_limit_cb_arg;
QUIC_RXFC *max_streams_bidi_rxfc;
QUIC_RXFC *max_streams_uni_rxfc;
int is_server;
} QUIC_STREAM_MAP;
/*
@ -274,7 +275,8 @@ int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm,
uint64_t (*get_stream_limit_cb)(int uni, void *arg),
void *get_stream_limit_cb_arg,
QUIC_RXFC *max_streams_bidi_rxfc,
QUIC_RXFC *max_streams_uni_rxfc);
QUIC_RXFC *max_streams_uni_rxfc,
int is_server);
/*
* Any streams still in the map will be released as though

View File

@ -186,7 +186,8 @@ static int ch_init(QUIC_CHANNEL *ch)
if (!ossl_quic_stream_map_init(&ch->qsm, get_stream_limit, ch,
&ch->max_streams_bidi_rxfc,
&ch->max_streams_uni_rxfc))
&ch->max_streams_uni_rxfc,
ch->is_server))
goto err;
ch->have_qsm = 1;
@ -2426,7 +2427,6 @@ QUIC_STREAM *ossl_quic_channel_new_stream_local(QUIC_CHANNEL *ch, int is_uni)
if (!ch_init_new_stream(ch, qs, /*can_send=*/1, /*can_recv=*/!is_uni))
goto err;
++*p_next_ordinal;
return qs;

View File

@ -89,7 +89,8 @@ int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm,
uint64_t (*get_stream_limit_cb)(int uni, void *arg),
void *get_stream_limit_cb_arg,
QUIC_RXFC *max_streams_bidi_rxfc,
QUIC_RXFC *max_streams_uni_rxfc)
QUIC_RXFC *max_streams_uni_rxfc,
int is_server)
{
qsm->map = lh_QUIC_STREAM_new(hash_stream, cmp_stream);
qsm->active_list.prev = qsm->active_list.next = &qsm->active_list;
@ -105,6 +106,7 @@ int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm,
qsm->get_stream_limit_cb_arg = get_stream_limit_cb_arg;
qsm->max_streams_bidi_rxfc = max_streams_bidi_rxfc;
qsm->max_streams_uni_rxfc = max_streams_uni_rxfc;
qsm->is_server = is_server;
return 1;
}

View File

@ -176,7 +176,8 @@ static int helper_init(struct helper *h)
if (!TEST_true(ossl_quic_stream_map_init(&h->qsm, NULL, NULL,
&h->max_streams_bidi_rxfc,
&h->max_streams_uni_rxfc)))
&h->max_streams_uni_rxfc,
/*is_server=*/0)))
goto err;
h->have_qsm = 1;