From 4efd1a26822a05e900a9dcffc0d6554efece7923 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 9 Apr 2025 13:06:24 +0100 Subject: [PATCH] Prevent SSL_poll from reporting a stream as writeable if it isn't MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The CWM might prevent a stream from being writeable. We should not report a stream as writeable if there is no credit. Fixes #27312 Reviewed-by: Neil Horman Reviewed-by: Saša Nedvědický Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/27319) --- ssl/quic/quic_impl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 6e3de7d5050..847639b89e5 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -5106,6 +5106,8 @@ static int test_poll_event_w(QUIC_XSO *xso) && ossl_quic_stream_has_send_buffer(xso->stream) && ossl_quic_sstream_get_buffer_avail(xso->stream->sstream) && !ossl_quic_sstream_get_final_size(xso->stream->sstream, NULL) + && ossl_quic_txfc_get_cwm(&xso->stream->txfc) + > ossl_quic_sstream_get_cur_size(xso->stream->sstream) && quic_mutation_allowed(xso->conn, /*req_active=*/1); } -- 2.47.2