r450 - trunk/varnish-cache/bin/varnishtester

phk at projects.linpro.no phk at projects.linpro.no
Wed Jul 12 10:44:57 CEST 2006


Author: phk
Date: 2006-07-12 10:44:56 +0200 (Wed, 12 Jul 2006)
New Revision: 450

Modified:
   trunk/varnish-cache/bin/varnishtester/varnishtester.c
Log:
Always insert a backend when vcl is compiled.

Respect '#' comments in script file.



Modified: trunk/varnish-cache/bin/varnishtester/varnishtester.c
===================================================================
--- trunk/varnish-cache/bin/varnishtester/varnishtester.c	2006-07-12 08:34:48 UTC (rev 449)
+++ trunk/varnish-cache/bin/varnishtester/varnishtester.c	2006-07-12 08:44:56 UTC (rev 450)
@@ -328,6 +328,15 @@
 	cli_write("config.inline ");
 	cli_write(av[0]);
 	cli_write(" \"");
+
+	/* Always insert our magic backend first */
+
+	cli_write(
+	    "backend default {\\n"
+	    "    set backend.host = \\\"localhost\\\";\\n"
+	    "    set backend.port = \\\"8081\\\";\\n"
+	    "}\\n");
+
 	for (p = av[1]; *p; p++) {
 		if (*p < ' ' || *p == '"' || *p == '\\' || *p > '~') {
 			sprintf(buf, "\\%03o", *p);
@@ -493,13 +502,13 @@
 		if (p == NULL)
 			return;
 		printf("]: <<%s>>\n", p);
-		av = ParseArgv(p, 0);
+		av = ParseArgv(p, 1);
 		if (av[0] != NULL) {
 			fprintf(stderr, "%s\n", av[0]);
 			exit (1);
 		}
 		if (av[1] == NULL)
-			return;
+			continue;
 		if (!strcmp(av[1], "start"))
 			cmd_start(av + 2);
 		else if (!strcmp(av[1], "stop"))




More information about the varnish-commit mailing list