r4441 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Fri Jan 8 18:13:10 CET 2010


Author: phk
Date: 2010-01-08 18:13:10 +0100 (Fri, 08 Jan 2010)
New Revision: 4441

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_backend.h
   trunk/varnish-cache/bin/varnishd/cache_center.c
   trunk/varnish-cache/bin/varnishd/cache_dir_random.c
   trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c
Log:
More flexelint silencing



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2010-01-08 16:53:38 UTC (rev 4440)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2010-01-08 17:13:10 UTC (rev 4441)
@@ -456,8 +456,8 @@
 
 /* cache_backend.c */
 
-struct vbe_conn *VBE_GetFd(struct director *, struct sess *sp);
-int VBE_Healthy(struct director *, const struct sess *sp);
+struct vbe_conn *VBE_GetFd(const struct director *, struct sess *sp);
+int VBE_Healthy(const struct director *, const struct sess *sp);
 void VBE_ClosedFd(struct sess *sp);
 void VBE_RecycleFd(struct sess *sp);
 void VBE_AddHostHeader(const struct sess *sp);

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2010-01-08 16:53:38 UTC (rev 4440)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2010-01-08 17:13:10 UTC (rev 4441)
@@ -402,7 +402,7 @@
 /* Get a connection --------------------------------------------------*/
 
 struct vbe_conn *
-VBE_GetFd(struct director *d, struct sess *sp)
+VBE_GetFd(const struct director *d, struct sess *sp)
 {
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
@@ -415,7 +415,7 @@
 /* Cheack health -----------------------------------------------------*/
 
 int
-VBE_Healthy(struct director *d, const struct sess *sp)
+VBE_Healthy(const struct director *d, const struct sess *sp)
 {
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
@@ -439,7 +439,7 @@
 };
 
 static struct vbe_conn *
-vdi_simple_getfd(struct director *d, struct sess *sp)
+vdi_simple_getfd(const struct director *d, struct sess *sp)
 {
 	struct vdi_simple *vs;
 
@@ -450,7 +450,7 @@
 }
 
 static unsigned
-vdi_simple_healthy(struct director *d, const struct sess *sp)
+vdi_simple_healthy(const struct director *d, const struct sess *sp)
 {
 	struct vdi_simple *vs;
 

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.h	2010-01-08 16:53:38 UTC (rev 4440)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.h	2010-01-08 17:13:10 UTC (rev 4441)
@@ -77,9 +77,9 @@
  * backends to use.
  */
 
-typedef struct vbe_conn *vdi_getfd_f(struct director *, struct sess *sp);
+typedef struct vbe_conn *vdi_getfd_f(const struct director *, struct sess *sp);
 typedef void vdi_fini_f(struct director *);
-typedef unsigned vdi_healthy(struct director *, const struct sess *sp);
+typedef unsigned vdi_healthy(const struct director *, const struct sess *sp);
 
 struct director {
 	unsigned		magic;

Modified: trunk/varnish-cache/bin/varnishd/cache_center.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_center.c	2010-01-08 16:53:38 UTC (rev 4440)
+++ trunk/varnish-cache/bin/varnishd/cache_center.c	2010-01-08 17:13:10 UTC (rev 4441)
@@ -422,7 +422,8 @@
 	struct http *hp, *hp2;
 	char *b;
 	unsigned handling, l;
-	struct vsb *vary;
+	int varyl = 0;
+	struct vsb *vary = NULL;
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
@@ -519,16 +520,19 @@
 		CHECK_OBJ_NOTNULL(sp->objhead, OBJHEAD_MAGIC);
 		CHECK_OBJ_NOTNULL(sp->objcore, OBJCORE_MAGIC);
 		vary = VRY_Create(sp, sp->wrk->beresp);
+		if (vary != NULL) {
+			varyl = vsb_len(vary);
+			assert(varyl > 0);
+		}
 	} else {
 		AZ(sp->objhead);
 		AZ(sp->objcore);
-		vary = NULL;
 	}
 
 	l = http_EstimateWS(sp->wrk->beresp, HTTPH_A_INS);
 
 	if (vary != NULL)
-		l += vsb_len(vary);
+		l += varyl;
 
 	/* Space for producing a Content-Length: header */
 	l += 30;
@@ -553,9 +557,9 @@
 
 	if (vary != NULL) {
 		sp->obj->vary =
-		    (void *)WS_Alloc(sp->obj->http->ws, vsb_len(vary));
+		    (void *)WS_Alloc(sp->obj->http->ws, varyl);
 		AN(sp->obj->vary);
-		memcpy(sp->obj->vary, vsb_data(vary), vsb_len(vary));
+		memcpy(sp->obj->vary, vsb_data(vary), varyl);
 		vsb_delete(vary);
 		vary = NULL;
 	}

Modified: trunk/varnish-cache/bin/varnishd/cache_dir_random.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_random.c	2010-01-08 16:53:38 UTC (rev 4440)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_random.c	2010-01-08 17:13:10 UTC (rev 4441)
@@ -78,7 +78,7 @@
 };
 
 static struct vbe_conn *
-vdi_random_getfd(struct director *d, struct sess *sp)
+vdi_random_getfd(const struct director *d, struct sess *sp)
 {
 	int i, k;
 	struct vdi_random *vs;
@@ -158,7 +158,7 @@
 }
 
 static unsigned
-vdi_random_healthy(struct director *d, const struct sess *sp)
+vdi_random_healthy(const struct director *d, const struct sess *sp)
 {
 	struct vdi_random *vs;
 	int i;

Modified: trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c	2010-01-08 16:53:38 UTC (rev 4440)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c	2010-01-08 17:13:10 UTC (rev 4441)
@@ -61,7 +61,7 @@
 };
 
 static struct vbe_conn *
-vdi_round_robin_getfd(struct director *d, struct sess *sp)
+vdi_round_robin_getfd(const struct director *d, struct sess *sp)
 {
 	int i;
 	struct vdi_round_robin *vs;
@@ -86,7 +86,7 @@
 }
 
 static unsigned
-vdi_round_robin_healthy(struct director *d, const struct sess *sp)
+vdi_round_robin_healthy(const struct director *d, const struct sess *sp)
 {
 	struct vdi_round_robin *vs;
 	struct director *backend;



More information about the varnish-commit mailing list