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
b00cbb23
Commit
b00cbb23
authored
Feb 22, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow user defined sub{}'s to return without specifing a handling.
parent
5f0bc825
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
v00034.vtc
bin/varnishtest/tests/v00034.vtc
+23
-0
vcc_action.c
lib/libvcc/vcc_action.c
+5
-0
No files found.
bin/varnishtest/tests/v00034.vtc
View file @
b00cbb23
...
@@ -24,3 +24,26 @@ varnish v1 -errvcl {Probe 'p1' redefined} {
...
@@ -24,3 +24,26 @@ varnish v1 -errvcl {Probe 'p1' redefined} {
probe p1 { }
probe p1 { }
backend s1 { .host = "127.0.0.1"; .probe = p1;}
backend s1 { .host = "127.0.0.1"; .probe = p1;}
}
}
varnish v1 -errvcl {Expected '(' got ';'} {
backend s1 { .host = "127.0.0.1"; }
sub vcl_recv { return; }
}
varnish v1 -vcl+backend {
sub foobar {
set resp.http.foo = "foo";
return;
set resp.http.foo = "bar";
}
sub vcl_deliver {
call foobar;
}
}
client c1 {
txreq
rxresp
expect resp.http.foo == "foo"
} -run
lib/libvcc/vcc_action.c
View file @
b00cbb23
...
@@ -284,6 +284,11 @@ parse_return(struct vcc *tl)
...
@@ -284,6 +284,11 @@ parse_return(struct vcc *tl)
const
char
*
h
;
const
char
*
h
;
vcc_NextToken
(
tl
);
vcc_NextToken
(
tl
);
if
(
tl
->
t
->
tok
==
';'
&&
tl
->
fb
==
tl
->
fc
)
{
/* fb == fc means we're in a subroutine */
Fb
(
tl
,
1
,
"return;
\n
"
);
return
;
}
ExpectErr
(
tl
,
'('
);
ExpectErr
(
tl
,
'('
);
vcc_NextToken
(
tl
);
vcc_NextToken
(
tl
);
ExpectErr
(
tl
,
ID
);
ExpectErr
(
tl
,
ID
);
...
...
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