[6.2] 8998a1b20 Clear err_code and err_reason at start of request handling

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


commit 8998a1b20eb78750463b2cbe4937f056228c6f33
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 a310cd32b..ba503fa62 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -802,6 +802,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