From 93f806bedb0d52fe1a0fdf6fd192c2d558c26c3e Mon Sep 17 00:00:00 2001 From: Walid Boudebouda Date: Thu, 19 Dec 2024 15:56:37 +0100 Subject: [PATCH 1/2] H2: Turn condition check into assert We should never be scheduled when on H2_S_CLOSED state. --- bin/varnishd/http2/cache_http2_proto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c index 9a514e88b3b..c3800ded818 100644 --- a/bin/varnishd/http2/cache_http2_proto.c +++ b/bin/varnishd/http2/cache_http2_proto.c @@ -1415,8 +1415,8 @@ h2_sweep(struct worker *wrk, struct h2_sess *h2) } switch (r2->state) { case H2_S_CLOSED: - if (!r2->scheduled) - h2_del_req(wrk, r2); + AZ(r2->scheduled); + h2_del_req(wrk, r2); break; case H2_S_CLOS_REM: if (!r2->scheduled) { From df7d3acb0d81cfb18715b772053107daf7209fd1 Mon Sep 17 00:00:00 2001 From: Walid Boudebouda Date: Thu, 19 Dec 2024 16:31:17 +0100 Subject: [PATCH 2/2] H2: Log H2 upgrade to the session vsl instead of the 0 vxid For PU upgrade, at the time of this log, the req->vsl is not assigned a vxid yet, and thus the line would be logged for vxid 0, which doen't make much sense. In all cases, it is better to log it on the sess vsl instead. Noticed while reading a vtc output. --- bin/varnishd/http2/cache_http2_session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/varnishd/http2/cache_http2_session.c b/bin/varnishd/http2/cache_http2_session.c index 0e5db7b3df4..075cba18388 100644 --- a/bin/varnishd/http2/cache_http2_session.c +++ b/bin/varnishd/http2/cache_http2_session.c @@ -350,7 +350,7 @@ h2_ou_session(struct worker *wrk, struct h2_sess *h2, void H2_PU_Sess(struct worker *wrk, struct sess *sp, struct req *req) { - VSLb(req->vsl, SLT_Debug, "H2 Prior Knowledge Upgrade"); + VSL(SLT_Debug, sp->vxid, "H2 Prior Knowledge Upgrade"); req->err_code = H2_PU_MARKER; SES_SetTransport(wrk, sp, req, &HTTP2_transport); } @@ -358,7 +358,7 @@ H2_PU_Sess(struct worker *wrk, struct sess *sp, struct req *req) void H2_OU_Sess(struct worker *wrk, struct sess *sp, struct req *req) { - VSLb(req->vsl, SLT_Debug, "H2 Optimistic Upgrade"); + VSL(SLT_Debug, sp->vxid, "H2 Optimistic Upgrade"); req->err_code = H2_OU_MARKER; SES_SetTransport(wrk, sp, req, &HTTP2_transport); }