Skip to content

Instantly share code, notes, and snippets.

@xcir

xcir/x.diff Secret

Last active July 3, 2019 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xcir/78c02d50681a4a78bc8c79ffd8421c8c to your computer and use it in GitHub Desktop.
Save xcir/78c02d50681a4a78bc8c79ffd8421c8c to your computer and use it in GitHub Desktop.
diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index c175488..ff554d2 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -140,6 +140,7 @@ static struct ctx {
int a_opt;
int b_opt;
int c_opt;
+ int e_opt;
char *w_arg;
FILE *fo;
@@ -891,7 +892,7 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
be_mark = BACKEND_MARKER;
} else
continue;
- if (t->reason == VSL_r_esi)
+ if (t->reason == VSL_r_esi && !CTX.e_opt)
/* Skip ESI requests */
continue;
CTX.hitmiss = "-";
@@ -1111,6 +1112,10 @@ main(int argc, char * const *argv)
/* client mode */
CTX.c_opt = 1;
break;
+ case 'e':
+ /* show ESI */
+ CTX.e_opt = 1;
+ break;
case 'F':
if (format != NULL)
VUT_Error(vut, 1, "Format already set");
diff --git a/bin/varnishncsa/varnishncsa_options.h b/bin/varnishncsa/varnishncsa_options.h
index 8987a96..28090f2 100644
--- a/bin/varnishncsa/varnishncsa_options.h
+++ b/bin/varnishncsa/varnishncsa_options.h
@@ -72,10 +72,15 @@
"Log client requests. This is the default. If -b is" \
" specified, then -c is needed to also log client requests" \
)
+#define NCSA_OPT_e \
+ VOPT("e", "[-e]", "Show ESI request", \
+ "Show ESI subrequest." \
+ )
NCSA_OPT_a
NCSA_OPT_b
NCSA_OPT_c
+NCSA_OPT_e
VSL_OPT_C
VUT_OPT_d
VUT_GLOBAL_OPT_D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment