r591 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Aug 1 18:42:37 CEST 2006


Author: phk
Date: 2006-08-01 18:42:37 +0200 (Tue, 01 Aug 2006)
New Revision: 591

Modified:
   trunk/varnish-cache/bin/varnishd/cache_acceptor.c
   trunk/varnish-cache/bin/varnishd/cache_http.c
   trunk/varnish-cache/bin/varnishd/flint.lnt
Log:
More miniobj checks


Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2006-08-01 16:26:10 UTC (rev 590)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c	2006-08-01 16:42:37 UTC (rev 591)
@@ -49,6 +49,7 @@
 	AZ(evtimer_add(&tick_e, &tick_rate));
 	clock_gettime(CLOCK_MONOTONIC, &t);
 	TAILQ_FOREACH_SAFE(sp, &sesshead, list, sp2) {
+		CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 		if (sp->t_idle.tv_sec + 30 < t.tv_sec) {
 			TAILQ_REMOVE(&sesshead, sp, list);
 			vca_close_session(sp, "timeout");
@@ -60,8 +61,9 @@
 static void
 vca_callback(void *arg, int bad)
 {
-	struct sess *sp = arg;
+	struct sess *sp;
 
+	CAST_OBJ_NOTNULL(sp, arg, SESS_MAGIC);
 	TAILQ_REMOVE(&sesshead, sp, list);
 	if (bad) {
 		if (bad == 1)

Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2006-08-01 16:26:10 UTC (rev 590)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2006-08-01 16:42:37 UTC (rev 591)
@@ -446,12 +446,13 @@
 static void
 http_read_f(int fd, short event, void *arg)
 {
-	struct http *hp = arg;
+	struct http *hp;
 	unsigned l;
 	int i, ret = 0;
 
 	(void)event;
 
+	CAST_OBJ_NOTNULL(hp, arg, HTTP_MAGIC);
 	l = (hp->e - hp->s) / 2;
 	if (l < hp->v - hp->s)
 		l = 0;

Modified: trunk/varnish-cache/bin/varnishd/flint.lnt
===================================================================
--- trunk/varnish-cache/bin/varnishd/flint.lnt	2006-08-01 16:26:10 UTC (rev 590)
+++ trunk/varnish-cache/bin/varnishd/flint.lnt	2006-08-01 16:42:37 UTC (rev 591)
@@ -1,4 +1,4 @@
--passes=3
+-passes=12
 
 // Fix strchr() semtics, it can only return NULL if arg2 != 0
 -sem(strchr, 1p, type(1), 2n == 0 ? (@p < 1p) : (@p < 1p || @p == 0 ))




More information about the varnish-commit mailing list