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
c55e3220
Commit
c55e3220
authored
Mar 12, 2016
by
Poul-Henning Kamp
Committed by
Lasse Karstensen
Jun 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an "expect_pattern" verb, which expects a "01234567012345..."
pattern in the body.
parent
b5ddc7ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
vtc_http.c
bin/varnishtest/vtc_http.c
+25
-0
No files found.
bin/varnishtest/vtc_http.c
View file @
c55e3220
...
...
@@ -298,6 +298,30 @@ cmd_http_expect(CMD_ARGS)
av
[
0
],
clhs
,
cmp
,
crhs
,
retval
?
"match"
:
"failed"
);
}
static
void
cmd_http_expect_pattern
(
CMD_ARGS
)
{
char
*
p
;
struct
http
*
hp
;
char
t
=
'0'
;
(
void
)
cmd
;
(
void
)
vl
;
CAST_OBJ_NOTNULL
(
hp
,
priv
,
HTTP_MAGIC
);
AZ
(
strcmp
(
av
[
0
],
"expect_pattern"
));
av
++
;
AZ
(
av
[
0
]);
for
(
p
=
hp
->
body
;
*
p
!=
'\0'
;
p
++
)
{
if
(
*
p
!=
t
)
vtc_log
(
hp
->
vl
,
0
,
"EXPECT PATTERN FAIL @%zd should 0x%02x is 0x%02x"
,
p
-
hp
->
body
,
t
,
*
p
);
t
+=
1
;
t
&=
~
0x08
;
}
vtc_log
(
hp
->
vl
,
4
,
"EXPECT PATTERN SUCCESS"
);
}
/**********************************************************************
* Split a HTTP protocol header
*/
...
...
@@ -1345,6 +1369,7 @@ static const struct cmds http_cmds[] = {
{
"rxrespbody"
,
cmd_http_rxrespbody
},
{
"gunzip"
,
cmd_http_gunzip_body
},
{
"expect"
,
cmd_http_expect
},
{
"expect_pattern"
,
cmd_http_expect_pattern
},
{
"recv"
,
cmd_http_recv
},
{
"send"
,
cmd_http_send
},
{
"send_n"
,
cmd_http_send_n
},
...
...
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