r447 - trunk/varnish-cache/bin/varnishtester

phk at projects.linpro.no phk at projects.linpro.no
Tue Jul 11 23:35:31 CEST 2006


Author: phk
Date: 2006-07-11 23:35:31 +0200 (Tue, 11 Jul 2006)
New Revision: 447

Modified:
   trunk/varnish-cache/bin/varnishtester/varnishtester.c
Log:
EOF detection in libevent is buggy ??  Add exit cmd.

Pause after cli until we see "OK"



Modified: trunk/varnish-cache/bin/varnishtester/varnishtester.c
===================================================================
--- trunk/varnish-cache/bin/varnishtester/varnishtester.c	2006-07-11 21:30:38 UTC (rev 446)
+++ trunk/varnish-cache/bin/varnishtester/varnishtester.c	2006-07-11 21:35:31 UTC (rev 447)
@@ -218,6 +218,8 @@
 		printf("V: <<%s>>\n", p);
 		if (!strcmp(p, "Child said <Ready>"))
 			Resume();
+		else if (!strcmp(p, "OK"))
+			Resume();
 	}
 }
 
@@ -305,6 +307,7 @@
 	}
 	cli_write(av[0]);
 	cli_write("\n");
+	Pause();
 }
 
 /*--------------------------------------------------------------------*/
@@ -461,6 +464,18 @@
 
 /*--------------------------------------------------------------------*/
 
+static void
+cmd_exit(char **av)
+{
+
+	(void)av;
+	cmd_close(NULL);
+	cmd_stop(NULL);
+	exit (0);
+}
+
+/*--------------------------------------------------------------------*/
+
 static struct bufferevent *e_cmd;
 static int run = 1;
 
@@ -500,6 +515,8 @@
 			cmd_close(av + 2);
 		else if (!strcmp(av[1], "req"))
 			cmd_req(av + 2);
+		else if (!strcmp(av[1], "exit"))
+			cmd_exit(av + 2);
 		else {
 			fprintf(stderr, "Unknown command \"%s\"\n", av[1]);
 			exit (2);




More information about the varnish-commit mailing list