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