r2071 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Oct 1 09:27:38 CEST 2007


Author: phk
Date: 2007-10-01 09:27:37 +0200 (Mon, 01 Oct 2007)
New Revision: 2071

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_center.c
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
   trunk/varnish-cache/bin/varnishd/cache_hash.c
   trunk/varnish-cache/bin/varnishd/cache_response.c
   trunk/varnish-cache/bin/varnishd/cache_synthetic.c
   trunk/varnish-cache/bin/varnishd/cache_vary.c
   trunk/varnish-cache/bin/varnishd/cache_vrt.c
Log:
Eliminate a & which I tend to forget every single time.


Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2007-10-01 07:21:26 UTC (rev 2070)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2007-10-01 07:27:37 UTC (rev 2071)
@@ -246,7 +246,7 @@
 
 	double			last_modified;
 
-	struct http		http;
+	struct http		http[1];
 	VTAILQ_ENTRY(object)	list;
 
 	VTAILQ_ENTRY(object)	deathrow;

Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2007-10-01 07:21:26 UTC (rev 2070)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2007-10-01 07:27:37 UTC (rev 2071)
@@ -305,9 +305,9 @@
 	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);
 

Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2007-10-01 07:21:26 UTC (rev 2070)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2007-10-01 07:27:37 UTC (rev 2071)
@@ -309,7 +309,7 @@
 		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 */
 

Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c	2007-10-01 07:21:26 UTC (rev 2070)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c	2007-10-01 07:27:37 UTC (rev 2071)
@@ -87,7 +87,7 @@
 		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 @@
 	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);

Modified: trunk/varnish-cache/bin/varnishd/cache_response.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_response.c	2007-10-01 07:21:26 UTC (rev 2070)
+++ trunk/varnish-cache/bin/varnishd/cache_response.c	2007-10-01 07:27:37 UTC (rev 2071)
@@ -123,8 +123,8 @@
 
 	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);

Modified: trunk/varnish-cache/bin/varnishd/cache_synthetic.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_synthetic.c	2007-10-01 07:21:26 UTC (rev 2070)
+++ trunk/varnish-cache/bin/varnishd/cache_synthetic.c	2007-10-01 07:27:37 UTC (rev 2071)
@@ -60,14 +60,14 @@
 	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 */

Modified: trunk/varnish-cache/bin/varnishd/cache_vary.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vary.c	2007-10-01 07:21:26 UTC (rev 2070)
+++ trunk/varnish-cache/bin/varnishd/cache_vary.c	2007-10-01 07:27:37 UTC (rev 2071)
@@ -76,7 +76,7 @@
 	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++) {

Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c	2007-10-01 07:21:26 UTC (rev 2070)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c	2007-10-01 07:27:37 UTC (rev 2071)
@@ -91,7 +91,7 @@
 		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(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 @@
 	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 @@
 	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 @@
 {
 	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 @@
 {
 	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 @@
 {
 	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));
 }
 
 /*--------------------------------------------------------------------*/




More information about the varnish-commit mailing list