From 66e1e60a61fd3b023790a10bc09359f68f50cfc4 Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Thu, 12 Dec 2024 19:02:54 -0500 Subject: [PATCH] Preserve fileprefix accross reuse in http3 demo server The fileprefix that we serve content from needs to be preserved accross h3ssl reuse. Make sure we restore it after zeroing the struct. Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26180) --- demos/http3/ossl-nghttp3-demo-server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demos/http3/ossl-nghttp3-demo-server.c b/demos/http3/ossl-nghttp3-demo-server.c index 3ee5fa8e75f..dcfd652ca2d 100644 --- a/demos/http3/ossl-nghttp3-demo-server.c +++ b/demos/http3/ossl-nghttp3-demo-server.c @@ -84,6 +84,7 @@ static void init_ids(struct h3ssl *h3ssl) { struct ssl_id *ssl_ids; int i; + char *prior_fileprefix = h3ssl->fileprefix; memset (h3ssl, 0, sizeof (struct h3ssl)); @@ -92,6 +93,9 @@ static void init_ids(struct h3ssl *h3ssl) ssl_ids[i].id = UINT64_MAX; } h3ssl->id_bidi = UINT64_MAX; + + /* restore the fileprefix */ + h3ssl->fileprefix = prior_fileprefix; } static void reuse_h3ssl(struct h3ssl *h3ssl) -- 2.47.2