Commit c0410e4f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

escape control characters in SLT_Debug as %XX



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@916 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 81770ead
...@@ -291,6 +291,17 @@ VSL_H_Print(void *priv, unsigned tag, unsigned fd, unsigned len, unsigned spec, ...@@ -291,6 +291,17 @@ VSL_H_Print(void *priv, unsigned tag, unsigned fd, unsigned len, unsigned spec,
assert(fo != NULL); assert(fo != NULL);
if (tag == SLT_Debug) { if (tag == SLT_Debug) {
fprintf(fo, "%5d %-12s %c \"", fd, VSL_tags[tag],
((spec & VSL_S_CLIENT) ? 'c' : (spec & VSL_S_BACKEND) ? 'b' : ' '));
while (len-- > 0) {
if (*ptr >= ' ' && *ptr <= '~')
fprintf(fo, "%c", *ptr);
else
fprintf(fo, "%%%02x", *ptr);
ptr++;
}
fprintf(fo, "\"\n");
return (0);
} }
fprintf(fo, "%5d %-12s %c %.*s\n", fprintf(fo, "%5d %-12s %c %.*s\n",
fd, VSL_tags[tag], fd, VSL_tags[tag],
......
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