Commit 5cd69e08 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Eliminate obj arg to FetchBody()

Mostly by:	martin
parent 5c9d66ce
......@@ -748,7 +748,7 @@ struct storage *FetchStorage(struct busyobj *, ssize_t sz);
int FetchError(struct busyobj *, const char *error);
int FetchError2(struct busyobj *, const char *error, const char *more);
int FetchHdr(struct sess *sp, int need_host_hdr, int sendbody);
int FetchBody(struct worker *w, struct busyobj *bo, struct object *obj);
int FetchBody(struct worker *w, struct busyobj *bo);
int FetchReqBody(const struct sess *sp, int sendbody);
void Fetch_Init(void);
......
......@@ -830,8 +830,10 @@ cnt_prepfetch(struct sess *sp, struct worker *wrk, struct req *req)
req->storage_hint = NULL;
if (bo->do_gzip ||
(bo->is_gzip && !bo->do_gunzip))
AZ(bo->fetch_obj);
bo->fetch_obj = req->obj;
if (bo->do_gzip || (bo->is_gzip && !bo->do_gunzip))
req->obj->gziped = 1;
if (vary != NULL) {
......@@ -903,7 +905,8 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
/* Use unmodified headers*/
i = FetchBody(wrk, bo, req->obj);
i = FetchBody(wrk, bo);
bo->fetch_obj = NULL;
http_Teardown(bo->bereq);
http_Teardown(bo->beresp);
......@@ -1115,6 +1118,8 @@ cnt_lookup(struct sess *sp, struct worker *wrk, struct req *req)
/* If we inserted a new object it's a miss */
if (oc->flags & OC_F_BUSY) {
CHECK_OBJ_NOTNULL(oc->busyobj, BUSYOBJ_MAGIC);
assert(oc->busyobj == req->busyobj);
wrk->stats.cache_miss++;
if (req->vary_l != NULL) {
......@@ -1130,7 +1135,6 @@ cnt_lookup(struct sess *sp, struct worker *wrk, struct req *req)
req->vary_e = NULL;
req->objcore = oc;
CHECK_OBJ_NOTNULL(req->busyobj, BUSYOBJ_MAGIC);
sp->step = STP_MISS;
return (0);
}
......
......@@ -493,18 +493,19 @@ FetchHdr(struct sess *sp, int need_host_hdr, int sendbody)
/*--------------------------------------------------------------------*/
int
FetchBody(struct worker *wrk, struct busyobj *bo, struct object *obj)
FetchBody(struct worker *wrk, struct busyobj *bo)
{
int cls;
struct storage *st;
int mklen;
ssize_t cl;
struct http_conn *htc;
struct object *obj;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
AZ(bo->fetch_obj);
CHECK_OBJ_NOTNULL(bo->vbc, VBC_MAGIC);
obj = bo->fetch_obj;
CHECK_OBJ_NOTNULL(obj, OBJECT_MAGIC);
CHECK_OBJ_NOTNULL(obj->http, HTTP_MAGIC);
......@@ -525,7 +526,6 @@ FetchBody(struct worker *wrk, struct busyobj *bo, struct object *obj)
AZ(bo->vgz_rx);
AZ(VTAILQ_FIRST(&obj->store));
bo->fetch_obj = obj;
bo->fetch_failed = 0;
/* XXX: pick up estimate from objdr ? */
......@@ -578,8 +578,6 @@ FetchBody(struct worker *wrk, struct busyobj *bo, struct object *obj)
*/
AZ(vfp_nop_end(bo));
bo->fetch_obj = NULL;
VSLb(bo->vsl, SLT_Fetch_Body, "%u(%s) cls %d mklen %d",
bo->body_status, body_status(bo->body_status),
cls, mklen);
......
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