r2799 - trunk/varnish-cache/bin/varnishtest

phk at projects.linpro.no phk at projects.linpro.no
Wed Jun 25 11:58:31 CEST 2008


Author: phk
Date: 2008-06-25 11:58:31 +0200 (Wed, 25 Jun 2008)
New Revision: 2799

Modified:
   trunk/varnish-cache/bin/varnishtest/vtc_http.c
Log:
Add "send" command for explicitly sending bytestrings



Modified: trunk/varnish-cache/bin/varnishtest/vtc_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_http.c	2008-06-25 09:57:54 UTC (rev 2798)
+++ trunk/varnish-cache/bin/varnishtest/vtc_http.c	2008-06-25 09:58:31 UTC (rev 2799)
@@ -512,6 +512,27 @@
 }
 
 /**********************************************************************
+ * 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 @@
 	{ "txresp",	cmd_http_txresp },
 	{ "rxresp",	cmd_http_rxresp },
 	{ "expect",	cmd_http_expect },
+	{ "send",	cmd_http_send },
 	{ "delay",	cmd_delay },
 	{ NULL,		NULL }
 };




More information about the varnish-commit mailing list