From: Hugo Landau Date: Tue, 18 Jul 2023 15:14:05 +0000 (+0100) Subject: QUIC TSERVER: Allow reading from a stream after connection termination X-Git-Tag: openssl-3.2.0-alpha1~349 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5904a0a71f5730c2f1e3028e092ea986b603081d;p=thirdparty%2Fopenssl.git QUIC TSERVER: Allow reading from a stream after connection termination Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/21484) --- diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c index 8dbe3da716d..e92a5d3353d 100644 --- a/ssl/quic/quic_tserver.c +++ b/ssl/quic/quic_tserver.c @@ -215,9 +215,6 @@ int ossl_quic_tserver_read(QUIC_TSERVER *srv, int is_fin = 0; QUIC_STREAM *qs; - if (!ossl_quic_channel_is_active(srv->ch)) - return 0; - qs = ossl_quic_stream_map_get_by_id(ossl_quic_channel_get_qsm(srv->ch), stream_id); if (qs == NULL) { @@ -227,10 +224,11 @@ int ossl_quic_tserver_read(QUIC_TSERVER *srv, /* * A client-initiated stream might spontaneously come into existence, so - * allow trying to read on a client-initiated stream before it exists. + * allow trying to read on a client-initiated stream before it exists, + * assuming the connection is still active. * Otherwise, fail. */ - if (!is_client_init) + if (!is_client_init || !ossl_quic_channel_is_active(srv->ch)) return 0; *bytes_read = 0;