summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-11-13 14:16:57 +0000
committerTomas Mraz <tomas@openssl.org>2023-11-15 11:04:02 +0100
commit915ec623eca7b413db6f54ec4aa64585e81ac4df (patch)
tree1456a7ad9961669567c63e7c2e319993fc77d506 /test
parent1b83adc065130fcea913b4f7b1e13176d4aa1074 (diff)
Keep track of connection credit as we add stream data
If a single packet contains data from multiple streams we need to keep track of the cummulative connection level credit consumed across all of the streams. Once the connection level credit has been consumed we must stop adding stream data. Fixes #22706 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22718) (cherry picked from commit e57bf6b3bfa2f0b18e5cad7fd3c5fdd7c51516b9)
Diffstat (limited to 'test')
-rw-r--r--test/quic_fc_test.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/quic_fc_test.c b/test/quic_fc_test.c
index e624d81b73..d279766756 100644
--- a/test/quic_fc_test.c
+++ b/test/quic_fc_test.c
@@ -37,10 +37,10 @@ static int test_txfc(int is_stream)
if (!TEST_uint64_t_eq(ossl_quic_txfc_get_cwm(txfc), 2000))
goto err;
- if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc), 2000))
+ if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc, 0), 2000))
goto err;
- if (is_stream && !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc),
+ if (is_stream && !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc, 0),
2000))
goto err;
@@ -50,10 +50,10 @@ static int test_txfc(int is_stream)
if (!TEST_true(ossl_quic_txfc_consume_credit(txfc, 500)))
goto err;
- if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc), 1500))
+ if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc, 0), 1500))
goto err;
- if (is_stream && !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc),
+ if (is_stream && !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc, 0),
1500))
goto err;
@@ -69,10 +69,10 @@ static int test_txfc(int is_stream)
if (!TEST_uint64_t_eq(ossl_quic_txfc_get_swm(txfc), 600))
goto err;
- if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc), 1400))
+ if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc, 0), 1400))
goto err;
- if (is_stream && !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc),
+ if (is_stream && !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc, 0),
1400))
goto err;
@@ -82,10 +82,10 @@ static int test_txfc(int is_stream)
if (!TEST_true(ossl_quic_txfc_consume_credit(txfc, 1400)))
goto err;
- if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc), 0))
+ if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc, 0), 0))
goto err;
- if (is_stream && !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc),
+ if (is_stream && !TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc, 0),
0))
goto err;
@@ -131,7 +131,7 @@ static int test_txfc(int is_stream)
if (!TEST_uint64_t_eq(ossl_quic_txfc_get_swm(txfc), 2000))
goto err;
- if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc), 500))
+ if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit_local(txfc, 0), 500))
goto err;
if (is_stream)
@@ -144,7 +144,7 @@ static int test_txfc(int is_stream)
if (!TEST_false(ossl_quic_txfc_has_become_blocked(txfc, 0)))
goto err;
- if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc), 1))
+ if (!TEST_uint64_t_eq(ossl_quic_txfc_get_credit(txfc, 0), 1))
goto err;
if (!TEST_true(ossl_quic_txfc_consume_credit(txfc, 1)))