[master] 10a2ab5 Rename max_esi_includes param to max_esi_depth and enforce it again.
Poul-Henning Kamp
phk at varnish-cache.org
Thu Feb 17 21:14:22 CET 2011
commit 10a2ab5fb00eb4ebf3acf2c58b6be0c4ac35048b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Feb 17 20:14:04 2011 +0000
Rename max_esi_includes param to max_esi_depth and enforce it again.
diff --git a/bin/varnishd/cache_esi_deliver.c b/bin/varnishd/cache_esi_deliver.c
index 29543a8..48a9948 100644
--- a/bin/varnishd/cache_esi_deliver.c
+++ b/bin/varnishd/cache_esi_deliver.c
@@ -55,6 +55,10 @@ ved_include(struct sess *sp, const char *src, const char *host)
w = sp->wrk;
+ if (sp->esi_level >= params->max_esi_depth)
+ return;
+ sp->esi_level++;
+
if (WRW_Flush(w)) {
vca_close_session(sp, "remote closed");
return;
@@ -62,7 +66,6 @@ ved_include(struct sess *sp, const char *src, const char *host)
AZ(WRW_FlushRelease(w));
- sp->esi_level++;
obj = sp->obj;
sp->obj = NULL;
res_mode = sp->wrk->res_mode;
diff --git a/bin/varnishd/heritage.h b/bin/varnishd/heritage.h
index 4b902a5..d028b5a 100644
--- a/bin/varnishd/heritage.h
+++ b/bin/varnishd/heritage.h
@@ -136,7 +136,7 @@ struct params {
unsigned max_restarts;
/* Maximum esi:include depth allowed */
- unsigned max_esi_includes;
+ unsigned max_esi_depth;
/* ESI parser hints */
unsigned esi_syntax;
diff --git a/bin/varnishd/mgt_param.c b/bin/varnishd/mgt_param.c
index c8ad67c..1c49879 100644
--- a/bin/varnishd/mgt_param.c
+++ b/bin/varnishd/mgt_param.c
@@ -647,11 +647,11 @@ static const struct parspec input_parspec[] = {
"Use 0x notation and do the bitor in your head :-)\n",
0,
"0", "bitmap" },
- { "max_esi_includes",
- tweak_uint, &master.max_esi_includes, 0, UINT_MAX,
+ { "max_esi_depth",
+ tweak_uint, &master.max_esi_depth, 0, UINT_MAX,
"Maximum depth of esi:include processing.\n",
0,
- "5", "includes" },
+ "5", "levels" },
{ "cache_vbcs", tweak_bool, &master.cache_vbcs, 0, 0,
"Cache vbc's or rely on malloc, that's the question.",
EXPERIMENTAL,
More information about the varnish-commit
mailing list