diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-04-18 19:30:56 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-05-12 14:47:13 +0100 |
commit | 9cacba434b027bc6f3a3f3c4255c2453935e5357 (patch) | |
tree | 244af72fc1efc6c6f0f82ae71263761498baacfb /ssl/quic/quic_fifd.c | |
parent | c3a04ea2fdd073e55b57e70e4f17f3ccbaa8c8a6 (diff) | |
download | openssl-new-9cacba434b027bc6f3a3f3c4255c2453935e5357.tar.gz |
QUIC FIFD: Add support for callback on frame ACK
We need to get acknowledgement notifications for our STOP_SENDING and
STREAM_RESET frames as this information is needed to know when we can
delete a QUIC_STREAM object.
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 'ssl/quic/quic_fifd.c')
-rw-r--r-- | ssl/quic/quic_fifd.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ssl/quic/quic_fifd.c b/ssl/quic/quic_fifd.c index ced7e31813..8eca7520df 100644 --- a/ssl/quic/quic_fifd.c +++ b/ssl/quic/quic_fifd.c @@ -27,6 +27,11 @@ int ossl_quic_fifd_init(QUIC_FIFD *fifd, QUIC_TXPIM_PKT *pkt, void *arg), void *regen_frame_arg, + void (*confirm_frame)(uint64_t frame_type, + uint64_t stream_id, + QUIC_TXPIM_PKT *pkt, + void *arg), + void *confirm_frame_arg, void (*sstream_updated)(uint64_t stream_id, void *arg), void *sstream_updated_arg) @@ -42,6 +47,8 @@ int ossl_quic_fifd_init(QUIC_FIFD *fifd, fifd->get_sstream_by_id_arg = get_sstream_by_id_arg; fifd->regen_frame = regen_frame; fifd->regen_frame_arg = regen_frame_arg; + fifd->confirm_frame = confirm_frame; + fifd->confirm_frame_arg = confirm_frame_arg; fifd->sstream_updated = sstream_updated; fifd->sstream_updated_arg = sstream_updated_arg; return 1; @@ -75,6 +82,16 @@ static void on_acked(void *arg) if (chunks[i].has_fin && chunks[i].stream_id != UINT64_MAX) ossl_quic_sstream_mark_acked_fin(sstream); + + if (chunks[i].has_stop_sending && chunks[i].stream_id != UINT64_MAX) + fifd->confirm_frame(OSSL_QUIC_FRAME_TYPE_STOP_SENDING, + chunks[i].stream_id, pkt, + fifd->confirm_frame_arg); + + if (chunks[i].has_reset_stream && chunks[i].stream_id != UINT64_MAX) + fifd->confirm_frame(OSSL_QUIC_FRAME_TYPE_RESET_STREAM, + chunks[i].stream_id, pkt, + fifd->confirm_frame_arg); } /* GCR */ |