From 6d5d5fc9a9f6b701fc5e17f05d3df464fe0bc56e Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Mon, 31 Oct 2022 14:39:13 +0000 Subject: 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 Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/19703) --- ssl/quic/quic_rstream.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ssl/quic/quic_rstream.c') diff --git a/ssl/quic/quic_rstream.c b/ssl/quic/quic_rstream.c index 9c4b8b716b..f8ad8b89de 100644 --- a/ssl/quic/quic_rstream.c +++ b/ssl/quic/quic_rstream.c @@ -17,7 +17,7 @@ struct quic_rstream_st { OSSL_STATM *statm; }; -QUIC_RSTREAM *ossl_quic_rstream_new(OSSL_QRX *qrx, QUIC_RXFC *rxfc, +QUIC_RSTREAM *ossl_quic_rstream_new(QUIC_RXFC *rxfc, OSSL_STATM *statm) { QUIC_RSTREAM *ret = OPENSSL_malloc(sizeof(*ret)); @@ -25,7 +25,7 @@ QUIC_RSTREAM *ossl_quic_rstream_new(OSSL_QRX *qrx, QUIC_RXFC *rxfc, if (ret == NULL) return NULL; - ossl_sframe_list_init(&ret->fl, qrx); + ossl_sframe_list_init(&ret->fl); ret->rxfc = rxfc; ret->statm = statm; return ret; @@ -37,7 +37,7 @@ void ossl_quic_rstream_free(QUIC_RSTREAM *qrs) OPENSSL_free(qrs); } -int ossl_quic_rstream_queue_data(QUIC_RSTREAM *qrs, OSSL_QRX_PKT_WRAP *pkt_wrap, +int ossl_quic_rstream_queue_data(QUIC_RSTREAM *qrs, OSSL_QRX_PKT *pkt, uint64_t offset, const unsigned char *data, uint64_t data_len, int fin) @@ -47,7 +47,7 @@ int ossl_quic_rstream_queue_data(QUIC_RSTREAM *qrs, OSSL_QRX_PKT_WRAP *pkt_wrap, range.start = offset; range.end = offset + data_len; - return ossl_sframe_list_insert(&qrs->fl, &range, pkt_wrap, data, fin); + return ossl_sframe_list_insert(&qrs->fl, &range, pkt, data, fin); } static int read_internal(QUIC_RSTREAM *qrs, unsigned char *buf, size_t size, -- cgit v1.2.3