[6.3] 99da6e40d Clear err_code and err_reason at start of request handling

Martin Blix Grydeland martin at varnish-software.com
Mon Oct 21 10:15:08 UTC 2019

commit 99da6e40df70824bb72854be96ea649659cd1920
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue Oct 1 11:17:17 2019 +0200

    Clear err_code and err_reason at start of request handling
    req->err_code and req->err_reason are set when going to synthetic
    handling. From there the resp.reason HTTP field is set from
    req->err_reason if set, or the generic code based on req->err_code is used
    if it was NULL. This patch clears these members so that a value from the
    handling of a previous request doesn't linger.
    Fixes: VSV00004

diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index a8ee9c61b..c6f4e7f3e 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -807,6 +807,8 @@ cnt_recv_prep(struct req *req, const char *ci)
 	req->is_hit = 0;
 	req->is_hitmiss = 0;
 	req->is_hitpass = 0;
+	req->err_code = 0;
+	req->err_reason = NULL;

More information about the varnish-commit mailing list