Commit 78936f64 authored by Tollef Fog Heen's avatar Tollef Fog Heen

varnishlog: if -m given, but no -c and -b, assume both

If we don't add -c and -b in there, varnishlog will print all
transactions that aren't associated with a session.  That is likely to
not be what the user wants.

Fixes: #1071
parent 683cc929
......@@ -49,7 +49,7 @@
#include "compat/daemon.h"
static int b_flag, c_flag;
static int b_flag = 0, c_flag = 0;
/* Ordering-----------------------------------------------------------*/
......@@ -329,6 +329,16 @@ main(int argc, char * const *argv)
}
}
/* If we're matching, we want either -b or -c, apply both if
* none are given. This prevents spurious noise in the log
* output. */
if (b_flag == 0 && c_flag == 0 && m_flag) {
b_flag = 1;
AN(VSL_Arg(vd, 'b', NULL));
c_flag = 1;
AN(VSL_Arg(vd, 'c', NULL));
}
if (O_flag && m_flag)
usage();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment