]> err.no Git - varnish/commitdiff
Add "send" command for explicitly sending bytestrings
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 25 Jun 2008 09:58:31 +0000 (09:58 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 25 Jun 2008 09:58:31 +0000 (09:58 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2799 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/vtc_http.c

index def5f93a6bae64a00e948981446fa6364db81033..ab7272b90cdf8d03c661936fe51734dae6574cc9 100644 (file)
@@ -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 }
 };