Commit 49a2600e authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Quote VSL fields that are known to contain spaces

The test case covers the last field of Backend_health records.
parent e6193fb4
......@@ -508,7 +508,7 @@ vca_accept_task(struct worker *wrk, void *arg)
lport, VTCP_PORTBUFSIZE);
}
VSL(SLT_SessError, 0, "%s %s %s %d %d %s",
VSL(SLT_SessError, 0, "%s %s %s %d %d \"%s\"",
wa.acceptlsock->name, laddr, lport,
ls->sock, i, vstrerror(i));
(void)Pool_TrySumstat(wrk);
......
......@@ -181,7 +181,7 @@ VBP_Update_Backend(struct vbp_target *vt)
vt->backend->sick = i;
AN(dir->vcl_name);
VSL(SLT_Backend_health, 0, "%s %s %s %s %u %u %u %.6f %.6f %s",
VSL(SLT_Backend_health, 0, "%s %s %s %s %u %u %u %.6f %.6f \"%s\"",
dir->vcl_name, chg ? "Went" : "Still",
i ? "sick" : "healthy", bits,
vt->good, vt->threshold, vt->window,
......
varnishtest "VSL quoted fields"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl {
import std;
backend be none;
backend be {
.host = "${s1_sock}";
.probe = { .interval = 1m; }
}
sub vcl_recv {
# a series of 3-fields log records
std.log({" custom log "ok" "});
......@@ -24,3 +32,10 @@ client c1 {
shell -expect "2" {
varnishlog -d -n ${v1_name} -g raw -q 'VCL_Log[3]' | wc -l
}
server s1 -wait
shell -expect "Went healthy" {
varnishlog -d -n ${v1_name} -g raw \
-q 'Backend_health[10] eq "HTTP/1.1 200 OK"'
}
......@@ -191,7 +191,7 @@ SLTM(Length, 0, "Size of object body",
SLTM(FetchError, 0, "Error while fetching object",
"Logs the error message of a failed fetch operation.\n\n"
"Error messages should be self-explanatory, yet the http connection"
"Error messages should be self-explanatory, yet the http connection\n"
"(HTC) class of errors is reported with these symbols:\n\n"
"\t* junk (-5): Received unexpected data\n"
"\t* close (-4): Connection closed\n"
......@@ -272,11 +272,11 @@ SLTM(TTL, 0, "TTL set on object",
SLTM(Fetch_Body, 0, "Body fetched from backend",
"Ready to fetch body from backend.\n\n"
"The format is::\n\n"
"\t%d (%s) %s\n"
"\t%d %s %s\n"
"\t| | |\n"
"\t| | +---- 'stream' or '-'\n"
"\t| +--------- Text description of body fetch mode\n"
"\t+------------- Body fetch mode\n"
"\t| +------- Text description of body fetch mode\n"
"\t+---------- Body fetch mode\n"
"\n"
)
......
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