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
e464a940
Commit
e464a940
authored
Oct 15, 2020
by
Poul-Henning Kamp
Committed by
Dridi Boukelmoune
Oct 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the "loop" word up to global level, so it works everywhere.
parent
d4135153
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
24 deletions
+19
-24
vtc.c
bin/varnishtest/vtc.c
+19
-0
vtc_http.c
bin/varnishtest/vtc_http.c
+0
-24
No files found.
bin/varnishtest/vtc.c
View file @
e464a940
...
...
@@ -306,6 +306,7 @@ parse_string(const char *spec, const struct cmds *cmd, void *priv,
char
*
e
,
*
p
,
*
q
,
*
f
,
*
buf
;
int
nest_brace
;
int
tn
;
unsigned
n
,
m
;
const
struct
cmds
*
cp
;
AN
(
spec
);
...
...
@@ -414,6 +415,24 @@ parse_string(const char *spec, const struct cmds *cmd, void *priv,
}
}
/* SECTION: loop loop
*
* loop NUMBER STRING
* Process STRING as a specification, NUMBER times.
*
* This works inside all specification strings
*/
if
(
!
strcmp
(
token_s
[
0
],
"loop"
))
{
n
=
strtoul
(
token_s
[
1
],
NULL
,
0
);
for
(
m
=
0
;
m
<
n
;
m
++
)
{
vtc_log
(
vl
,
4
,
"Loop #%u"
,
m
);
parse_string
(
token_s
[
2
],
cmd
,
priv
,
vl
);
}
continue
;
}
for
(
cp
=
cmd
;
cp
->
name
!=
NULL
;
cp
++
)
if
(
!
strcmp
(
token_s
[
0
],
cp
->
name
))
break
;
...
...
bin/varnishtest/vtc_http.c
View file @
e464a940
...
...
@@ -1616,29 +1616,6 @@ cmd_http_accept(CMD_ARGS)
vtc_log
(
vl
,
3
,
"Accepted socket fd is %d"
,
hp
->
fd
);
}
/* SECTION: client-server.spec.loop
*
* loop NUMBER STRING
* Process STRING as a specification, NUMBER times.
*/
static
void
cmd_http_loop
(
CMD_ARGS
)
{
struct
http
*
hp
;
unsigned
n
,
m
;
CAST_OBJ_NOTNULL
(
hp
,
priv
,
HTTP_MAGIC
);
AN
(
av
[
1
]);
AN
(
av
[
2
]);
AZ
(
av
[
3
]);
n
=
strtoul
(
av
[
1
],
NULL
,
0
);
for
(
m
=
1
;
m
<=
n
;
m
++
)
{
vtc_log
(
vl
,
4
,
"Loop #%u"
,
m
);
parse_string
(
av
[
2
],
cmd
,
hp
,
vl
);
}
}
/* SECTION: client-server.spec.fatal
*
* fatal|non_fatal
...
...
@@ -1820,7 +1797,6 @@ const struct cmds http_cmds[] = {
/* spec */
CMD_HTTP
(
fatal
)
CMD_HTTP
(
loop
)
CMD_HTTP
(
non_fatal
)
/* body */
...
...
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