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
3ba970ec
Commit
3ba970ec
authored
Jul 29, 2015
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Teach vmodtool.py's tokenizer quotes
parent
8af37f4c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
9 deletions
+27
-9
m00019.vtc
bin/varnishtest/tests/m00019.vtc
+6
-6
vmodtool.py
lib/libvcc/vmodtool.py
+16
-0
vmod.vcc
lib/libvmod_debug/vmod.vcc
+2
-1
vmod_debug.c
lib/libvmod_debug/vmod_debug.c
+3
-2
No files found.
bin/varnishtest/tests/m00019.vtc
View file @
3ba970ec
...
@@ -22,12 +22,12 @@ client c1 {
...
@@ -22,12 +22,12 @@ client c1 {
txreq
txreq
rxresp
rxresp
expect resp.bodylen == "6"
expect resp.bodylen == "6"
expect resp.http.foo1 == "1 2 3"
expect resp.http.foo1 == "1 2 3
,
"
expect resp.http.foo2 == "1 2 3"
expect resp.http.foo2 == "1 2 3
,
"
expect resp.http.foo3 == "1 2 3"
expect resp.http.foo3 == "1 2 3
,
"
expect resp.http.foo4 == "1 2 3"
expect resp.http.foo4 == "1 2 3
,
"
expect resp.http.foo5 == "1 2 3"
expect resp.http.foo5 == "1 2 3
,
"
expect resp.http.foo6 == "1 2 3"
expect resp.http.foo6 == "1 2 3
,
"
} -run
} -run
delay .1
delay .1
...
...
lib/libvcc/vmodtool.py
View file @
3ba970ec
...
@@ -739,6 +739,22 @@ class FileSection(object):
...
@@ -739,6 +739,22 @@ class FileSection(object):
return
return
l
=
re
.
sub
(
"[
\t
]*#.*$"
,
""
,
l
)
l
=
re
.
sub
(
"[
\t
]*#.*$"
,
""
,
l
)
l
=
re
.
sub
(
"[
\t
]*
\n
"
,
""
,
l
)
l
=
re
.
sub
(
"[
\t
]*
\n
"
,
""
,
l
)
if
re
.
match
(
"['
\"
]"
,
l
):
m
=
re
.
match
(
"(['
\"
]).*?(
\\
1)"
,
l
)
if
not
m
:
raise
FormatError
(
"Unbalanced quote"
,
"Unbalanced quote on line
%
d"
%
ln
)
self
.
tl
.
append
(
Token
(
ln
,
0
,
l
[:
m
.
end
()]))
self
.
l
.
insert
(
0
,
(
ln
,
l
[
m
.
end
():]))
return
m
=
re
.
search
(
"['
\"
]"
,
l
)
if
m
:
rest
=
l
[
m
.
start
():]
self
.
l
.
insert
(
0
,
(
ln
,
rest
))
l
=
l
[:
m
.
start
()]
l
=
re
.
sub
(
"([(){},=])"
,
r' \1 '
,
l
)
l
=
re
.
sub
(
"([(){},=])"
,
r' \1 '
,
l
)
if
l
==
""
:
if
l
==
""
:
return
return
...
...
lib/libvmod_debug/vmod.vcc
View file @
3ba970ec
...
@@ -94,7 +94,8 @@ $Function VOID rot52(HTTP hdr)
...
@@ -94,7 +94,8 @@ $Function VOID rot52(HTTP hdr)
Encrypt the HTTP header with quad-ROT13 encryption,
Encrypt the HTTP header with quad-ROT13 encryption,
(this is approx 33% better than triple-DES).
(this is approx 33% better than triple-DES).
$Function STRING argtest(STRING one, REAL two=2, STRING three="3")
$Function STRING argtest(STRING one, REAL two=2, STRING three="3",
STRING comma=",")
$Function INT vre_limit()
$Function INT vre_limit()
...
...
lib/libvmod_debug/vmod_debug.c
View file @
3ba970ec
...
@@ -177,11 +177,12 @@ vmod_rot52(VRT_CTX, VCL_HTTP hp)
...
@@ -177,11 +177,12 @@ vmod_rot52(VRT_CTX, VCL_HTTP hp)
}
}
VCL_STRING
VCL_STRING
vmod_argtest
(
VRT_CTX
,
VCL_STRING
one
,
VCL_REAL
two
,
VCL_STRING
three
)
vmod_argtest
(
VRT_CTX
,
VCL_STRING
one
,
VCL_REAL
two
,
VCL_STRING
three
,
VCL_STRING
comma
)
{
{
char
buf
[
100
];
char
buf
[
100
];
bprintf
(
buf
,
"%s %g %s
"
,
one
,
two
,
three
);
bprintf
(
buf
,
"%s %g %s
%s"
,
one
,
two
,
three
,
comma
);
return
WS_Copy
(
ctx
->
ws
,
buf
,
-
1
);
return
WS_Copy
(
ctx
->
ws
,
buf
,
-
1
);
}
}
...
...
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