r2554 - in trunk/varnish-cache: bin/varnishd include lib/libvcl

des at projects.linpro.no des at projects.linpro.no
Tue Mar 4 12:42:00 CET 2008


Author: des
Date: 2008-03-04 12:42:00 +0100 (Tue, 04 Mar 2008)
New Revision: 2554

Modified:
   trunk/varnish-cache/bin/varnishd/cache_vrt.c
   trunk/varnish-cache/include/vrt_obj.h
   trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl
Log:
Relax assertions, and fix the build.


Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c	2008-03-04 11:03:03 UTC (rev 2553)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c	2008-03-04 11:42:00 UTC (rev 2554)
@@ -540,11 +540,15 @@
 }
 
 const char *
-VRT_r_obj_hash(struct sess *sp)
+VRT_r_obj_hash(const struct sess *sp)
 {
 
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+	if (sp->obj == NULL)
+		return (NULL);
 	CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
+	if (sp->obj->objhead == NULL)
+		return (NULL);
 	CHECK_OBJ_NOTNULL(sp->obj->objhead, OBJHEAD_MAGIC);
 	return (sp->obj->objhead->hash);
 }

Modified: trunk/varnish-cache/include/vrt_obj.h
===================================================================
--- trunk/varnish-cache/include/vrt_obj.h	2008-03-04 11:03:03 UTC (rev 2553)
+++ trunk/varnish-cache/include/vrt_obj.h	2008-03-04 11:42:00 UTC (rev 2554)
@@ -43,7 +43,7 @@
 double VRT_r_obj_prefetch(const struct sess *);
 void VRT_l_obj_prefetch(const struct sess *, double);
 double VRT_r_obj_lastuse(const struct sess *);
-const char * VRT_r_obj_hash();
+const char * VRT_r_obj_hash(const struct sess *);
 const char * VRT_r_resp_proto(const struct sess *);
 void VRT_l_resp_proto(const struct sess *, const char *, ...);
 int VRT_r_resp_status(const struct sess *);

Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl
===================================================================
--- trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl	2008-03-04 11:03:03 UTC (rev 2553)
+++ trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl	2008-03-04 11:42:00 UTC (rev 2554)
@@ -173,6 +173,7 @@
 	{ obj.hash
 		RO STRING
 		{                    miss hit fetch deliver                }
+		"const struct sess *"
 	}
 
 	# The response we send back




More information about the varnish-commit mailing list