From: des Date: Tue, 4 Mar 2008 11:42:00 +0000 (+0000) Subject: Relax assertions, and fix the build. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56768cac91fe4ba938f6e338d107b165d4376ad6;p=varnish Relax assertions, and fix the build. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2554 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_vrt.c b/varnish-cache/bin/varnishd/cache_vrt.c index fcc6b6db..b15d3277 100644 --- a/varnish-cache/bin/varnishd/cache_vrt.c +++ b/varnish-cache/bin/varnishd/cache_vrt.c @@ -540,11 +540,15 @@ VRT_r_obj_lastuse(const struct sess *sp) } 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); } diff --git a/varnish-cache/include/vrt_obj.h b/varnish-cache/include/vrt_obj.h index d7f8eb72..24b5a9a9 100644 --- a/varnish-cache/include/vrt_obj.h +++ b/varnish-cache/include/vrt_obj.h @@ -43,7 +43,7 @@ void VRT_l_obj_grace(const struct sess *, double); 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 *); diff --git a/varnish-cache/lib/libvcl/vcc_gen_obj.tcl b/varnish-cache/lib/libvcl/vcc_gen_obj.tcl index 0e0c73b8..08ce82a2 100755 --- a/varnish-cache/lib/libvcl/vcc_gen_obj.tcl +++ b/varnish-cache/lib/libvcl/vcc_gen_obj.tcl @@ -173,6 +173,7 @@ set spobj { { obj.hash RO STRING { miss hit fetch deliver } + "const struct sess *" } # The response we send back