Commit 95e9092e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Incrementally chip away at struct object

parent be938d34
......@@ -159,7 +159,8 @@ vbf_beresp2obj(struct busyobj *bo)
obj->oa_http = HTTP_Encode(bo->beresp, bo->ws_o,
bo->uncacheable ? HTTPH_R_PASS : HTTPH_A_INS);
AN(obj->oa_http);
AZ(HTTP_Decode(obj->http, obj->oa_http));
AZ(HTTP_Decode(obj->http,
ObjGetattr(bo->fetch_objcore, bo->stats, OA_HEADERS, NULL)));
if (http_GetHdr(bo->beresp, H_Last_Modified, &b))
AZ(ObjSetDouble(bo->fetch_objcore, bo->stats, OA_LASTMODIFIED,
......
......@@ -92,7 +92,7 @@ v1d_dorange(struct req *req, struct busyobj *bo, const char *r)
ssize_t len, low, high, has_low;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
CHECK_OBJ_NOTNULL(req->objcore, OBJCORE_MAGIC);
assert(http_IsStatus(req->resp, 200));
/* We must snapshot the length if we're streaming from the backend */
......
......@@ -236,6 +236,9 @@ ObjGetattr(struct objcore *oc, struct dstat *ds, enum obj_attr attr,
case OA_GZIPBITS:
*len = sizeof o->oa_gzipbits;
return (o->oa_gzipbits);
case OA_HEADERS:
*len = 0; // XXX: hack
return (o->oa_http);
case OA_LASTMODIFIED:
*len = sizeof o->oa_lastmodified;
return (o->oa_lastmodified);
......@@ -256,6 +259,7 @@ ObjSetattr(struct objcore *oc, struct dstat *ds, enum obj_attr attr,
ssize_t len)
{
struct object *o;
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
AN(ds);
o = ObjGetObj(oc, ds);
......
......@@ -187,7 +187,6 @@ stv_alloc_obj(const struct vfp_ctx *vc, size_t size)
struct storage *st = NULL;
struct stevedore *stv;
unsigned fail;
struct object *obj;
/*
* Always use the stevedore which allocated the object in order to
......@@ -196,9 +195,7 @@ stv_alloc_obj(const struct vfp_ctx *vc, size_t size)
CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
CHECK_OBJ_NOTNULL(vc->bo, BUSYOBJ_MAGIC);
AN(vc->bo->stats);
obj = vc->bo->fetch_obj;
CHECK_OBJ_NOTNULL(obj, OBJECT_MAGIC);
stv = obj->body->stevedore;
stv = vc->body->stevedore;
CHECK_OBJ_NOTNULL(stv, STEVEDORE_MAGIC);
if (size > cache_param->fetch_maxchunksize)
......
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