diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-04-18 19:30:55 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-05-12 14:47:12 +0100 |
commit | a6b6ea17376572e3c0227b98f21dedc48215aa9a (patch) | |
tree | ab532445df770379e066e5a3e46ed588e7dba7e6 /test | |
parent | 5bd9ddd86e714705840215b8d2bbb0aedc598e96 (diff) |
QUIC TXP/CHANNEL: Generate MAX_STREAMS using RXFC
Though the RXFC was designed for stream flow control, its logic
is generic enough to use to control MAX_STREAMS generation.
Control of when _we_ can open streams is already done in a bespoke
fashion and doesn't use a TXFC, however (see
ossl_quic_stream_map_update_state).
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20765)
Diffstat (limited to 'test')
-rw-r--r-- | test/quic_txp_test.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/test/quic_txp_test.c b/test/quic_txp_test.c index 265c23fabc..dd85bb5692 100644 --- a/test/quic_txp_test.c +++ b/test/quic_txp_test.c @@ -47,6 +47,7 @@ struct helper { BIO *bio1, *bio2; QUIC_TXFC conn_txfc; QUIC_RXFC conn_rxfc, stream_rxfc; + QUIC_RXFC max_streams_bidi_rxfc, max_streams_uni_rxfc; OSSL_STATM statm; OSSL_CC_DATA *cc_data; const OSSL_CC_METHOD *cc_method; @@ -147,6 +148,17 @@ static int helper_init(struct helper *h) NULL))) goto err; + if (!TEST_true(ossl_quic_rxfc_init(&h->max_streams_bidi_rxfc, NULL, + 100, 100, + fake_now, + NULL))) + goto err; + + if (!TEST_true(ossl_quic_rxfc_init(&h->max_streams_uni_rxfc, NULL, + 100, 100, + fake_now, + NULL))) + if (!TEST_true(ossl_statm_init(&h->statm))) goto err; @@ -171,14 +183,16 @@ static int helper_init(struct helper *h) if (!TEST_ptr(h->args.crypto[i] = ossl_quic_sstream_new(4096))) goto err; - h->args.cur_scid = scid_1; - h->args.cur_dcid = dcid_1; - h->args.qsm = &h->qsm; - h->args.conn_txfc = &h->conn_txfc; - h->args.conn_rxfc = &h->conn_rxfc; - h->args.cc_method = h->cc_method; - h->args.cc_data = h->cc_data; - h->args.now = fake_now; + h->args.cur_scid = scid_1; + h->args.cur_dcid = dcid_1; + h->args.qsm = &h->qsm; + h->args.conn_txfc = &h->conn_txfc; + h->args.conn_rxfc = &h->conn_rxfc; + h->args.max_streams_bidi_rxfc = &h->max_streams_bidi_rxfc; + h->args.max_streams_uni_rxfc = &h->max_streams_uni_rxfc; + h->args.cc_method = h->cc_method; + h->args.cc_data = h->cc_data; + h->args.now = fake_now; if (!TEST_ptr(h->txp = ossl_quic_tx_packetiser_new(&h->args))) goto err; |