Commit 0106b225 authored by Geoff Simmons's avatar Geoff Simmons

bugfix %I and %O formatters for backend logging

parent 8ae4f160
......@@ -411,7 +411,7 @@ void
format_I_backend(const tx_t *tx, const arg_t *args, char **s, size_t *len)
{
(void) args;
format_IO_backend(tx, 5, s, len);
format_IO_backend(tx, 2, s, len);
}
void
......@@ -439,7 +439,7 @@ void
format_O_backend(const tx_t *tx, const arg_t *args, char **s, size_t *len)
{
(void) args;
format_IO_backend(tx, 2, s, len);
format_IO_backend(tx, 5, s, len);
}
static inline void
......
......@@ -12,7 +12,7 @@ rm -f $LOG $OUT
../varnishevent -f varnishevent.conf -r varnish-4.1.0-doc.log -w $OUT -v
CKSUM=$( cksum $OUT )
if [ "$CKSUM" != "3634051132 442153 $OUT" ]; then
if [ "$CKSUM" != "1046111307 442153 $OUT" ]; then
echo "ERROR: Regression test log output incorrect cksum: $CKSUM"
exit 1
fi
......
......@@ -752,8 +752,8 @@ static const char
add_record_data(&tx, SLT_BereqAcct, &rec[1], &c[1], REQACCT_PAYLOAD);
format_I_backend(&tx, &args, &str, &len);
MASSERT(strncmp(str, "283", 3) == 0);
MASSERT(len == 3);
MASSERT(strncmp(str, "60", 2) == 0);
MASSERT(len == 2);
#define PIPEACCT_PAYLOAD "60 60 178 105"
clear_rec(&tx, SLT_ReqAcct);
......@@ -824,8 +824,8 @@ static const char
add_record_data(&tx, SLT_BereqAcct, &rec[1], &c[1], REQACCT_PAYLOAD);
format_O_backend(&tx, &args, &str, &len);
MASSERT(strncmp(str, "60", 2) == 0);
MASSERT(len == 2);
MASSERT(strncmp(str, "283", 3) == 0);
MASSERT(len == 3);
clear_rec(&tx, SLT_ReqAcct);
add_record_data(&tx, SLT_PipeAcct, &rec[0], &c[0], PIPEACCT_PAYLOAD);
......@@ -2132,7 +2132,7 @@ static const char
setup_full_backend_tx(&tx, node, nptr, rec, c);
os = FMT_Format(&tx, &len);
#define EXP_FULL_BACKEND_OUTPUT "105 b 15703 HTTP/1.1 default(127.0.0.1,,80) "\
"283 foohdr barhdr - GET 60 bar=baz&quux=wilco GET "\
"60 foohdr barhdr - GET 283 bar=baz&quux=wilco GET "\
"http://foobar.com/foo?bar=baz&quux=wilco HTTP/1.1 200 "\
"[%d/%b/%Y:%T %z] 0 %F-%T.529143 /foo varnish 0.002837 logload "\
"2 chunked stream \"foo\\0\\377 bar\" "\
......
......@@ -11,7 +11,7 @@ LOG=/dev/null
echo "... no VSL args"
CKSUM=$( ../varnishevent -r ${IN} -f ${CONF} -l ${LOG} | cksum)
if [ "$CKSUM" != '1280332296 442191' ]; then
if [ "$CKSUM" != '2861633151 442191' ]; then
echo "ERROR: no VSL args unexpected cksum: $CKSUM"
exit 1
fi
......@@ -20,7 +20,7 @@ echo "... -g vxid"
CKSUM=$( ../varnishevent -g vxid -r ${IN} -f ${CONF} -l ${LOG} | cksum)
# Same as default (no -g arg)
if [ "$CKSUM" != '1280332296 442191' ]; then
if [ "$CKSUM" != '2861633151 442191' ]; then
echo "ERROR: -g vxid unexpected cksum: $CKSUM"
exit 1
fi
......@@ -28,7 +28,7 @@ fi
echo "... -g request"
CKSUM=$( ../varnishevent -g request -r ${IN} -f ${CONF} -l ${LOG} | cksum)
if [ "$CKSUM" != '202886188 443186' ]; then
if [ "$CKSUM" != '519771253 443186' ]; then
echo "ERROR: -g request unexpected cksum: $CKSUM"
exit 1
fi
......
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