]> err.no Git - varnish/commitdiff
Issue an VCL_error if 'esi' is not used from vcl_fetch.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 29 Oct 2007 07:53:27 +0000 (07:53 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 29 Oct 2007 07:53:27 +0000 (07:53 +0000)
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

index 363b0c9a34eb89ed6545f37d9eea6a769a94497a..d777da1b77227c4d8567d9998742f459f23f29d6 100644 (file)
@@ -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 ? */