]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Preserve fileprefix accross reuse in http3 demo server
authorNeil Horman <nhorman@openssl.org>
Fri, 13 Dec 2024 00:02:54 +0000 (19:02 -0500)
committerNeil Horman <nhorman@openssl.org>
Mon, 17 Feb 2025 16:27:33 +0000 (11:27 -0500)
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 <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26180)

demos/http3/ossl-nghttp3-demo-server.c

index 3ee5fa8e75f722d6ca841bdd1a3edb53da504d66..dcfd652ca2de2d8a4acf35fa5692539b009eec8a 100644 (file)
@@ -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)