r5216 - trunk/varnish-cache/bin/varnishtest

phk at varnish-cache.org phk at varnish-cache.org
Wed Sep 15 21:00:29 CEST 2010


Author: phk
Date: 2010-09-15 21:00:29 +0200 (Wed, 15 Sep 2010)
New Revision: 5216

Modified:
   trunk/varnish-cache/bin/varnishtest/vtc_http.c
Log:
Make it possible to supress the automatic content-length header.



Modified: trunk/varnish-cache/bin/varnishtest/vtc_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_http.c	2010-09-15 11:31:02 UTC (rev 5215)
+++ trunk/varnish-cache/bin/varnishtest/vtc_http.c	2010-09-15 19:00:29 UTC (rev 5216)
@@ -508,6 +508,7 @@
 	int bodylen = 0;
 	char *b, *c;
 	char *body = NULL, *nullbody;
+	int nolen = 0;
 
 
 	(void)cmd;
@@ -541,7 +542,9 @@
 	vsb_printf(hp->vsb, "%s %s %s%s", proto, status, msg, nl);
 
 	for(; *av != NULL; av++) {
-		if (!strcmp(*av, "-hdr")) {
+		if (!strcmp(*av, "-nolen")) {
+			nolen = 1;
+		} else if (!strcmp(*av, "-hdr")) {
 			vsb_printf(hp->vsb, "%s%s", av[1], nl);
 			av++;
 		} else
@@ -575,7 +578,7 @@
 	}
 	if (*av != NULL)
 		vtc_log(hp->vl, 0, "Unknown http txresp spec: %s\n", *av);
-	if (body != NULL)
+	if (body != NULL && !nolen)
 		vsb_printf(hp->vsb, "Content-Length: %d%s", bodylen, nl);
 	vsb_cat(hp->vsb, nl);
 	if (body != NULL)




More information about the varnish-commit mailing list