mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
QUIC QSM: Allow bidi and uni incoming streams to be tracked separately
Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23495)
This commit is contained in:
parent
ab05f13ced
commit
a5d16ac371
@ -520,7 +520,7 @@ struct quic_stream_map_st {
|
||||
QUIC_STREAM_LIST_NODE accept_list;
|
||||
QUIC_STREAM_LIST_NODE ready_for_gc_list;
|
||||
size_t rr_stepping, rr_counter;
|
||||
size_t num_accept, num_shutdown_flush;
|
||||
size_t num_accept_bidi, num_accept_uni, num_shutdown_flush;
|
||||
QUIC_STREAM *rr_cur;
|
||||
uint64_t (*get_stream_limit_cb)(int uni, void *arg);
|
||||
void *get_stream_limit_cb_arg;
|
||||
@ -806,8 +806,11 @@ void ossl_quic_stream_map_remove_from_accept_queue(QUIC_STREAM_MAP *qsm,
|
||||
QUIC_STREAM *s,
|
||||
OSSL_TIME rtt);
|
||||
|
||||
/* Returns the length of the accept queue. */
|
||||
size_t ossl_quic_stream_map_get_accept_queue_len(QUIC_STREAM_MAP *qsm);
|
||||
/* Returns the length of the accept queue for the given stream type. */
|
||||
size_t ossl_quic_stream_map_get_accept_queue_len(QUIC_STREAM_MAP *qsm, int is_uni);
|
||||
|
||||
/* Returns the total length of the accept queues for all stream types. */
|
||||
size_t ossl_quic_stream_map_get_total_accept_queue_len(QUIC_STREAM_MAP *qsm);
|
||||
|
||||
/*
|
||||
* Shutdown Flush and GC
|
||||
|
@ -103,7 +103,8 @@ int ossl_quic_stream_map_init(QUIC_STREAM_MAP *qsm,
|
||||
qsm->rr_counter = 0;
|
||||
qsm->rr_cur = NULL;
|
||||
|
||||
qsm->num_accept = 0;
|
||||
qsm->num_accept_bidi = 0;
|
||||
qsm->num_accept_uni = 0;
|
||||
qsm->num_shutdown_flush = 0;
|
||||
|
||||
qsm->get_stream_limit_cb = get_stream_limit_cb;
|
||||
@ -737,7 +738,10 @@ void ossl_quic_stream_map_push_accept_queue(QUIC_STREAM_MAP *qsm,
|
||||
QUIC_STREAM *s)
|
||||
{
|
||||
list_insert_tail(&qsm->accept_list, &s->accept_node);
|
||||
++qsm->num_accept;
|
||||
if (ossl_quic_stream_is_bidi(s))
|
||||
++qsm->num_accept_bidi;
|
||||
else
|
||||
++qsm->num_accept_uni;
|
||||
}
|
||||
|
||||
static QUIC_RXFC *qsm_get_max_streams_rxfc(QUIC_STREAM_MAP *qsm, QUIC_STREAM *s)
|
||||
@ -754,15 +758,24 @@ void ossl_quic_stream_map_remove_from_accept_queue(QUIC_STREAM_MAP *qsm,
|
||||
QUIC_RXFC *max_streams_rxfc;
|
||||
|
||||
list_remove(&qsm->accept_list, &s->accept_node);
|
||||
--qsm->num_accept;
|
||||
if (ossl_quic_stream_is_bidi(s))
|
||||
--qsm->num_accept_bidi;
|
||||
else
|
||||
--qsm->num_accept_uni;
|
||||
|
||||
if ((max_streams_rxfc = qsm_get_max_streams_rxfc(qsm, s)) != NULL)
|
||||
ossl_quic_rxfc_on_retire(max_streams_rxfc, 1, rtt);
|
||||
}
|
||||
|
||||
size_t ossl_quic_stream_map_get_accept_queue_len(QUIC_STREAM_MAP *qsm)
|
||||
size_t ossl_quic_stream_map_get_accept_queue_len(QUIC_STREAM_MAP *qsm, int is_uni)
|
||||
{
|
||||
return qsm->num_accept;
|
||||
return is_uni ? qsm->num_accept_uni : qsm->num_accept_bidi;
|
||||
}
|
||||
|
||||
size_t ossl_quic_stream_map_get_total_accept_queue_len(QUIC_STREAM_MAP *qsm)
|
||||
{
|
||||
return ossl_quic_stream_map_get_accept_queue_len(qsm, /*is_uni=*/0)
|
||||
+ ossl_quic_stream_map_get_accept_queue_len(qsm, /*is_uni=*/1);
|
||||
}
|
||||
|
||||
void ossl_quic_stream_map_gc(QUIC_STREAM_MAP *qsm)
|
||||
|
Loading…
Reference in New Issue
Block a user