Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
e2dbf214
Commit
e2dbf214
authored
Jun 21, 2021
by
Guillaume Quintard
Committed by
Dridi Boukelmoune
Aug 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ncsa] -j will escape control characters
parent
84e99267
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
5 deletions
+40
-5
varnishncsa.c
bin/varnishncsa/varnishncsa.c
+7
-5
u00017.vtc
bin/varnishtest/tests/u00017.vtc
+31
-0
changes.rst
doc/changes.rst
+2
-0
No files found.
bin/varnishncsa/varnishncsa.c
View file @
e2dbf214
...
...
@@ -572,7 +572,7 @@ addf_vsl(enum VSL_tag_e tag, long i, const char *prefix)
ALLOC_OBJ
(
w
,
VSL_WATCH_MAGIC
);
AN
(
w
);
if
(
VSL_tagflags
[
tag
])
if
(
VSL_tagflags
[
tag
]
&&
CTX
.
quote_how
!=
VSB_QUOTE_JSON
)
VUT_Error
(
vut
,
1
,
"Tag %s can contain control characters"
,
VSL_tags
[
tag
]);
w
->
tag
=
tag
;
...
...
@@ -921,7 +921,6 @@ process_vsl(const struct vsl_watch_head *head, enum VSL_tag_e tag,
{
struct
vsl_watch
*
w
;
const
char
*
p
;
VTAILQ_FOREACH
(
w
,
head
,
list
)
{
CHECK_OBJ_NOTNULL
(
w
,
VSL_WATCH_MAGIC
);
if
(
tag
!=
w
->
tag
)
...
...
@@ -966,13 +965,16 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
skip
=
0
;
while
(
skip
==
0
&&
1
==
VSL_Next
(
t
->
c
))
{
tag
=
VSL_TAG
(
t
->
c
->
rec
.
ptr
);
if
(
VSL_tagflags
[
tag
])
if
(
VSL_tagflags
[
tag
]
&&
CTX
.
quote_how
!=
VSB_QUOTE_JSON
)
continue
;
b
=
VSL_CDATA
(
t
->
c
->
rec
.
ptr
);
e
=
b
+
VSL_LEN
(
t
->
c
->
rec
.
ptr
);
if
(
!
VSL_tagflags
[
tag
])
{
while
(
e
>
b
&&
e
[
-
1
]
==
'\0'
)
e
--
;
}
switch
(
tag
)
{
case
SLT_HttpGarbage
:
...
...
bin/varnishtest/tests/u00017.vtc
0 → 100644
View file @
e2dbf214
varnishtest "SLT_Debug can be printed by varnishncsa -j"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
import cookie;
sub vcl_recv {
cookie.parse("");
}
} -start
varnish v1 -cliok "param.show vsl_mask +Debug"
client c1 {
txreq
rxresp
} -run
# Let's fist create a script to reduce in all the variants below.
shell {
varnishncsa -d -n ${v1_name} -F '%{VSL:Debug}x' -j | grep "^cookie: nothing to parse\\\\u0000"
}
shell -err -expect "Tag Debug can contain control characters" {
varnishncsa -d -n ${v1_name} -F '%{VSL:Debug}x'
}
doc/changes.rst
View file @
e2dbf214
...
...
@@ -57,6 +57,8 @@ Varnish Cache 7.x.x (2021-09-15)
* ACLs default to `pedantic` which is now a per-ACL feature flag.
* `varnishncsa -j` will now accept to print fields with control characters.
================================
Varnish Cache 6.6.0 (2021-03-15)
================================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment