From b15ed98cb631d9526413f15e0412808bb1da0e47 Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 29 Oct 2007 07:53:27 +0000 Subject: [PATCH] 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 --- varnish-cache/bin/varnishd/cache_vrt_esi.c | 7 +++++++ 1 file changed, 7 insertions(+) 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 ? */ -- 2.39.5