[6.0] a1049d93a Set up 'wrk->vsl' pointer for H/2 session thread

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Oct 18 09:21:07 UTC 2023


commit a1049d93a9db8585c36a30e61442d2bc38f3c43e
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Wed Aug 11 17:13:59 2021 +0200

    Set up 'wrk->vsl' pointer for H/2 session thread
    
    The H/2 session thread does have a VSL buffer already set up, but the
    'wrk->vsl' pointer was not set. This caused issue for e.g. LRU_NukeOne()
    as it wants to log. Set the buffer for the duration that the worker is
    dedicated as an H/2 session thread.

diff --git a/bin/varnishd/http2/cache_http2_session.c b/bin/varnishd/http2/cache_http2_session.c
index 9f803d1b4..8665761c3 100644
--- a/bin/varnishd/http2/cache_http2_session.c
+++ b/bin/varnishd/http2/cache_http2_session.c
@@ -361,10 +361,14 @@ h2_new_session(struct worker *wrk, void *arg)
 	AZ(h2->htc->priv);
 	h2->htc->priv = h2;
 
+	AZ(wrk->vsl);
+	wrk->vsl = h2->vsl;
+
 	if (req->err_code == H2_OU_MARKER && !h2_ou_session(wrk, h2, req)) {
 		assert(h2->refcnt == 1);
 		h2_del_req(wrk, h2->req0);
 		h2_del_sess(wrk, h2, SC_RX_JUNK);
+		wrk->vsl = NULL;
 		return;
 	}
 	assert(HTC_S_COMPLETE == H2_prism_complete(h2->htc));
@@ -435,6 +439,7 @@ h2_new_session(struct worker *wrk, void *arg)
 	assert(h2->refcnt == 1);
 	h2_del_req(wrk, h2->req0);
 	h2_del_sess(wrk, h2, h2->error->reason);
+	wrk->vsl = NULL;
 }
 
 struct transport H2_transport = {


More information about the varnish-commit mailing list