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
acf8703d
Commit
acf8703d
authored
Mar 10, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a facility for sending a string a number of times.
parent
7af85ac4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
vtc_http.c
bin/varnishtest/vtc_http.c
+29
-0
No files found.
bin/varnishtest/vtc_http.c
View file @
acf8703d
...
...
@@ -996,6 +996,34 @@ cmd_http_send(CMD_ARGS)
strerror
(
errno
));
}
/**********************************************************************
* Send a string many times
*/
static
void
cmd_http_send_n
(
CMD_ARGS
)
{
struct
http
*
hp
;
int
i
,
n
,
l
;
(
void
)
cmd
;
(
void
)
vl
;
CAST_OBJ_NOTNULL
(
hp
,
priv
,
HTTP_MAGIC
);
AN
(
av
[
1
]);
AN
(
av
[
2
]);
AZ
(
av
[
3
]);
n
=
strtoul
(
av
[
1
],
NULL
,
0
);
vtc_dump
(
hp
->
vl
,
4
,
"send_n"
,
av
[
2
],
-
1
);
l
=
strlen
(
av
[
2
]);
while
(
n
--
)
{
i
=
write
(
hp
->
fd
,
av
[
2
],
l
);
if
(
i
!=
l
)
vtc_log
(
hp
->
vl
,
hp
->
fatal
,
"Write error in http_send(): %s"
,
strerror
(
errno
));
}
}
/**********************************************************************
* Send a hex string
*/
...
...
@@ -1260,6 +1288,7 @@ static const struct cmds http_cmds[] = {
{
"gunzip"
,
cmd_http_gunzip_body
},
{
"expect"
,
cmd_http_expect
},
{
"send"
,
cmd_http_send
},
{
"send_n"
,
cmd_http_send_n
},
{
"sendhex"
,
cmd_http_sendhex
},
{
"chunked"
,
cmd_http_chunked
},
{
"chunkedlen"
,
cmd_http_chunkedlen
},
...
...
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