[master] 3e6048753 req: Don't reserve space for htc twice

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Jan 4 17:45:06 UTC 2022


commit 3e604875323e0c6a2ac635bf6fcb497ad47d9cfa
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Jan 4 18:34:05 2022 +0100

    req: Don't reserve space for htc twice
    
    When struct req changed to no longer store its htc, which was somewhat
    hidden in a larger seemingly unrelated change, it ended up being
    reserved twice. This looks like a case of starting something, being
    interrupted, and starting again.
    
    I decided to remove the one sitting between the reservation of VDP and
    VFP contexts since the two are related, and this reservation didn't even
    initialize htc.
    
    Refs fee476acc085e6563225d35fd8e19f1b10f04139

diff --git a/bin/varnishd/cache/cache_req.c b/bin/varnishd/cache/cache_req.c
index 844e51b5a..c5a394ef9 100644
--- a/bin/varnishd/cache/cache_req.c
+++ b/bin/varnishd/cache/cache_req.c
@@ -153,14 +153,11 @@ Req_New(struct sess *sp)
 	INIT_OBJ(req->vfc, VFP_CTX_MAGIC);
 	p = (void*)PRNDUP(p + sizeof(*req->vfc));
 
-	req->htc = (void*)p;				// XXX: TWICE ?!
-	p = (void*)PRNDUP(p + sizeof(*req->htc));
-
 	req->vdc = (void*)p;
 	memset(req->vdc, 0, sizeof *req->vdc);
 	p = (void*)PRNDUP(p + sizeof(*req->vdc));
 
-	req->htc = (void*)p;				// XXX: TWICE ?!
+	req->htc = (void*)p;
 	INIT_OBJ(req->htc, HTTP_CONN_MAGIC);
 	req->htc->doclose = SC_NULL;
 	p = (void*)PRNDUP(p + sizeof(*req->htc));


More information about the varnish-commit mailing list