From: phk Date: Mon, 1 Oct 2007 07:27:37 +0000 (+0000) Subject: Eliminate a & which I tend to forget every single time. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=631c352d94c5c03866521b51f0f03813c4297340;p=varnish Eliminate a & which I tend to forget every single time. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2071 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index be8ab595..01086ae1 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -246,7 +246,7 @@ struct object { double last_modified; - struct http http; + struct http http[1]; VTAILQ_ENTRY(object) list; VTAILQ_ENTRY(object) deathrow; diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index e2e852e3..58925901 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -305,9 +305,9 @@ cnt_fetch(struct sess *sp) sp->bereq = NULL; if (!i) - RFC2616_cache_policy(sp, &sp->obj->http); /* XXX -> VCL */ + RFC2616_cache_policy(sp, sp->obj->http); /* XXX -> VCL */ else - http_PutStatus(sp->wrk, sp->fd, &sp->obj->http, 503); + http_PutStatus(sp->wrk, sp->fd, sp->obj->http, 503); VCL_fetch_method(sp); diff --git a/varnish-cache/bin/varnishd/cache_fetch.c b/varnish-cache/bin/varnishd/cache_fetch.c index dcc05df4..7fe52db0 100644 --- a/varnish-cache/bin/varnishd/cache_fetch.c +++ b/varnish-cache/bin/varnishd/cache_fetch.c @@ -309,7 +309,7 @@ Fetch(struct sess *sp) sp->obj->last_modified = TIM_parse(b); /* Filter into object */ - hp2 = &sp->obj->http; + hp2 = sp->obj->http; len = Tlen(htc->rxbuf); len += 256; /* XXX: margin for content-length etc */ diff --git a/varnish-cache/bin/varnishd/cache_hash.c b/varnish-cache/bin/varnishd/cache_hash.c index 66d3b073..25cb7dd3 100644 --- a/varnish-cache/bin/varnishd/cache_hash.c +++ b/varnish-cache/bin/varnishd/cache_hash.c @@ -87,7 +87,7 @@ HSH_Prealloc(const struct sess *sp) w->nobj = calloc(sizeof *w->nobj, 1); XXXAN(w->nobj); w->nobj->magic = OBJECT_MAGIC; - w->nobj->http.magic = HTTP_MAGIC; + w->nobj->http->magic = HTTP_MAGIC; w->nobj->busy = 1; w->nobj->refcnt = 1; VTAILQ_INIT(&w->nobj->store); @@ -304,8 +304,8 @@ HSH_Deref(struct object *o) if (r != 0) return; - if (o->http.ws != NULL && o->http.ws->s != NULL) - free(o->http.ws->s); + if (o->http->ws != NULL && o->http->ws->s != NULL) + free(o->http->ws->s); if (o->vary != NULL) free(o->vary); diff --git a/varnish-cache/bin/varnishd/cache_response.c b/varnish-cache/bin/varnishd/cache_response.c index 244d326d..f40710e9 100644 --- a/varnish-cache/bin/varnishd/cache_response.c +++ b/varnish-cache/bin/varnishd/cache_response.c @@ -123,8 +123,8 @@ RES_BuildHttp(struct sess *sp) http_ClrHeader(sp->http); sp->http->logtag = HTTP_Tx; - http_CopyResp(sp->http, &sp->obj->http); - http_FilterFields(sp->wrk, sp->fd, sp->http, &sp->obj->http, + http_CopyResp(sp->http, sp->obj->http); + http_FilterFields(sp->wrk, sp->fd, sp->http, sp->obj->http, HTTPH_A_DELIVER); TIM_format(TIM_real(), time_str); diff --git a/varnish-cache/bin/varnishd/cache_synthetic.c b/varnish-cache/bin/varnishd/cache_synthetic.c index bf267ed7..10d1b16a 100644 --- a/varnish-cache/bin/varnishd/cache_synthetic.c +++ b/varnish-cache/bin/varnishd/cache_synthetic.c @@ -60,14 +60,14 @@ SYN_ErrorPage(struct sess *sp, int status, const char *reason, int ttl) CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); - CHECK_OBJ_NOTNULL(&sp->obj->http, HTTP_MAGIC); + CHECK_OBJ_NOTNULL(sp->obj->http, HTTP_MAGIC); assert(sp->obj->busy > 0); /* shortcuts */ w = sp->wrk; fd = sp->fd; o = sp->obj; - h = &o->http; + h = o->http; now = TIM_real(); /* look up HTTP response */ diff --git a/varnish-cache/bin/varnishd/cache_vary.c b/varnish-cache/bin/varnishd/cache_vary.c index a6b76f27..3db31a26 100644 --- a/varnish-cache/bin/varnishd/cache_vary.c +++ b/varnish-cache/bin/varnishd/cache_vary.c @@ -76,7 +76,7 @@ VRY_Create(const struct sess *sp) AN(sbh); /* No Vary: header, no worries */ - if (!http_GetHdr(&sp->obj->http, H_Vary, &v)) + if (!http_GetHdr(sp->obj->http, H_Vary, &v)) return; for (p = v; *p; p++) { diff --git a/varnish-cache/bin/varnishd/cache_vrt.c b/varnish-cache/bin/varnishd/cache_vrt.c index 23f55111..a8244a66 100644 --- a/varnish-cache/bin/varnishd/cache_vrt.c +++ b/varnish-cache/bin/varnishd/cache_vrt.c @@ -91,7 +91,7 @@ vrt_selecthttp(const struct sess *sp, enum gethdr_e where) hp = sp->http; break; case HDR_OBJ: - hp = &sp->obj->http; + hp = sp->obj->http; break; default: INCOMPL(); @@ -215,8 +215,8 @@ VRT_DO_HDR(req, proto, sp->http, HTTP_HDR_PROTO) VRT_DO_HDR(bereq, request, sp->bereq->http, HTTP_HDR_REQ) VRT_DO_HDR(bereq, url, sp->bereq->http, HTTP_HDR_URL) VRT_DO_HDR(bereq, proto, sp->bereq->http, HTTP_HDR_PROTO) -VRT_DO_HDR(obj, proto, &sp->obj->http, HTTP_HDR_PROTO) -VRT_DO_HDR(obj, response, &sp->obj->http, HTTP_HDR_RESPONSE) +VRT_DO_HDR(obj, proto, sp->obj->http, HTTP_HDR_PROTO) +VRT_DO_HDR(obj, response, sp->obj->http, HTTP_HDR_RESPONSE) VRT_DO_HDR(resp, proto, sp->http, HTTP_HDR_PROTO) VRT_DO_HDR(resp, response, sp->http, HTTP_HDR_RESPONSE) @@ -226,12 +226,12 @@ VRT_l_obj_status(const struct sess *sp, int num) char *p; assert(num >= 100 && num <= 999); - p = WS_Alloc(sp->obj->http.ws, 4); + p = WS_Alloc(sp->obj->http->ws, 4); if (p == NULL) WSP(sp, SLT_LostHeader, "%s", "obj.status"); else sprintf(p, "%d", num); - http_SetH(&sp->obj->http, HTTP_HDR_STATUS, p); + http_SetH(sp->obj->http, HTTP_HDR_STATUS, p); } int @@ -240,9 +240,9 @@ VRT_r_obj_status(const struct sess *sp) CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX: use http_GetStatus() */ - if (sp->obj->http.status) - return (sp->obj->http.status); - return (atoi(sp->obj->http.hd[HTTP_HDR_STATUS].b)); + if (sp->obj->http->status) + return (sp->obj->http->status); + return (atoi(sp->obj->http->hd[HTTP_HDR_STATUS].b)); } void @@ -374,7 +374,7 @@ VRT_r_resp_proto(const struct sess *sp) { CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); - return (sp->obj->http.hd[HTTP_HDR_PROTO].b); + return (sp->obj->http->hd[HTTP_HDR_PROTO].b); } const char * @@ -382,7 +382,7 @@ VRT_r_resp_response(const struct sess *sp) { CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); - return (sp->obj->http.hd[HTTP_HDR_RESPONSE].b); + return (sp->obj->http->hd[HTTP_HDR_RESPONSE].b); } int @@ -390,7 +390,7 @@ VRT_r_resp_status(const struct sess *sp) { CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); - return (atoi(sp->obj->http.hd[HTTP_HDR_STATUS].b)); + return (atoi(sp->obj->http->hd[HTTP_HDR_STATUS].b)); } /*--------------------------------------------------------------------*/