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 | 9aaafc26e0f301fe07d7141dc4a575ef9a4eb4d9 (patch) | |
tree | a8b616014008700bbf055eefbf8a1b9820074516 /ssl | |
parent | 0847e63ee5d58d824390aadcbcf10281c45900c4 (diff) |
QUIC APL: Send STOP_SENDING/RESET_STREAM when XSO is freed
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')
-rw-r--r-- | ssl/quic/quic_impl.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index fbcc85e52a..d74ed36256 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -354,15 +354,20 @@ void ossl_quic_free(SSL *s) assert(ctx.qc->num_xso > 0); --ctx.qc->num_xso; - ctx.xso->stream->deleted = 1; + /* If a stream's send part has not been finished, auto-reset it. */ + if (ctx.xso->stream->sstream != NULL + && !ossl_quic_sstream_get_final_size(ctx.xso->stream->sstream, NULL)) + ossl_quic_stream_map_reset_stream_send_part(ossl_quic_channel_get_qsm(ctx.qc->ch), + ctx.xso->stream, 0); - /* Auto-conclude stream. */ - /* TODO(QUIC): Do RESET_STREAM here instead of auto-conclude */ - if (ctx.xso->stream->sstream != NULL) - ossl_quic_sstream_fin(ctx.xso->stream->sstream); + /* Do STOP_SENDING for the receive part, if applicable. */ + if (ctx.xso->stream->rstream != NULL) + ossl_quic_stream_map_stop_sending_recv_part(ossl_quic_channel_get_qsm(ctx.qc->ch), + ctx.xso->stream, 0); /* Update stream state. */ - ossl_quic_stream_map_update_state(ossl_quic_channel_get_qsm(ctx.xso->conn->ch), + ctx.xso->stream->deleted = 1; + ossl_quic_stream_map_update_state(ossl_quic_channel_get_qsm(ctx.qc->ch), ctx.xso->stream); quic_unlock(ctx.qc); |