Commit c709e110 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Polish the stale_oc management a little bit.

parent 7c593da1
...@@ -185,6 +185,7 @@ VBO_DerefBusyObj(struct worker *wrk, struct busyobj **pbo) ...@@ -185,6 +185,7 @@ VBO_DerefBusyObj(struct worker *wrk, struct busyobj **pbo)
return; return;
AZ(bo->htc); AZ(bo->htc);
AZ(bo->stale_oc);
VRTPRIV_dynamic_kill(bo->privs, (uintptr_t)bo); VRTPRIV_dynamic_kill(bo->privs, (uintptr_t)bo);
assert(VTAILQ_EMPTY(&bo->privs->privs)); assert(VTAILQ_EMPTY(&bo->privs->privs));
......
...@@ -186,8 +186,7 @@ vbf_stp_mkbereq(const struct worker *wrk, struct busyobj *bo) ...@@ -186,8 +186,7 @@ vbf_stp_mkbereq(const struct worker *wrk, struct busyobj *bo)
} else } else
AZ(bo->stale_oc); AZ(bo->stale_oc);
if (bo->stale_oc != NULL && if (bo->stale_oc != NULL) {
ObjCheckFlag(bo->wrk, bo->stale_oc, OF_IMSCAND)) {
q = HTTP_GetHdrPack(bo->wrk, bo->stale_oc, H_Last_Modified); q = HTTP_GetHdrPack(bo->wrk, bo->stale_oc, H_Last_Modified);
if (q != NULL) if (q != NULL)
http_PrintfHeader(bo->bereq0, http_PrintfHeader(bo->bereq0,
...@@ -394,8 +393,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo) ...@@ -394,8 +393,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
AZ(bo->was_304); AZ(bo->was_304);
if (http_IsStatus(bo->beresp, 304)) { if (http_IsStatus(bo->beresp, 304)) {
if (bo->stale_oc != NULL && if (bo->stale_oc != NULL) {
ObjCheckFlag(bo->wrk, bo->stale_oc, OF_IMSCAND)) {
if (ObjCheckFlag(bo->wrk, bo->stale_oc, OF_CHGGZIP)) { if (ObjCheckFlag(bo->wrk, bo->stale_oc, OF_CHGGZIP)) {
/* /*
* If we changed the gzip status of the object * If we changed the gzip status of the object
...@@ -906,6 +904,13 @@ vbf_fetch_thread(struct worker *wrk, void *priv) ...@@ -906,6 +904,13 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
bo->wrk = wrk; bo->wrk = wrk;
wrk->vsl = bo->vsl; wrk->vsl = bo->vsl;
if (bo->stale_oc != NULL) {
CHECK_OBJ_NOTNULL(bo->stale_oc, OBJCORE_MAGIC);
/* We don't want the oc/stevedore ops in fetching thread */
if (!ObjCheckFlag(wrk, bo->stale_oc, OF_IMSCAND))
(void)HSH_DerefObjCore(wrk, &bo->stale_oc);
}
while (stp != F_STP_DONE) { while (stp != F_STP_DONE) {
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
assert(bo->refcount >= 1); assert(bo->refcount >= 1);
...@@ -937,7 +942,6 @@ vbf_fetch_thread(struct worker *wrk, void *priv) ...@@ -937,7 +942,6 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
if (bo->stale_oc != NULL) if (bo->stale_oc != NULL)
(void)HSH_DerefObjCore(wrk, &bo->stale_oc); (void)HSH_DerefObjCore(wrk, &bo->stale_oc);
wrk->vsl = NULL; wrk->vsl = NULL;
VBO_DerefBusyObj(wrk, &bo); VBO_DerefBusyObj(wrk, &bo);
THR_SetBusyobj(NULL); THR_SetBusyobj(NULL);
......
...@@ -60,7 +60,7 @@ cnt_vdp(struct req *req, struct busyobj *bo) ...@@ -60,7 +60,7 @@ cnt_vdp(struct req *req, struct busyobj *bo)
resp_len = http_GetContentLength(req->resp); resp_len = http_GetContentLength(req->resp);
if (bo != NULL) if (bo != NULL)
req->resp_len = resp_len; req->resp_len = resp_len;
else else
req->resp_len = ObjGetLen(req->wrk, req->objcore); req->resp_len = ObjGetLen(req->wrk, req->objcore);
req->res_mode = 0; req->res_mode = 0;
......
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