From 498303b69bb514d3e3c3ea56af56d6d1bc93406c Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 25 Jun 2008 09:58:31 +0000 Subject: [PATCH] Add "send" command for explicitly sending bytestrings git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2799 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishtest/vtc_http.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/varnish-cache/bin/varnishtest/vtc_http.c b/varnish-cache/bin/varnishtest/vtc_http.c index def5f93a..ab7272b9 100644 --- a/varnish-cache/bin/varnishtest/vtc_http.c +++ b/varnish-cache/bin/varnishtest/vtc_http.c @@ -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 } }; -- 2.39.5