From: phk Date: Mon, 29 Oct 2007 07:53:27 +0000 (+0000) Subject: Issue an VCL_error if 'esi' is not used from vcl_fetch. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b15ed98cb631d9526413f15e0412808bb1da0e47;p=varnish Issue an VCL_error if 'esi' is not used from vcl_fetch. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2177 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_vrt_esi.c b/varnish-cache/bin/varnishd/cache_vrt_esi.c index 363b0c9a..d777da1b 100644 --- a/varnish-cache/bin/varnishd/cache_vrt_esi.c +++ b/varnish-cache/bin/varnishd/cache_vrt_esi.c @@ -533,6 +533,13 @@ VRT_ESI(struct sess *sp) int i; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + if (sp->cur_method != VCL_MET_FETCH) { + /* XXX: we should catch this at compile time */ + WSP(sp, SLT_VCL_error, + "esi can only be called from vcl_fetch", ""); + return; + } + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX: only if GET ? */