From 76af88a6218f6f4ed23cc38bcbc6a723fa74816c Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 9 Oct 2024 11:31:46 +0100 Subject: [PATCH] Use the reactor from ctx.obj for net read/write desired implementations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The ossl_quic_get_net_write_desired() and ossl_quic_reactor_net_read_desired() implementations can be used by listeners. But in that case there is no ctx.qc object present. Instead we should use the reactor from ctx.obj which will work also for a listener. Reviewed-by: Tomas Mraz Reviewed-by: Saša Nedvědický (Merged from https://github.com/openssl/openssl/pull/25642) --- ssl/quic/quic_impl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 825fd4c4737..3d05acff2bd 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -1380,7 +1380,7 @@ int ossl_quic_get_net_read_desired(SSL *s) return 0; qctx_lock(&ctx); - ret = ossl_quic_reactor_net_read_desired(ossl_quic_channel_get_reactor(ctx.qc->ch)); + ret = ossl_quic_reactor_net_read_desired(ossl_quic_obj_get0_reactor(ctx.obj)); qctx_unlock(&ctx); return ret; } @@ -1396,7 +1396,7 @@ int ossl_quic_get_net_write_desired(SSL *s) return 0; qctx_lock(&ctx); - ret = ossl_quic_reactor_net_write_desired(ossl_quic_channel_get_reactor(ctx.qc->ch)); + ret = ossl_quic_reactor_net_write_desired(ossl_quic_obj_get0_reactor(ctx.obj)); qctx_unlock(&ctx); return ret; } -- 2.47.2