From: phk Date: Tue, 2 Jan 2007 13:41:08 +0000 (+0000) Subject: Polish as result of flexelint run and record a couple of thoughts. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19d4e759c479fe07dd6ca71fc334d978dfd11ccc;p=varnish Polish as result of flexelint run and record a couple of thoughts. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1231 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_pass.c b/varnish-cache/bin/varnishd/cache_pass.c index 3861c98a..a7293b7f 100644 --- a/varnish-cache/bin/varnishd/cache_pass.c +++ b/varnish-cache/bin/varnishd/cache_pass.c @@ -29,6 +29,9 @@ * $Id$ * * XXX: charge bytes to srcaddr + * XXX: buffer to relieve backed ASAP. + * XXX: Check if response has any body + * XXX: Don't pass chunked to HTTP/1.0 client */ #include diff --git a/varnish-cache/bin/varnishd/common.h b/varnish-cache/bin/varnishd/common.h index a46f36b0..70719aa9 100644 --- a/varnish-cache/bin/varnishd/common.h +++ b/varnish-cache/bin/varnishd/common.h @@ -46,4 +46,3 @@ void TCP_myname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen); int TCP_parse(const char *str, char **addr, char **port); int TCP_open(const char *addr, const char *port, int http); void TCP_check(struct cli *cli, const char *addr, const char *port); - diff --git a/varnish-cache/bin/varnishd/storage_file.c b/varnish-cache/bin/varnishd/storage_file.c index 229cfe54..9fb728e3 100644 --- a/varnish-cache/bin/varnishd/storage_file.c +++ b/varnish-cache/bin/varnishd/storage_file.c @@ -123,7 +123,7 @@ smf_calcsize(struct smf_sc *sc, const char *size, int newfile) off_t o; struct stat st; - AN(sc != NULL); + AN(sc); AZ(fstat(sc->fd, &st)); #if defined(HAVE_SYS_STATVFS_H) || defined(HAVE_SYS_VFS_H) diff --git a/varnish-cache/bin/varnishd/varnishd.c b/varnish-cache/bin/varnishd/varnishd.c index 90b88b50..0f21ed16 100644 --- a/varnish-cache/bin/varnishd/varnishd.c +++ b/varnish-cache/bin/varnishd/varnishd.c @@ -216,10 +216,12 @@ tackle_warg(const char *argv) switch (sscanf(argv, "%u,%u,%u", &ua, &ub, &uc)) { case 3: params->wthread_timeout = uc; + /* FALLTHROUGH */ case 2: if (ub < ua) usage(); params->wthread_max = ub; + /* FALLTHROUGH */ case 1: if (ua < 1) usage(); @@ -386,6 +388,21 @@ main(int argc, char *argv[]) cli[0].result = CLIS_OK; heritage.socket = -1; + + /* + * Set up a temporary param block until VSL_MgtInit() can + * replace with shmem backed structure version. + * + * XXX: I wonder if it would be smarter to inform the child process + * XXX: about param changes via CLI rather than keeping the param + * XXX: block in shared memory. It would give us the advantage + * XXX: of having the CLI thread be able to take action on the + * XXX: change. + * XXX: For now live with the harmless flexelint warning this causes: + * XXX: varnishd.c 393 Info 789: Assigning address of auto variable + * XXX: 'param' to static + */ + memset(¶m, 0, sizeof param); params = ¶m; mgt_vcc_init();