[master] d717b1b More trivial changes to use req->objcore instead of req->obj
Poul-Henning Kamp
phk at FreeBSD.org
Tue Aug 5 14:15:32 CEST 2014
commit d717b1bc803d9088c872213f9b3f801fb86b0f8e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Aug 5 12:14:58 2014 +0000
More trivial changes to use req->objcore instead of req->obj
diff --git a/bin/varnishd/cache/cache_http1_deliver.c b/bin/varnishd/cache/cache_http1_deliver.c
index 2817d09..83eb73d 100644
--- a/bin/varnishd/cache/cache_http1_deliver.c
+++ b/bin/varnishd/cache/cache_http1_deliver.c
@@ -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);
}
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 111e8c5..20225b5 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -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);
}
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index bc29e89..ed30dd0 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -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);
diff --git a/bin/varnishd/cache/cache_rfc2616.c b/bin/varnishd/cache/cache_rfc2616.c
index 1c26641..ab5edd7 100644
--- a/bin/varnishd/cache/cache_rfc2616.c
+++ b/bin/varnishd/cache/cache_rfc2616.c
@@ -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;
diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c
index edfa2a5..46f3e02 100644
--- a/bin/varnishd/cache/cache_vrt.c
+++ b/bin/varnishd/cache/cache_vrt.c
@@ -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,
More information about the varnish-commit
mailing list