Mailing List Archive

[master] 3e6048753 req: Don't reserve space for htc twice
commit 3e604875323e0c6a2ac635bf6fcb497ad47d9cfa
Author: Dridi Boukelmoune <dridi.boukelmoune@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));
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit