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

More trivial changes to use req->objcore instead of req->obj

parent 01ccb320
......@@ -235,7 +235,7 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
ssize_t l;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->obj->objcore, OBJCORE_MAGIC);
CHECK_OBJ_NOTNULL(req->objcore, OBJCORE_MAGIC);
req->res_mode = 0;
......@@ -251,7 +251,7 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
} else if (bo == NULL) {
/* XXX: Not happy with this convoluted test */
req->res_mode |= RES_LEN;
if (!(req->obj->objcore->flags & OC_F_PASS) ||
if (!(req->objcore->flags & OC_F_PASS) ||
req->obj->len != 0) {
http_Unset(req->resp, H_Content_Length);
http_PrintfHeader(req->resp,
......@@ -336,7 +336,7 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
ESI_Deliver(req);
} else if (req->res_mode & RES_ESI_CHILD && req->gzip_resp) {
l = -1;
while (req->obj->objcore->busyobj) {
while (req->objcore->busyobj) {
assert(bo != NULL);
l = VBO_waitlen(bo, l);
}
......
......@@ -397,8 +397,8 @@ pan_req(const struct req *req)
pan_vcl(req->vcl);
if (VALID_OBJ(req->obj, OBJECT_MAGIC)) {
if (req->obj->objcore->busyobj != NULL)
pan_busyobj(req->obj->objcore->busyobj);
if (req->objcore->busyobj != NULL)
pan_busyobj(req->objcore->busyobj);
pan_object("REQ", req->obj);
}
......
......@@ -95,14 +95,14 @@ cnt_deliver(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(req->objcore, OBJCORE_MAGIC);
CHECK_OBJ_NOTNULL(req->obj->objcore, OBJCORE_MAGIC);
assert(req->obj->objcore == req->objcore);
CHECK_OBJ_NOTNULL(req->obj->objcore->objhead, OBJHEAD_MAGIC);
CHECK_OBJ_NOTNULL(req->objcore->objhead, OBJHEAD_MAGIC);
CHECK_OBJ_NOTNULL(req->vcl, VCL_CONF_MAGIC);
assert(WRW_IsReleased(wrk));
assert(req->obj->objcore->refcnt > 0);
assert(req->objcore->refcnt > 0);
if (req->obj->objcore->exp_flags & OC_EF_EXP)
EXP_Touch(req->obj->objcore, req->t_prev);
if (req->objcore->exp_flags & OC_EF_EXP)
EXP_Touch(req->objcore, req->t_prev);
HTTP_Setup(req->resp, req->ws, req->vsl, SLT_RespMethod);
http_FilterResp(req->obj->http, req->resp, 0);
......@@ -111,7 +111,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
if (req->wrk->stats.cache_hit)
http_PrintfHeader(req->resp,
"X-Varnish: %u %u", VXID(req->vsl->wid),
VXID(ObjGetXID(req->obj->objcore, &wrk->stats)));
VXID(ObjGetXID(req->objcore, &wrk->stats)));
else
http_PrintfHeader(req->resp,
"X-Varnish: %u", VXID(req->vsl->wid));
......@@ -124,7 +124,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
age. Truncate to zero in that case).
*/
http_PrintfHeader(req->resp, "Age: %.0f",
fmax(0., req->t_prev - req->obj->objcore->exp.t_origin));
fmax(0., req->t_prev - req->objcore->exp.t_origin));
http_SetHeader(req->resp, "Via: 1.1 varnish-v4");
......@@ -140,7 +140,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
wrk->handling = VCL_RET_DELIVER;
if (wrk->handling != VCL_RET_DELIVER) {
assert(req->obj->objcore == req->objcore);
assert(req->objcore == req->objcore);
(void)HSH_DerefObjCore(&wrk->stats, &req->objcore);
req->obj = NULL;
http_Teardown(req->resp);
......@@ -161,7 +161,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
assert(wrk->handling == VCL_RET_DELIVER);
if (!(req->obj->objcore->flags & OC_F_PASS)
if (!(req->objcore->flags & OC_F_PASS)
&& req->esi_level == 0
&& http_GetStatus(req->obj->http) == 200
&& req->http->conds && RFC2616_Do_Cond(req)) {
......@@ -170,7 +170,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
}
/* Grab a ref to the bo if there is one, and hand it down */
bo = HSH_RefBusy(req->obj->objcore);
bo = HSH_RefBusy(req->objcore);
V1D_Deliver(req, bo);
if (bo != NULL)
VBO_DerefBusyObj(req->wrk, &bo);
......@@ -180,19 +180,19 @@ cnt_deliver(struct worker *wrk, struct req *req)
if (http_HdrIs(req->resp, H_Connection, "close"))
req->doclose = SC_RESP_CLOSE;
if (req->obj->objcore->flags & OC_F_PASS) {
if (req->objcore->flags & OC_F_PASS) {
/*
* No point in saving the body if it is hit-for-pass,
* but we can't yank it until the fetching thread has
* finished/abandoned also.
*/
while (req->obj->objcore->busyobj != NULL)
while (req->objcore->busyobj != NULL)
(void)usleep(100000);
STV_Freestore(req->obj);
}
assert(WRW_IsReleased(wrk));
VSLb(req->vsl, SLT_Debug, "XXX REF %d", req->obj->objcore->refcnt);
VSLb(req->vsl, SLT_Debug, "XXX REF %d", req->objcore->refcnt);
assert(req->obj->objcore == req->objcore);
(void)HSH_DerefObjCore(&wrk->stats, &req->objcore);
req->obj = NULL;
......@@ -409,7 +409,7 @@ cnt_lookup(struct worker *wrk, struct req *req)
/* Found a hit-for-pass */
VSLb(req->vsl, SLT_Debug, "XXXX HIT-FOR-PASS");
VSLb(req->vsl, SLT_HitPass, "%u",
VXID(ObjGetXID(req->obj->objcore, &wrk->stats)));
VXID(ObjGetXID(req->objcore, &wrk->stats)));
AZ(boc);
assert(req->obj->objcore == req->objcore);
(void)HSH_DerefObjCore(&wrk->stats, &req->objcore);
......@@ -423,7 +423,7 @@ cnt_lookup(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
VSLb(req->vsl, SLT_Hit, "%u",
VXID(ObjGetXID(req->obj->objcore, &wrk->stats)));
VXID(ObjGetXID(req->objcore, &wrk->stats)));
VCL_hit_method(req->vcl, wrk, req, NULL, req->http->ws);
......
......@@ -355,7 +355,7 @@ RFC2616_Do_Cond(const struct req *req)
ims = VTIM_parse(p);
if (ims > req->t_req) /* [RFC2616 14.25] */
return (0);
lm = ObjGetLastModified(req->obj->objcore, &req->wrk->stats);
lm = ObjGetLastModified(req->objcore, &req->wrk->stats);
if (lm > ims)
return (0);
do_cond = 1;
......
......@@ -500,7 +500,7 @@ VRT_purge(const struct vrt_ctx *ctx, double ttl, double grace, double keep)
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(ctx->req->wrk, WORKER_MAGIC);
if (ctx->method == VCL_MET_HIT)
HSH_Purge(ctx->req->wrk, ctx->req->obj->objcore->objhead,
HSH_Purge(ctx->req->wrk, ctx->req->objcore->objhead,
ttl, grace, keep);
else if (ctx->method == VCL_MET_MISS)
HSH_Purge(ctx->req->wrk, ctx->req->objcore->objhead,
......
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