r57 - in trunk/varnish-cache: bin/varnishd lib/libvarnish

phk at projects.linpro.no phk at projects.linpro.no
Thu Mar 16 13:14:59 CET 2006


Author: phk
Date: 2006-03-16 13:14:59 +0100 (Thu, 16 Mar 2006)
New Revision: 57

Modified:
   trunk/varnish-cache/bin/varnishd/cache_main.c
   trunk/varnish-cache/bin/varnishd/cli_event.c
   trunk/varnish-cache/bin/varnishd/varnishd.c
   trunk/varnish-cache/lib/libvarnish/argv.c
   trunk/varnish-cache/lib/libvarnish/cli.c
Log:
cleanup


Modified: trunk/varnish-cache/bin/varnishd/cache_main.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_main.c	2006-03-16 10:48:50 UTC (rev 56)
+++ trunk/varnish-cache/bin/varnishd/cache_main.c	2006-03-16 12:14:59 UTC (rev 57)
@@ -4,6 +4,7 @@
 
 #include <stdio.h>
 #include <assert.h>
+#include <stdlib.h>
 #include <sys/time.h>
 
 #include <event.h>
@@ -12,6 +13,7 @@
 #include <cli_priv.h>
 
 #include "heritage.h"
+#include "cli_event.h"
 
 static struct event ev_keepalive;
 
@@ -55,7 +57,7 @@
 /*--------------------------------------------------------------------*/
 
 static struct cli_proto cli_proto[] = {
-	{ CLI_PING },
+	{ CLI_PING,		cli_func_ping },
 	{ NULL }
 };
 

Modified: trunk/varnish-cache/bin/varnishd/cli_event.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cli_event.c	2006-03-16 10:48:50 UTC (rev 56)
+++ trunk/varnish-cache/bin/varnishd/cli_event.c	2006-03-16 12:14:59 UTC (rev 57)
@@ -6,6 +6,7 @@
 #include <assert.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <ctype.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <signal.h>
@@ -50,7 +51,7 @@
 static void
 encode_output(struct cli *cli)
 {
-	const char *p, *q;
+	char *p, *q;
 
 	if (cli->verbose) {
 		if (cli->result != CLIS_OK)
@@ -64,7 +65,7 @@
 	}
 	evbuffer_add_printf(cli->bev1->output, "%d \"", cli->result);
 	for (p = q = sbuf_data(cli->sb); *p != '\0'; p++) {
-		if (*p != '"' && *p != '\\' && isgraph(*p) || *p == ' ')
+		if ((*p != '"' && *p != '\\' && isgraph(*p)) || *p == ' ')
 			continue;
 		if (p != q) 
 			evbuffer_add(cli->bev1->output, q, p - q);
@@ -83,10 +84,7 @@
 rdcb(struct bufferevent *bev, void *arg)
 {
 	const char *p;
-	char **av;
 	struct cli *cli = arg;
-	unsigned u;
-	struct cli_proto *cp;
 
 	p = evbuffer_readline(bev->input);
 	if (p == NULL)

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2006-03-16 10:48:50 UTC (rev 56)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2006-03-16 12:14:59 UTC (rev 57)
@@ -2,14 +2,16 @@
  * $Id$
  */
 
+#include <assert.h>
+#include <err.h>
 #include <errno.h>
-#include <assert.h>
+#include <fcntl.h>
+#include <signal.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <time.h>
 #include <unistd.h>
-#include <signal.h>
-#include <fcntl.h>
 
 #include <sys/wait.h>
 
@@ -27,7 +29,7 @@
 
 static enum {
 	H_STOP = 0,
-	H_START,
+	H_START
 }	desired;
 static pid_t	child_pid;
 static int	child_fds[2];
@@ -55,7 +57,7 @@
 std_wrcb(struct bufferevent *bev, void *arg)
 {
 
-	printf("%s(%p, %p)\n", __func__, bev, arg);
+	printf("%s(%p, %p)\n", __func__, (void*)bev, arg);
 	exit (2);
 }
 
@@ -63,7 +65,7 @@
 std_excb(struct bufferevent *bev, short what, void *arg)
 {
 
-	printf("%s(%p, %d, %p)\n", __func__, bev, what, arg);
+	printf("%s(%p, %d, %p)\n", __func__, (void*)bev, what, arg);
 	exit (2);
 }
 

Modified: trunk/varnish-cache/lib/libvarnish/argv.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/argv.c	2006-03-16 10:48:50 UTC (rev 56)
+++ trunk/varnish-cache/lib/libvarnish/argv.c	2006-03-16 12:14:59 UTC (rev 57)
@@ -23,6 +23,7 @@
 BackSlash(const char *s, int *res)
 {
 	int i, r;
+	unsigned u;
 
 	assert(*s == '\\');
 	r = i = 0;
@@ -59,8 +60,10 @@
 		}
 		break;
 	case 'x':
-		if (1 == sscanf(s + 1, "x%02x", &i))
+		if (1 == sscanf(s + 1, "x%02x", &u)) {
+			i = u;
 			r = 4;
+		}
 		break;
 	default:
 		break;

Modified: trunk/varnish-cache/lib/libvarnish/cli.c
===================================================================
--- trunk/varnish-cache/lib/libvarnish/cli.c	2006-03-16 10:48:50 UTC (rev 56)
+++ trunk/varnish-cache/lib/libvarnish/cli.c	2006-03-16 12:14:59 UTC (rev 57)
@@ -5,6 +5,7 @@
  */
 
 #include <ctype.h>
+#include <string.h>
 #include <stdio.h>
 
 #include <cli.h>
@@ -20,7 +21,6 @@
 void
 cli_func_help(struct cli *cli, char **av, void *priv)
 {
-	unsigned u;
 	struct cli_proto *cp;
 
 	if (av[2] == NULL) {




More information about the varnish-commit mailing list