[6.0] 83849e018 Clear err_code and err_reason at start of request handling

Martin Blix Grydeland martin at varnish-software.com
Mon Oct 21 11:29:07 UTC 2019

commit 83849e018f22fe0acbf6fc17bc513afaf60749bd
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 c01d45715..0f32f38c3 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -835,6 +835,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;
  * We have a complete request, set everything up and start it.

More information about the varnish-commit mailing list