[master] 7ab694ac4 Set up 'wrk->vsl' pointer for H/2 session thread

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Aug 30 08:31:07 UTC 2021


commit 7ab694ac4ebfb044add8cd402f8a08b8b9faacab
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 21b9a0e4e..f8f7ae755 100644
--- a/bin/varnishd/http2/cache_http2_session.c
+++ b/bin/varnishd/http2/cache_http2_session.c
@@ -360,10 +360,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));
@@ -432,6 +436,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