Commit 05aba583 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Inject another BOS_STATE, to tell if we have committed to action

in vcl_backend_response{}
parent 6cd9149a
...@@ -502,6 +502,7 @@ oc_getlru(const struct objcore *oc) ...@@ -502,6 +502,7 @@ oc_getlru(const struct objcore *oc)
enum busyobj_state_e { enum busyobj_state_e {
BOS_INVALID = 0, /* don't touch (yet) */ BOS_INVALID = 0, /* don't touch (yet) */
BOS_REQ_DONE, /* beresp.* can be examined */ BOS_REQ_DONE, /* beresp.* can be examined */
BOS_COMITTED, /* beresp.* can be examined */
BOS_FETCHING, /* beresp.* can be examined */ BOS_FETCHING, /* beresp.* can be examined */
BOS_FINISHED, /* object is complete */ BOS_FINISHED, /* object is complete */
BOS_FAILED, /* something went wrong */ BOS_FAILED, /* something went wrong */
......
...@@ -238,24 +238,25 @@ vbf_stp_fetchhdr(struct worker *wrk, struct busyobj *bo) ...@@ -238,24 +238,25 @@ vbf_stp_fetchhdr(struct worker *wrk, struct busyobj *bo)
VCL_backend_response_method(bo->vcl, wrk, NULL, bo, bo->beresp->ws); VCL_backend_response_method(bo->vcl, wrk, NULL, bo, bo->beresp->ws);
if (bo->do_esi)
bo->do_stream = 0;
if (bo->do_pass)
bo->fetch_objcore->flags |= OC_F_PASS;
if (wrk->handling == VCL_RET_DELIVER)
return (do_ims ? F_STP_CONDFETCH : F_STP_FETCH);
if (wrk->handling == VCL_RET_RETRY) { if (wrk->handling == VCL_RET_RETRY) {
assert(bo->state == BOS_REQ_DONE);
bo->retries++; bo->retries++;
if (bo->retries <= cache_param->max_retries) { if (bo->retries <= cache_param->max_retries) {
VDI_CloseFd(&bo->vbc); VDI_CloseFd(&bo->vbc);
return (F_STP_STARTFETCH); return (F_STP_STARTFETCH);
} }
// XXX: wrk->handling = VCL_RET_SYNTH; INCOMPL();
} }
INCOMPL(); if (bo->state == BOS_REQ_DONE)
VBO_setstate(bo, BOS_COMITTED);
if (bo->do_esi)
bo->do_stream = 0;
if (bo->do_pass)
bo->fetch_objcore->flags |= OC_F_PASS;
assert(wrk->handling == VCL_RET_DELIVER);
return (do_ims ? F_STP_CONDFETCH : F_STP_FETCH);
} }
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -454,7 +455,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo) ...@@ -454,7 +455,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
if (bo->do_stream) if (bo->do_stream)
HSH_Unbusy(&wrk->stats, obj->objcore); HSH_Unbusy(&wrk->stats, obj->objcore);
if (bo->state == BOS_REQ_DONE) if (bo->state == BOS_COMITTED)
VBO_setstate(bo, BOS_FETCHING); VBO_setstate(bo, BOS_FETCHING);
else if (bo->state != BOS_FAILED) else if (bo->state != BOS_FAILED)
WRONG("Wrong bo->state"); WRONG("Wrong bo->state");
......
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