Commit 552d9567 authored by Geoff Simmons's avatar Geoff Simmons

Explicitly double-quote data for binary tags, since VSB_quote doesn't

do that any more. But will have to revisit the formatting, because
Varnish VSL and its tools apparently don't use VSB_quote for binary
data any more.
parent 79811875
Pipeline #132 skipped
......@@ -796,6 +796,10 @@ format_VCL_Log(const tx_t *tx, const arg_t *args, char **s, size_t *len)
*len = strlen(l);
}
/*
* XXX: apparently none of VSL, varnishlog or varnishncsa use VSB_quote
* for SLT_F_BINARY any more.
*/
void
format_SLT(const tx_t *tx, const arg_t *args, char **s, size_t *len)
{
......@@ -804,7 +808,9 @@ format_SLT(const tx_t *tx, const arg_t *args, char **s, size_t *len)
for (int i = 0; i < *len; i++)
if (!isprint(*(*s + i))) {
VSB_clear(scratch);
VSB_putc(scratch, '\"');
VSB_quote(scratch, *s, (int) *len, 0);
VSB_putc(scratch, '\"');
VSB_finish(scratch);
*s = VSB_data(scratch);
*len = VSB_len(scratch);
......
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