Commit a10b82d9 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add "send" command for explicitly sending bytestrings



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2799 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent f7ff8aa5
......@@ -511,6 +511,27 @@ cmd_http_txreq(CMD_ARGS)
vsb_delete(vsb);
}
/**********************************************************************
* Send a string
*/
static void
cmd_http_send(CMD_ARGS)
{
struct http *hp;
int i;
(void)cmd;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AN(av[1]);
AZ(av[2]);
vtc_dump(hp->vl, 4, "send", av[1]);
i = write(hp->fd, av[1], strlen(av[1]));
assert(i == strlen(av[1]));
}
/**********************************************************************
* Execute HTTP specifications
*/
......@@ -521,6 +542,7 @@ static struct cmds http_cmds[] = {
{ "txresp", cmd_http_txresp },
{ "rxresp", cmd_http_rxresp },
{ "expect", cmd_http_expect },
{ "send", cmd_http_send },
{ "delay", cmd_delay },
{ NULL, NULL }
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment