From: Neil Horman Date: Fri, 13 Dec 2024 00:02:54 +0000 (-0500) Subject: Preserve fileprefix accross reuse in http3 demo server X-Git-Tag: openssl-3.5.0-alpha1~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66e1e60a61fd3b023790a10bc09359f68f50cfc4;p=thirdparty%2Fopenssl.git 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) --- 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)