aboutsummaryrefslogtreecommitdiff
path: root/test/quic_record_test.c
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2022-10-31 14:39:13 +0000
committerHugo Landau <hlandau@openssl.org>2023-01-13 13:20:10 +0000
commit6d5d5fc9a9f6b701fc5e17f05d3df464fe0bc56e (patch)
treef8472a74275baaa0618ba6a11707c906be25cbe3 /test/quic_record_test.c
parentf71ae05a4d22d52780fc7cfc7e60710b74fd3dd7 (diff)
downloadopenssl-6d5d5fc9a9f6b701fc5e17f05d3df464fe0bc56e.zip
openssl-6d5d5fc9a9f6b701fc5e17f05d3df464fe0bc56e.tar.gz
openssl-6d5d5fc9a9f6b701fc5e17f05d3df464fe0bc56e.tar.bz2
QUIC RX: Support refcounted packets and eliminate wrapper
Previously, the QRX filled in a OSSL_QRX_PKT structure provided by the caller. This necessitated the caller managing reference counting itself using a OSSL_QRX_PKT_WRAP structure. The need for this structure has been eliminated by adding refcounting support to the QRX itself. The QRX now outputs a pointer to an OSSL_QRX_PKT instead of filling in a structure provided by the caller. The OSSL_QRX_PKT_WRAP structure has been eliminated. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19703)
Diffstat (limited to 'test/quic_record_test.c')
-rw-r--r--test/quic_record_test.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/quic_record_test.c b/test/quic_record_test.c
index c6ac10d..5aab728 100644
--- a/test/quic_record_test.c
+++ b/test/quic_record_test.c
@@ -1791,7 +1791,7 @@ static int rx_run_script(const struct rx_test_op *script)
int testresult = 0, pkt_outstanding = 0;
struct rx_state s = {0};
size_t i;
- OSSL_QRX_PKT pkt = {0};
+ OSSL_QRX_PKT *pkt = NULL;
const struct rx_test_op *op = script;
for (; op->op != RX_TEST_OP_END; ++op)
@@ -1850,14 +1850,14 @@ static int rx_run_script(const struct rx_test_op *script)
goto err;
pkt_outstanding = 1;
- if (!TEST_ptr(pkt.hdr))
+ if (!TEST_ptr(pkt) || !TEST_ptr(pkt->hdr))
goto err;
- if (!TEST_mem_eq(pkt.hdr->data, pkt.hdr->len,
+ if (!TEST_mem_eq(pkt->hdr->data, pkt->hdr->len,
op->buf, op->buf_len))
goto err;
- if (!TEST_true(cmp_pkt_hdr(pkt.hdr, op->hdr,
+ if (!TEST_true(cmp_pkt_hdr(pkt->hdr, op->hdr,
op->buf, op->buf_len, 1)))
goto err;
@@ -1866,19 +1866,19 @@ static int rx_run_script(const struct rx_test_op *script)
if (!TEST_true(rx_state_ensure_for_frames(&s)))
goto err;
pkt_outstanding = 0;
- if (!TEST_true(ossl_quic_handle_frames(s.quic_conn, &pkt)))
+ if (!TEST_true(ossl_quic_handle_frames(s.quic_conn, pkt)))
goto err;
break;
case RX_TEST_OP_CHECK_PKT_FRAMES_INVALID:
if (!TEST_true(rx_state_ensure_for_frames(&s)))
goto err;
pkt_outstanding = 0;
- if (!TEST_false(ossl_quic_handle_frames(s.quic_conn, &pkt)))
+ if (!TEST_false(ossl_quic_handle_frames(s.quic_conn, pkt)))
goto err;
break;
default:
pkt_outstanding = 0;
- ossl_qrx_release_pkt(s.qrx, pkt.handle);
+ ossl_qrx_pkt_release(pkt);
break;
}
break;
@@ -1920,7 +1920,7 @@ static int rx_run_script(const struct rx_test_op *script)
testresult = 1;
err:
if (pkt_outstanding)
- ossl_qrx_release_pkt(s.qrx, pkt.handle);
+ ossl_qrx_pkt_release(pkt);
rx_state_teardown(&s);
return testresult;
}