Commit e89cd5f6 authored by Steven's avatar Steven Committed by Nils Goroll

Clear the status and response on a retry

The bo fields err_code and err_reason need to be reset on a retry otherwise the values are kept.

Fixes #3525
parent b559b6b2
......@@ -331,6 +331,8 @@ vbf_stp_retry(struct worker *wrk, struct busyobj *bo)
bo->do_esi = 0;
bo->do_stream = 1;
bo->was_304 = 0;
bo->err_code = 0;
bo->err_reason = NULL;
// XXX: BereqEnd + BereqAcct ?
VSL_ChgId(bo->vsl, "bereq", "retry", VXID_Get(wrk, VSL_BACKENDMARKER));
......
varnishtest "Clear beresp status and reason on a retry"
server s1 {
rxreq
txresp -status 500 -reason "my reason"
} -start
varnish v1 -arg "-p first_byte_timeout=0.2" -vcl+backend {
sub vcl_backend_response {
return (error(beresp.status, beresp.reason));
}
sub vcl_backend_error {
if (bereq.retries == 0) {
return (retry);
}
}
} -start
client c1 {
txreq
rxresp
expect resp.status == 503
expect resp.reason == "Backend fetch failed"
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment