From ssm at projects.linpro.no Wed Jan 2 06:25:36 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Wed, 2 Jan 2008 07:25:36 +0100 (CET) Subject: r2329 - trunk/varnish-cache/debian Message-ID: <20080102062536.A563C1EC0B5@projects.linpro.no> Author: ssm Date: 2008-01-02 07:25:36 +0100 (Wed, 02 Jan 2008) New Revision: 2329 Modified: trunk/varnish-cache/debian/control Log: Debian packaging: Tag library and development package with correct section. Modified: trunk/varnish-cache/debian/control =================================================================== --- trunk/varnish-cache/debian/control 2007-12-29 21:11:20 UTC (rev 2328) +++ trunk/varnish-cache/debian/control 2008-01-02 06:25:36 UTC (rev 2329) @@ -24,6 +24,7 @@ operating systems. Package: libvarnish0 +Section: libs Replaces: libvarnish Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -31,6 +32,7 @@ Shared libraries for the Varnish HTTP accelerator. Package: libvarnish0-dev +Section: libdevel Replaces: libvarnish-dev Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libvarnish0 From ssm at projects.linpro.no Wed Jan 2 06:26:23 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Wed, 2 Jan 2008 07:26:23 +0100 (CET) Subject: r2330 - trunk/varnish-cache/debian Message-ID: <20080102062623.621EC1EC2B4@projects.linpro.no> Author: ssm Date: 2008-01-02 07:26:23 +0100 (Wed, 02 Jan 2008) New Revision: 2330 Removed: trunk/varnish-cache/debian/lintian-override Modified: trunk/varnish-cache/debian/rules Log: Debian packaging: Remove lintian overrides Deleted: trunk/varnish-cache/debian/lintian-override =================================================================== --- trunk/varnish-cache/debian/lintian-override 2008-01-02 06:25:36 UTC (rev 2329) +++ trunk/varnish-cache/debian/lintian-override 2008-01-02 06:26:23 UTC (rev 2330) @@ -1,3 +0,0 @@ -varnish: duplicate-updaterc.d-calls-in-postinst varnish -varnish: duplicate-updaterc.d-calls-in-postinst varnishlog - Modified: trunk/varnish-cache/debian/rules =================================================================== --- trunk/varnish-cache/debian/rules 2008-01-02 06:25:36 UTC (rev 2329) +++ trunk/varnish-cache/debian/rules 2008-01-02 06:26:23 UTC (rev 2330) @@ -70,7 +70,6 @@ dh_install --sourcedir=$(CURDIR)/debian/tmp install -m 644 $(CURDIR)/etc/default.vcl $(CURDIR)/debian/varnish/etc/varnish/ - install -m 644 $(CURDIR)/debian/lintian-override $(CURDIR)/debian/varnish/usr/share/lintian/overrides/varnish install -m 644 $(CURDIR)/debian/varnish.logrotate $(CURDIR)/debian/varnish/etc/logrotate.d/varnish From phk at projects.linpro.no Tue Jan 8 09:42:30 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 8 Jan 2008 10:42:30 +0100 (CET) Subject: r2331 - in trunk/varnish-cache: include lib/libvarnish Message-ID: <20080108094230.335A61EC0B5@projects.linpro.no> Author: phk Date: 2008-01-08 10:42:29 +0100 (Tue, 08 Jan 2008) New Revision: 2331 Added: trunk/varnish-cache/lib/libvarnish/num.c Modified: trunk/varnish-cache/include/libvarnish.h trunk/varnish-cache/lib/libvarnish/Makefile.am Log: Add a str2bytes() function which converts byte size strings to number of bytes. In difference from for instance FreeBSD's relatively newly added expand_number(), this function also takes floatingpoint specifications like "1.5T". Modified: trunk/varnish-cache/include/libvarnish.h =================================================================== --- trunk/varnish-cache/include/libvarnish.h 2008-01-02 06:26:23 UTC (rev 2330) +++ trunk/varnish-cache/include/libvarnish.h 2008-01-08 09:42:29 UTC (rev 2331) @@ -45,6 +45,9 @@ uint32_t crc32(uint32_t crc, const void *p1, unsigned l); uint32_t crc32_l(const void *p1, unsigned l); +/* from libvarnish/num.c */ +const char *str2bytes(const char *p, uintmax_t *r); + /* from libvarnish/time.c */ void TIM_format(double t, char *p); time_t TIM_parse(const char *p); Modified: trunk/varnish-cache/lib/libvarnish/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvarnish/Makefile.am 2008-01-02 06:26:23 UTC (rev 2330) +++ trunk/varnish-cache/lib/libvarnish/Makefile.am 2008-01-08 09:42:29 UTC (rev 2331) @@ -12,6 +12,7 @@ cli_common.c \ crc32.c \ flopen.c \ + num.c \ time.c \ version.c \ vpf.c \ Added: trunk/varnish-cache/lib/libvarnish/num.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/num.c (rev 0) +++ trunk/varnish-cache/lib/libvarnish/num.c 2008-01-08 09:42:29 UTC (rev 2331) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2008 Linpro AS + * All rights reserved. + * + * Author: Poul-Henning Kamp + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + * + * Deal with numbers with data storage suffix scaling + */ + +#include +#include +#include + +#include + +const char * +str2bytes(const char *p, uintmax_t *r) +{ + int i; + double l; + char suff[2]; + + i = sscanf(p, "%lg%1s", &l, suff); + + assert(i >= -1 && i <= 2); + + if (i < 1) + return ("Could not find any number"); + + if (l < 0.0) + return ("Negative numbers not allowed"); + + if (i == 2) { + switch (tolower(*suff)) { + case 'b': break; + case 'k': l *= ((uintmax_t)1 << 10); break; + case 'm': l *= ((uintmax_t)1 << 20); break; + case 'g': l *= ((uintmax_t)1 << 30); break; + case 't': l *= ((uintmax_t)1 << 40); break; + case 'p': l *= ((uintmax_t)1 << 50); break; + case 'e': l *= ((uintmax_t)1 << 60); break; + default: + return ("Unknown scaling suffix [bkmgtpe] allowed"); + } + } + *r = (uintmax_t)(l + .5); + return (NULL); +} + From phk at projects.linpro.no Tue Jan 8 09:56:50 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 8 Jan 2008 10:56:50 +0100 (CET) Subject: r2332 - trunk/varnish-cache/bin/varnishd Message-ID: <20080108095650.E10721EC2B0@projects.linpro.no> Author: phk Date: 2008-01-08 10:56:50 +0100 (Tue, 08 Jan 2008) New Revision: 2332 Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 trunk/varnish-cache/bin/varnishd/varnishd.c Log: Add -l argument for specifying shared memory log size. Increase default from 8M to 80M to reduce roll-over frequency on busy servers. Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.1 2008-01-08 09:42:29 UTC (rev 2331) +++ trunk/varnish-cache/bin/varnishd/varnishd.1 2008-01-08 09:56:50 UTC (rev 2332) @@ -43,6 +43,7 @@ .Op Fl f Ar config .Op Fl g Ar group .Op Fl h Ar type Ns Op , Ns Ar options +.Op Fl l Ar shmlogsize .Op Fl n Ar name .Op Fl P Ar file .Op Fl p Ar param Ns = Ns Ar value @@ -131,6 +132,11 @@ See .Sx Hash Algorithms for a list of supported algorithms. +.It Fl l Ar shmlogsize +Specify size of shmlog file. +Scaling suffixes like 'k', 'm' can be used up to (e)tabytes. +Default is 80 Megabytes. +Specifying less than 8 Megabytes is unwise. .It Fl n Specify a name for this instance. Amonst other things, this name is used to construct the name of the Modified: trunk/varnish-cache/bin/varnishd/varnishd.c =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.c 2008-01-08 09:42:29 UTC (rev 2331) +++ trunk/varnish-cache/bin/varnishd/varnishd.c 2008-01-08 09:56:50 UTC (rev 2332) @@ -124,57 +124,42 @@ static void usage(void) { +#define FMT " %-28s # %s\n" + fprintf(stderr, "usage: varnishd [options]\n"); - fprintf(stderr, " %-28s # %s\n", "-a address:port", - "HTTP listen address and port"); - fprintf(stderr, " %-28s # %s\n", "-b address:port", - "backend address and port"); - fprintf(stderr, " %-28s # %s\n", "", - " -b "); - fprintf(stderr, " %-28s # %s\n", "", - " -b ':'"); - fprintf(stderr, " %-28s # %s\n", "-d", "debug"); - fprintf(stderr, " %-28s # %s\n", "-f file", "VCL script"); - fprintf(stderr, " %-28s # %s\n", "-F", "Run in foreground"); - fprintf(stderr, " %-28s # %s\n", - "-h kind[,hashoptions]", "Hash specification"); - fprintf(stderr, " %-28s # %s\n", "", - " -h simple_list"); - fprintf(stderr, " %-28s # %s\n", "", - " -h classic [default]"); - fprintf(stderr, " %-28s # %s\n", "", - " -h classic,"); - fprintf(stderr, " %-28s # %s\n", "-n dir", - "varnishd working directory"); - fprintf(stderr, " %-28s # %s\n", "-P file", "PID file"); - fprintf(stderr, " %-28s # %s\n", "-p param=value", - "set parameter"); - fprintf(stderr, " %-28s # %s\n", + fprintf(stderr, FMT, "-a address:port", "HTTP listen address and port"); + fprintf(stderr, FMT, "-b address:port", "backend address and port"); + fprintf(stderr, FMT, "", " -b "); + fprintf(stderr, FMT, "", " -b ':'"); + fprintf(stderr, FMT, "-d", "debug"); + fprintf(stderr, FMT, "-f file", "VCL script"); + fprintf(stderr, FMT, "-F", "Run in foreground"); + fprintf(stderr, FMT, "-h kind[,hashoptions]", "Hash specification"); + fprintf(stderr, FMT, "", " -h simple_list"); + fprintf(stderr, FMT, "", " -h classic [default]"); + fprintf(stderr, FMT, "", " -h classic,"); + fprintf(stderr, FMT, "-l bytesize", "Size of shared memory log"); + fprintf(stderr, FMT, "-n dir", "varnishd working directory"); + fprintf(stderr, FMT, "-P file", "PID file"); + fprintf(stderr, FMT, "-p param=value", "set parameter"); + fprintf(stderr, FMT, "-s kind[,storageoptions]", "Backend storage specification"); - fprintf(stderr, " %-28s # %s\n", "", - " -s malloc"); - fprintf(stderr, " %-28s # %s\n", "", - " -s file [default: use /tmp]"); - fprintf(stderr, " %-28s # %s\n", "", - " -s file,"); - fprintf(stderr, " %-28s # %s\n", "", - " -s file,,"); - fprintf(stderr, " %-28s # %s\n", "-t", "Default TTL"); - fprintf(stderr, " %-28s # %s\n", "-T address:port", + fprintf(stderr, FMT, "", " -s malloc"); + fprintf(stderr, FMT, "", " -s file [default: use /tmp]"); + fprintf(stderr, FMT, "", " -s file,"); + fprintf(stderr, FMT, "", " -s file,,"); + fprintf(stderr, FMT, "-t", "Default TTL"); + fprintf(stderr, FMT, "-T address:port", "Telnet listen address and port"); - fprintf(stderr, " %-28s # %s\n", "-V", "version"); - fprintf(stderr, " %-28s # %s\n", "-w int[,int[,int]]", - "Number of worker threads"); - fprintf(stderr, " %-28s # %s\n", "", - " -w "); - fprintf(stderr, " %-28s # %s\n", "", - " -w min,max"); - fprintf(stderr, " %-28s # %s\n", "", - " -w min,max,timeout [default: -w1,1000,120]"); + fprintf(stderr, FMT, "-V", "version"); + fprintf(stderr, FMT, "-w int[,int[,int]]", "Number of worker threads"); + fprintf(stderr, FMT, "", " -w "); + fprintf(stderr, FMT, "", " -w min,max"); + fprintf(stderr, FMT, "", " -w min,max,timeout [default: -w1,1000,120]"); +#undef FMT #if 0 -c clusterid at cluster_controller -m memory_limit - -l logfile,logsize -u uid -a CLI_port #endif @@ -372,6 +357,9 @@ unsigned F_flag = 0; const char *b_arg = NULL; const char *f_arg = NULL; + const char *l_arg = "80m"; + uintmax_t l_size; + const char *q; int f_fd = -1; const char *h_arg = "classic"; const char *n_arg = NULL; @@ -402,7 +390,7 @@ MCF_ParamInit(cli); cli_check(cli); - while ((o = getopt(argc, argv, "a:b:Cdf:Fg:h:n:P:p:s:T:t:u:Vw:")) != -1) + while ((o = getopt(argc, argv, "a:b:Cdf:Fg:h:l:n:P:p:s:T:t:u:Vw:")) != -1) switch (o) { case 'a': MCF_ParamSet(cli, "listen_address", optarg); @@ -429,6 +417,9 @@ case 'h': h_arg = optarg; break; + case 'l': + l_arg = optarg; + break; case 'n': n_arg = optarg; break; @@ -475,6 +466,13 @@ usage(); } + q = str2bytes(l_arg, &l_size); + if (q != NULL) { + fprintf(stderr, "Parameter error:\n"); + fprintf(stderr, "\t-l ...: %s\n", q); + exit (1); + } + /* XXX: we can have multiple CLI actions above, is this enough ? */ if (cli[0].result != CLIS_OK) { fprintf(stderr, "Parameter errors:\n"); @@ -542,7 +540,7 @@ setup_hash(h_arg); - VSL_MgtInit(SHMLOG_FILENAME, 8*1024*1024); + VSL_MgtInit(SHMLOG_FILENAME, l_size); if (d_flag == 1) DebugStunt(); From phk at projects.linpro.no Tue Jan 8 10:35:29 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 8 Jan 2008 11:35:29 +0100 (CET) Subject: r2333 - in trunk/varnish-cache: bin/varnishd include lib/libvarnish Message-ID: <20080108103529.9674C1EC21C@projects.linpro.no> Author: phk Date: 2008-01-08 11:35:29 +0100 (Tue, 08 Jan 2008) New Revision: 2333 Modified: trunk/varnish-cache/bin/varnishd/varnishd.c trunk/varnish-cache/include/libvarnish.h trunk/varnish-cache/lib/libvarnish/num.c Log: Extend the str2bytes() function to also cope with percentages of a size given as parameter. Modified: trunk/varnish-cache/bin/varnishd/varnishd.c =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.c 2008-01-08 09:56:50 UTC (rev 2332) +++ trunk/varnish-cache/bin/varnishd/varnishd.c 2008-01-08 10:35:29 UTC (rev 2333) @@ -466,7 +466,7 @@ usage(); } - q = str2bytes(l_arg, &l_size); + q = str2bytes(l_arg, &l_size, 0); if (q != NULL) { fprintf(stderr, "Parameter error:\n"); fprintf(stderr, "\t-l ...: %s\n", q); Modified: trunk/varnish-cache/include/libvarnish.h =================================================================== --- trunk/varnish-cache/include/libvarnish.h 2008-01-08 09:56:50 UTC (rev 2332) +++ trunk/varnish-cache/include/libvarnish.h 2008-01-08 10:35:29 UTC (rev 2333) @@ -46,7 +46,7 @@ uint32_t crc32_l(const void *p1, unsigned l); /* from libvarnish/num.c */ -const char *str2bytes(const char *p, uintmax_t *r); +const char *str2bytes(const char *p, uintmax_t *r, uintmax_t rel); /* from libvarnish/time.c */ void TIM_format(double t, char *p); Modified: trunk/varnish-cache/lib/libvarnish/num.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/num.c 2008-01-08 09:56:50 UTC (rev 2332) +++ trunk/varnish-cache/lib/libvarnish/num.c 2008-01-08 10:35:29 UTC (rev 2333) @@ -37,7 +37,7 @@ #include const char * -str2bytes(const char *p, uintmax_t *r) +str2bytes(const char *p, uintmax_t *r, uintmax_t rel) { int i; double l; @@ -62,6 +62,13 @@ case 't': l *= ((uintmax_t)1 << 40); break; case 'p': l *= ((uintmax_t)1 << 50); break; case 'e': l *= ((uintmax_t)1 << 60); break; + case '%': + /* Percentage of 'rel' arg */ + if (rel != 0) { + l *= 1e-2 * rel; + break; + } + /*FALLTHROUGH*/ default: return ("Unknown scaling suffix [bkmgtpe] allowed"); } From des at projects.linpro.no Tue Jan 8 10:37:07 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Tue, 8 Jan 2008 11:37:07 +0100 (CET) Subject: r2334 - trunk/varnish-cache/lib/libvcl Message-ID: <20080108103707.D5F481EC2B0@projects.linpro.no> Author: des Date: 2008-01-08 11:37:07 +0100 (Tue, 08 Jan 2008) New Revision: 2334 Removed: trunk/varnish-cache/lib/libvcl/sample.vcl trunk/varnish-cache/lib/libvcl/syntax.txt Log: Remove files which confuse users who mistake them for documentation (see #77). There may be a case for resurrecting syntax.txt, but only if it is fixed to reflect what was actually implemented as opposed to what was proposed a year ago. Deleted: trunk/varnish-cache/lib/libvcl/sample.vcl =================================================================== --- trunk/varnish-cache/lib/libvcl/sample.vcl 2008-01-08 10:35:29 UTC (rev 2333) +++ trunk/varnish-cache/lib/libvcl/sample.vcl 2008-01-08 10:37:07 UTC (rev 2334) @@ -1,109 +0,0 @@ - -acl rfc1918 { - 10.0.0.0/8; - 172.16.0.0/12; - 192.168.0.0/16; -} - -sub request_policy { - - if (client.ip == 10.1.2.3) { - no_cache; - finish; - } - - if (client.ip ~ rfc1918) { - no_cache; - finish; - } - - if (req.url.host ~ "cnn.no$") { - rewrite "cnn.no$" "vg.no"; - } - - if (req.url.path ~ "cgi-bin") { - no_cache; - } - - if (req.useragent ~ "spider") { - no_new_cache; - } - -# comment - - if (backend.response_time <= 0.8s) { - set req.ttlfactor = 1.5; - } elseif (backend.response_time > 1.5s) { - set req.ttlfactor = 2.0; - } elseif (backend.response_time > 2.5m) { - set req.ttlfactor = 5.0; - } - - /* - * the program contains no references to - * maxage, s-maxage and expires, so the - * default handling (RFC2616) applies - */ -} - -backend vg { - set backend.ip = 10.0.0.100; - set backend.timeout = 4s; - set backend.bandwidth = 2000Mb/s; -} - -backend chat { - set backend.ip = 10.0.0.4; - set backend.timeout = 4s; - set backend.bandwidth = 2000Mb/s; -} - -sub bail { - error 404 "Bailing out"; - finish; -} - -sub fetch_policy { - - if (!req.url.host ~ "/vg.no$/") { - set req.backend = vg; - } else { - /* XXX: specify 404 page url ? */ - error 404; - } - - if (backend.response_time > 2.0s) { - if (req.url.path ~ "/landbrugspriser/") { - call bail; - } - } - fetch; - if (backend.down) { - if (obj.exist) { - set obj.ttl += 10m; - finish; - } - switch_config ohhshit; - } - if (obj.result == 404) { - error 300 "http://www.vg.no"; - } - if (obj.result != 200) { - finish; - } - if (obj.size > 256kb) { - no_cache; - } else if (obj.size > 32kb && obj.ttl < 2m) { - set obj.ttl = 5m; - } - if (backend.response_time > 2.0s) { - set obj.ttl *= 2.0; - } -} - -sub prefetch_policy { - - if (obj.usage < 10 && obj.ttl < 5m) { - fetch; - } -} Deleted: trunk/varnish-cache/lib/libvcl/syntax.txt =================================================================== --- trunk/varnish-cache/lib/libvcl/syntax.txt 2008-01-08 10:35:29 UTC (rev 2333) +++ trunk/varnish-cache/lib/libvcl/syntax.txt 2008-01-08 10:37:07 UTC (rev 2334) @@ -1,201 +0,0 @@ -# Manually maintained syntax description of VCL -# -# $Id$ -# - -vcl_program: - prog_element - vcl_program prog_element - -prog_element: - acl - function - backend - -function: - 'sub' ident compound - -compound: - '{' statements '}' - -statements: - statement - statements statement - -statement: - compound - if_stmt - action - 'C{' inline_c_src '}C' - -if_stmt: - 'if' conditional compound elseifparts elsepart - -elseifparts: - - elseifpart - elseifparts elseifpart - -elseifpart: - 'elseif' conditional compound - -elsepart: - - 'else' compound - -conditional: - '(' cond_0 ')' - -cond_0: - cond_1 - cond_0 '||' cond_1 - -cond_1: - cond_2 - cond_1 '&&' cond_2 - -cond_2: - cond_3 - '!' cond_3 - -cond_3: - '(' cond_0 ')' - var_int cond_int - var_size cond_size - var_bool - var_ip cond_ip - var_string cond_string - var_time cond_time - var_backend - -cond_int: - '==' cnum - '!=' cnum - '<=' cnum - '>=' cnum - '<' cnum - '>' cnum - -cond_size: - cond_int size_unit - -conf_time: - cond_int time_unit - -time_unit: - 's' - 'm' - 'h' - 'd' - -size_unit: - 'kb' - 'mb' - 'Mb' - 'gb' - 'Gb' - -cond_string: - '~' regexp - '==' cstr - '!=' cstr - -cond_ip: - -regexp: - cstr - -backend: - 'backend' ident '{' be_decls '}' - -be_decls: - be_decl - be_decls be_decl - -be_decl: - 'set' be_string '=' cstr ';' - 'set' be_time '=' cnum time_unit ';' - -action: - 'no_new_cache' ';' - 'no_cache' ';' - return_action ';' - 'error' cnum cstr ';' - 'error' cstr ';' - 'error' cnum ';' - 'error' ';' - 'switch_config' ident ';' - 'call' ident ';' - 'rewrite' cstr cstr ';' - 'set' assignment ';' - 'remove' variable ';' - -# see variable 'returns' in vcc_gen_fixed_token.tcl -return_action: - 'lookup' - 'hash' - 'pipe' - 'pass' - 'fetch' - 'insert' - 'deliver' - 'discard' - -assignment: - var_int ratio - var_int assign_int - var_size ratio - var_size assign_int size_unit - var_rate ratio - var_rate assign_int size_unit '/' time_unit - var_time ratio - var_time assign_int time_unit - var_float ratio - var_float '+=' double - var_float '-=' double - var_float '=' double - var_backend '=' ident - var_string '=' stringval - var_string '+=' stringval - -assign_int: - '+=' cnum - '-=' cnum - '=' cnum - - -ratio: - '*=' double - '/=' double - -acl: - 'acl' ident '{' rules '}' - -rules: - rule - rules rule - -rule: - '(' not rule0 ')' ';' - not rule0 ';' - -not: - - '!' - -rule0: - cstr - cstr '/' cnum - '!' cstr - -stringval: - cstr - var_string - -cstr: (string constant) - -cnum: (numeric constant) - -double: (floating point constant) - -ident: (identifier) From phk at phk.freebsd.dk Tue Jan 8 10:46:23 2008 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Tue, 08 Jan 2008 10:46:23 +0000 Subject: r2334 - trunk/varnish-cache/lib/libvcl In-Reply-To: Your message of "Tue, 08 Jan 2008 11:37:07 +0100." <20080108103707.D5F481EC2B0@projects.linpro.no> Message-ID: <60604.1199789183@critter.freebsd.dk> In message <20080108103707.D5F481EC2B0 at projects.linpro.no>, des at projects.linpro .no writes: >Author: des >Date: 2008-01-08 11:37:07 +0100 (Tue, 08 Jan 2008) >New Revision: 2334 > >Removed: > trunk/varnish-cache/lib/libvcl/sample.vcl > trunk/varnish-cache/lib/libvcl/syntax.txt >Log: >Remove files which confuse users who mistake them for documentation (see #77). >There may be a case for resurrecting syntax.txt, but only if it is fixed to >reflect what was actually implemented as opposed to what was proposed a year >ago. While I agree for sample.vcl, I do not at all agree for syntax.txt which should be brought back and fixed, possibly prominently maked as a "development tool" -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From phk at projects.linpro.no Tue Jan 8 10:58:05 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 8 Jan 2008 11:58:05 +0100 (CET) Subject: r2335 - trunk/varnish-cache/bin/varnishd Message-ID: <20080108105805.65C341EC21C@projects.linpro.no> Author: phk Date: 2008-01-08 11:58:04 +0100 (Tue, 08 Jan 2008) New Revision: 2335 Modified: trunk/varnish-cache/bin/varnishd/storage_file.c Log: Simplify calculation of storage file by using str2bytes() function. Move unsightly #ifdef STATVFS stuff into small helper function. Modified: trunk/varnish-cache/bin/varnishd/storage_file.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_file.c 2008-01-08 10:37:07 UTC (rev 2334) +++ trunk/varnish-cache/bin/varnishd/storage_file.c 2008-01-08 10:58:04 UTC (rev 2335) @@ -118,19 +118,37 @@ /*--------------------------------------------------------------------*/ -static void -smf_calcsize(struct smf_sc *sc, const char *size, int newfile) +static uintmax_t +smf_fsspace(int fd, unsigned *bs) { #if defined(HAVE_SYS_STATVFS_H) struct statvfs fsst; + + AZ(fstatvfs(fd, &fsst)); #elif defined(HAVE_SYS_MOUNT_H) || defined(HAVE_SYS_VFS_H) struct statfs fsst; + + AZ(fstatfs(sc->fd, &fsst)); #else #error no struct statfs / struct statvfs #endif + + /* We use units of the larger of filesystem blocksize and pagesize */ + if (*bs < fsst.f_bsize) + *bs = fsst.f_bsize; + xxxassert(*bs % fsst.f_bsize == 0); + return (fsst.f_bsize * fsst.f_bavail); +} + + +/*--------------------------------------------------------------------*/ + +static void +smf_calcsize(struct smf_sc *sc, const char *size, int newfile) +{ uintmax_t l, fssize; unsigned bs; - char suff[2]; + const char *q; int i; off_t o; struct stat st; @@ -139,86 +157,48 @@ AZ(fstat(sc->fd, &st)); xxxassert(S_ISREG(st.st_mode)); -#if defined(HAVE_SYS_STATVFS_H) - AZ(fstatvfs(sc->fd, &fsst)); -#elif defined(HAVE_SYS_MOUNT_H) || defined(HAVE_SYS_VFS_H) - AZ(fstatfs(sc->fd, &fsst)); -#else -#error no struct statfs / struct statvfs -#endif - - /* We use units of the larger of filesystem blocksize and pagesize */ bs = sc->pagesize; - if (bs < fsst.f_bsize) - bs = fsst.f_bsize; + fssize = smf_fsspace(sc->fd, &bs); xxxassert(bs % sc->pagesize == 0); - xxxassert(bs % fsst.f_bsize == 0); - fssize = fsst.f_bsize * fsst.f_bavail; - i = sscanf(size, "%ju%1s", &l, suff); /* can return -1, 0, 1 or 2 */ - - if (i == 0) { - fprintf(stderr, - "Error: (-sfile) size \"%s\" not understood\n", size); - exit (2); - } - - if (i >= 1 && l == 0) { - fprintf(stderr, - "Error: (-sfile) zero size not permitted\n"); - exit (2); - } - - if (i == -1 && !newfile) /* Use the existing size of the file */ + if ((size == NULL || *size == '\0') && !newfile) { + /* + * We have no size specification, but an existing file, + * use it's existing size. + */ l = st.st_size; + } else { + q = str2bytes(size, &l, fssize); - /* We must have at least one block */ - if (l < bs) { - if (i == -1) { + if (q != NULL) { fprintf(stderr, - "Info: (-sfile) default to 80%% size\n"); - l = 80; - suff[0] = '%'; - i = 2; + "Error: (-sfile) size \"%s\": %s \n", size, q); + exit (2); } + } - if (i == 2) { - if (suff[0] == 'k' || suff[0] == 'K') - l *= 1024UL; - else if (suff[0] == 'm' || suff[0] == 'M') - l *= 1024UL * 1024UL; - else if (suff[0] == 'g' || suff[0] == 'G') - l *= 1024UL * 1024UL * 1024UL; - else if (suff[0] == 't' || suff[0] == 'T') - l *= (uintmax_t)(1024UL * 1024UL) * - (uintmax_t)(1024UL * 1024UL); - else if (suff[0] == '%') { - l *= fssize; - l /= 100; - } - } - - /* - * This trickery wouldn't be necessary if X/Open would - * just add OFF_MAX to ... - */ + /* + * This trickery wouldn't be necessary if X/Open would + * just add OFF_MAX to ... + */ + i = 0; + while(1) { o = l; - if (o != l || o < 0) { - do { - l >>= 1; - o = l; - } while (o != l || o < 0); - fprintf(stderr, "WARNING: storage file size reduced" - " to %ju due to system limitations\n", l); - } + if (o == l && o > 0) + break; + l >>= 1; + i++; + } + if (i) + fprintf(stderr, "WARNING: storage file size reduced" + " to %ju due to system limitations\n", l); - if (l < st.st_size) { - AZ(ftruncate(sc->fd, l)); - } else if (l - st.st_size > fssize) { - l = fssize * 80 / 100; - fprintf(stderr, "WARNING: storage file size reduced" - " to %ju (80%% of available disk space)\n", l); - } + if (l < st.st_size) { + AZ(ftruncate(sc->fd, l)); + } else if (l - st.st_size > fssize) { + l = fssize * 80 / 100; + fprintf(stderr, "WARNING: storage file size reduced" + " to %ju (80%% of available disk space)\n", l); } /* round down to multiple of filesystem blocksize or pagesize */ From des at linpro.no Tue Jan 8 12:13:52 2008 From: des at linpro.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) Date: Tue, 08 Jan 2008 13:13:52 +0100 Subject: r2334 - trunk/varnish-cache/lib/libvcl In-Reply-To: <60604.1199789183@critter.freebsd.dk> (Poul-Henning Kamp's message of "Tue, 08 Jan 2008 10:46:23 +0000") References: <60604.1199789183@critter.freebsd.dk> Message-ID: "Poul-Henning Kamp" writes: > While I agree for sample.vcl, I do not at all agree for syntax.txt > which should be brought back and fixed, possibly prominently maked > as a "development tool" There was stuff in it that was added almost a year ago but never implemented, or implemented with a completely different syntax, such as "rewrite". I'll be glad to see it back in, but the best person to fix it is probably yourself... DES -- Dag-Erling Sm?rgrav Senior Software Developer Linpro AS - www.linpro.no From phk at projects.linpro.no Tue Jan 8 14:16:38 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 8 Jan 2008 15:16:38 +0100 (CET) Subject: r2336 - trunk/varnish-cache/lib/libvcl Message-ID: <20080108141638.C186C1EC2B0@projects.linpro.no> Author: phk Date: 2008-01-08 15:16:38 +0100 (Tue, 08 Jan 2008) New Revision: 2336 Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c Log: Make inlining C with C{ ... }C legal at the toplevel (in addition to in compounds). Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-01-08 10:58:04 UTC (rev 2335) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-01-08 14:16:38 UTC (rev 2336) @@ -551,6 +551,11 @@ case T_BACKEND_ROUND_ROBIN: vcc_ParseBalancedBackend(tl); break; + case CSRC: + Fc(tl, 0, "%.*s\n", + tl->t->e - (tl->t->b + 4), tl->t->b + 2); + vcc_NextToken(tl); + break; case EOI: break; default: From phk at projects.linpro.no Tue Jan 8 14:35:09 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 8 Jan 2008 15:35:09 +0100 (CET) Subject: r2337 - trunk/varnish-cache Message-ID: <20080108143509.F156E1EC21C@projects.linpro.no> Author: phk Date: 2008-01-08 15:35:09 +0100 (Tue, 08 Jan 2008) New Revision: 2337 Modified: trunk/varnish-cache/configure.ac Log: Don't even look for senfile, it doesn't work for what we need on any of the platforms right now. Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2008-01-08 14:16:38 UTC (rev 2336) +++ trunk/varnish-cache/configure.ac 2008-01-08 14:35:09 UTC (rev 2337) @@ -97,15 +97,18 @@ AC_CHECK_FUNCS([strptime]) AC_CHECK_FUNCS([fmtcheck]) -# This one is tricky, there are multiple versions -case $host in -*-*-freebsd*|*-*-linux*) - AC_CHECK_FUNCS([sendfile]) - ;; -*) - AC_MSG_WARN([won't look for sendfile() on $host]) - ;; -esac +# Don't look for sendfile at all, none of them work +# anyway. (don't tell when done with passed mem-range) +# +## This one is tricky, there are multiple versions +#case $host in +#*-*-freebsd*|*-*-linux*) +# AC_CHECK_FUNCS([sendfile]) +# ;; +#*) +# AC_MSG_WARN([won't look for sendfile() on $host]) +# ;; +#esac # These functions are provided by libcompat on platforms where they # are not available From des at linpro.no Tue Jan 8 16:51:42 2008 From: des at linpro.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) Date: Tue, 08 Jan 2008 17:51:42 +0100 Subject: r2331 - in trunk/varnish-cache: include lib/libvarnish In-Reply-To: <20080108094230.335A61EC0B5@projects.linpro.no> (phk@projects.linpro.no's message of "Tue, 8 Jan 2008 10:42:30 +0100 (CET)") References: <20080108094230.335A61EC0B5@projects.linpro.no> Message-ID: phk at projects.linpro.no writes: > Log: > Add a str2bytes() function which converts byte size strings to > number of bytes. > > In difference from for instance FreeBSD's relatively newly added > expand_number(), this function also takes floatingpoint specifications > like "1.5T". I'm uncomfortable with the use of sscanf(), and the fact that it apparently accepts e.g. "100B" but not "100MB" (it should accept both) DES -- Dag-Erling Sm?rgrav Senior Software Developer Linpro AS - www.linpro.no From phk at phk.freebsd.dk Wed Jan 9 10:03:44 2008 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Wed, 09 Jan 2008 10:03:44 +0000 Subject: r2331 - in trunk/varnish-cache: include lib/libvarnish In-Reply-To: Your message of "Tue, 08 Jan 2008 17:51:42 +0100." Message-ID: <82768.1199873024@critter.freebsd.dk> In message , =?utf-8?Q?Dag-Erling_Sm=C3=B8rgra v?= writes: >phk at projects.linpro.no writes: >> Log: >> Add a str2bytes() function which converts byte size strings to >> number of bytes. >> >> In difference from for instance FreeBSD's relatively newly added >> expand_number(), this function also takes floatingpoint specifications >> like "1.5T". > >I'm uncomfortable with the use of sscanf(), and the fact that it >apparently accepts e.g. "100B" but not "100MB" (it should accept both) Add to things to do after I wash my dog :-) -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From phk at projects.linpro.no Thu Jan 10 23:15:40 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Fri, 11 Jan 2008 00:15:40 +0100 (CET) Subject: r2338 - trunk/varnish-cache/bin/varnishd Message-ID: <20080110231540.1E4241EC454@projects.linpro.no> Author: phk Date: 2008-01-11 00:15:39 +0100 (Fri, 11 Jan 2008) New Revision: 2338 Modified: trunk/varnish-cache/bin/varnishd/cache.h Log: Use IOV_MAX as limit if it is smaller on (HTTP_HDR_MAX * 2). Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2008-01-08 14:35:09 UTC (rev 2337) +++ trunk/varnish-cache/bin/varnishd/cache.h 2008-01-10 23:15:39 UTC (rev 2338) @@ -58,8 +58,12 @@ HTTP_HDR_MAX = 32 /* XXX: should be #defined */ }; -/* Note: intentionally not IOV_MAX */ -#define MAX_IOVS (HTTP_HDR_MAX * 2) +/* Note: intentionally not IOV_MAX unless it has to be */ +#if (IOV_MAX < (HTTP_HDR_MAX * 2)) +# define MAX_IOVS IOV_MAX +#else +# define MAX_IOVS (HTTP_HDR_MAX * 2) +#endif struct cli; struct vsb; From phk at projects.linpro.no Thu Jan 10 23:16:01 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Fri, 11 Jan 2008 00:16:01 +0100 (CET) Subject: r2339 - in trunk/varnish-cache/bin: varnishhist varnishstat varnishtop Message-ID: <20080110231601.CEDD51EC418@projects.linpro.no> Author: phk Date: 2008-01-11 00:16:01 +0100 (Fri, 11 Jan 2008) New Revision: 2339 Modified: trunk/varnish-cache/bin/varnishhist/varnishhist.c trunk/varnish-cache/bin/varnishstat/varnishstat.c trunk/varnish-cache/bin/varnishtop/varnishtop.c Log: Not all curses have KEY_RESIZE Modified: trunk/varnish-cache/bin/varnishhist/varnishhist.c =================================================================== --- trunk/varnish-cache/bin/varnishhist/varnishhist.c 2008-01-10 23:15:39 UTC (rev 2338) +++ trunk/varnish-cache/bin/varnishhist/varnishhist.c 2008-01-10 23:16:01 UTC (rev 2339) @@ -259,9 +259,11 @@ switch ((ch = getch())) { case ERR: break; +#ifdef KEY_RESIZE case KEY_RESIZE: erase(); break; +#endif case '\014': /* Ctrl-L */ case '\024': /* Ctrl-T */ redrawwin(stdscr); Modified: trunk/varnish-cache/bin/varnishstat/varnishstat.c =================================================================== --- trunk/varnish-cache/bin/varnishstat/varnishstat.c 2008-01-10 23:15:39 UTC (rev 2338) +++ trunk/varnish-cache/bin/varnishstat/varnishstat.c 2008-01-10 23:16:01 UTC (rev 2339) @@ -129,9 +129,11 @@ switch ((ch = getch())) { case ERR: break; +#ifdef KEY_RESIZE case KEY_RESIZE: erase(); break; +#endif case '\014': /* Ctrl-L */ case '\024': /* Ctrl-T */ redrawwin(stdscr); Modified: trunk/varnish-cache/bin/varnishtop/varnishtop.c =================================================================== --- trunk/varnish-cache/bin/varnishtop/varnishtop.c 2008-01-10 23:15:39 UTC (rev 2338) +++ trunk/varnish-cache/bin/varnishtop/varnishtop.c 2008-01-10 23:16:01 UTC (rev 2339) @@ -216,9 +216,11 @@ switch ((ch = getch())) { case ERR: break; +#ifdef KEY_RESIZE case KEY_RESIZE: erase(); break; +#endif case '\014': /* Ctrl-L */ case '\024': /* Ctrl-T */ redrawwin(stdscr); From phk at projects.linpro.no Mon Jan 14 08:55:59 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 14 Jan 2008 09:55:59 +0100 (CET) Subject: r2340 - trunk/varnish-cache/lib/libvcl Message-ID: <20080114085559.17B401EC454@projects.linpro.no> Author: phk Date: 2008-01-14 09:55:58 +0100 (Mon, 14 Jan 2008) New Revision: 2340 Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c Log: Add missing ERRCHK() to suppress subsequent syntax errors. Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-01-10 23:16:01 UTC (rev 2339) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-01-14 08:55:58 UTC (rev 2340) @@ -189,6 +189,7 @@ double v, sc; v = vcc_DoubleVal(tl); + ERRCHK(tl); ExpectErr(tl, ID); sc = TimeUnit(tl); Fb(tl, 0, "(%g * %g)", v, sc); @@ -200,6 +201,7 @@ double v, sc; v = vcc_DoubleVal(tl); + ERRCHK(tl); ExpectErr(tl, ID); sc = SizeUnit(tl); Fb(tl, 0, "(%g * %g)", v, sc); @@ -211,6 +213,7 @@ double v, sc; v = vcc_DoubleVal(tl); + ERRCHK(tl); ExpectErr(tl, ID); sc = RateUnit(tl); Fb(tl, 0, "(%g * %g)", v, sc); From phk at projects.linpro.no Mon Jan 14 09:14:57 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 14 Jan 2008 10:14:57 +0100 (CET) Subject: r2341 - in trunk/varnish-cache: include lib/libvcl Message-ID: <20080114091457.448B81EC1F6@projects.linpro.no> Author: phk Date: 2008-01-14 10:14:56 +0100 (Mon, 14 Jan 2008) New Revision: 2341 Modified: trunk/varnish-cache/include/vcl.h trunk/varnish-cache/include/vcl_returns.h trunk/varnish-cache/include/vrt_obj.h trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl trunk/varnish-cache/lib/libvcl/vcc_obj.c trunk/varnish-cache/lib/libvcl/vcc_parse.c Log: Add VCC support for: Variables that can take relative, currently limited to negative, time intervals. vcl_prefetch{} method obj.prefetch variable. Modified: trunk/varnish-cache/include/vcl.h =================================================================== --- trunk/varnish-cache/include/vcl.h 2008-01-14 08:55:58 UTC (rev 2340) +++ trunk/varnish-cache/include/vcl.h 2008-01-14 09:14:56 UTC (rev 2341) @@ -41,6 +41,7 @@ vcl_func_f *hit_func; vcl_func_f *fetch_func; vcl_func_f *deliver_func; + vcl_func_f *prefetch_func; vcl_func_f *timeout_func; vcl_func_f *discard_func; }; Modified: trunk/varnish-cache/include/vcl_returns.h =================================================================== --- trunk/varnish-cache/include/vcl_returns.h 2008-01-14 08:55:58 UTC (rev 2340) +++ trunk/varnish-cache/include/vcl_returns.h 2008-01-14 09:14:56 UTC (rev 2341) @@ -44,6 +44,7 @@ VCL_MET_MAC(hit,HIT,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_DELIVER)) VCL_MET_MAC(fetch,FETCH,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_PASS|VCL_RET_INSERT)) VCL_MET_MAC(deliver,DELIVER,(VCL_RET_ERROR|VCL_RET_RESTART|VCL_RET_DELIVER)) +VCL_MET_MAC(prefetch,PREFETCH,(VCL_RET_FETCH|VCL_RET_PASS)) VCL_MET_MAC(timeout,TIMEOUT,(VCL_RET_FETCH|VCL_RET_DISCARD)) VCL_MET_MAC(discard,DISCARD,(VCL_RET_DISCARD|VCL_RET_KEEP)) #else @@ -55,7 +56,8 @@ #define VCL_MET_HIT (1 << 5) #define VCL_MET_FETCH (1 << 6) #define VCL_MET_DELIVER (1 << 7) -#define VCL_MET_TIMEOUT (1 << 8) -#define VCL_MET_DISCARD (1 << 9) +#define VCL_MET_PREFETCH (1 << 8) +#define VCL_MET_TIMEOUT (1 << 9) +#define VCL_MET_DISCARD (1 << 10) #endif -#define N_METHODS 10 +#define N_METHODS 11 Modified: trunk/varnish-cache/include/vrt_obj.h =================================================================== --- trunk/varnish-cache/include/vrt_obj.h 2008-01-14 08:55:58 UTC (rev 2340) +++ trunk/varnish-cache/include/vrt_obj.h 2008-01-14 09:14:56 UTC (rev 2341) @@ -40,6 +40,8 @@ void VRT_l_obj_cacheable(const struct sess *, unsigned); double VRT_r_obj_ttl(const struct sess *); void VRT_l_obj_ttl(const struct sess *, double); +double VRT_r_obj_prefetch(const struct sess *); +void VRT_l_obj_prefetch(const struct sess *, double); double VRT_r_obj_lastuse(const struct sess *); const char * VRT_r_resp_proto(const struct sess *); void VRT_l_resp_proto(const struct sess *, const char *, ...); Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2008-01-14 08:55:58 UTC (rev 2340) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2008-01-14 09:14:56 UTC (rev 2341) @@ -156,6 +156,7 @@ case SIZE: case RATE: case TIME: + case RTIME: case FLOAT: if (tl->t->tok != '=') Fb(tl, 0, "%s %c ", vp->rname, *tl->t->b); @@ -171,6 +172,8 @@ case '=': if (vp->fmt == TIME) vcc_TimeVal(tl); + else if (vp->fmt == RTIME) + vcc_RTimeVal(tl); else if (vp->fmt == SIZE) vcc_SizeVal(tl); else if (vp->fmt == RATE) Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2008-01-14 08:55:58 UTC (rev 2340) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2008-01-14 09:14:56 UTC (rev 2341) @@ -95,6 +95,7 @@ SIZE, RATE, TIME, + RTIME, STRING, IP, HOSTNAME, @@ -174,6 +175,7 @@ /* vcc_parse.c */ void vcc_Parse(struct tokenlist *tl); void vcc_RateVal(struct tokenlist *tl); +void vcc_RTimeVal(struct tokenlist *tl); void vcc_TimeVal(struct tokenlist *tl); void vcc_SizeVal(struct tokenlist *tl); unsigned vcc_UintVal(struct tokenlist *tl); Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-14 08:55:58 UTC (rev 2340) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-14 09:14:56 UTC (rev 2341) @@ -374,6 +374,7 @@ vsb_cat(sb, " vcl_func_f *hit_func;\n"); vsb_cat(sb, " vcl_func_f *fetch_func;\n"); vsb_cat(sb, " vcl_func_f *deliver_func;\n"); + vsb_cat(sb, " vcl_func_f *prefetch_func;\n"); vsb_cat(sb, " vcl_func_f *timeout_func;\n"); vsb_cat(sb, " vcl_func_f *discard_func;\n"); vsb_cat(sb, "};\n"); @@ -551,6 +552,8 @@ vsb_cat(sb, "void VRT_l_obj_cacheable(const struct sess *, unsigned);\n"); vsb_cat(sb, "double VRT_r_obj_ttl(const struct sess *);\n"); vsb_cat(sb, "void VRT_l_obj_ttl(const struct sess *, double);\n"); + vsb_cat(sb, "double VRT_r_obj_prefetch(const struct sess *);\n"); + vsb_cat(sb, "void VRT_l_obj_prefetch(const struct sess *, double);\n"); vsb_cat(sb, "double VRT_r_obj_lastuse(const struct sess *);\n"); vsb_cat(sb, "const char * VRT_r_resp_proto(const struct sess *);\n"); vsb_cat(sb, "void VRT_l_resp_proto(const struct sess *, const char *, ...);\n"); Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2008-01-14 08:55:58 UTC (rev 2340) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2008-01-14 09:14:56 UTC (rev 2341) @@ -42,6 +42,7 @@ {hit {error restart pass deliver}} {fetch {error restart pass insert}} {deliver {error restart deliver}} + {prefetch {fetch pass}} {timeout {fetch discard}} {discard {discard keep}} } Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2008-01-14 08:55:58 UTC (rev 2340) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2008-01-14 09:14:56 UTC (rev 2341) @@ -157,6 +157,11 @@ { hit fetch discard timeout} "const struct sess *" } + { obj.prefetch + RW RTIME + { fetch prefetch } + "const struct sess *" + } { obj.lastuse RO TIME { hit fetch deliver discard timeout} @@ -205,6 +210,7 @@ set tt(BOOL) "unsigned" set tt(BACKEND) "struct backend *" set tt(TIME) "double" +set tt(RTIME) "double" set tt(INT) "int" set tt(HDR_RESP) "const char *" set tt(HDR_OBJ) "const char *" Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2008-01-14 08:55:58 UTC (rev 2340) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2008-01-14 09:14:56 UTC (rev 2341) @@ -182,6 +182,13 @@ 0, VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DISCARD | VCL_MET_TIMEOUT }, + { "obj.prefetch", RTIME, 12, + "VRT_r_obj_prefetch(sp)", + "VRT_l_obj_prefetch(sp, ", + V_RW, + 0, + VCL_MET_FETCH | VCL_MET_PREFETCH + }, { "obj.lastuse", TIME, 11, "VRT_r_obj_lastuse(sp)", NULL, Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-01-14 08:55:58 UTC (rev 2340) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-01-14 09:14:56 UTC (rev 2341) @@ -184,6 +184,23 @@ /*--------------------------------------------------------------------*/ void +vcc_RTimeVal(struct tokenlist *tl) +{ + double v, sc; + int sign = 1; + + if (tl->t->tok == '-') { + sign *= -1; + vcc_NextToken(tl); + } + v = vcc_DoubleVal(tl); + ERRCHK(tl); + ExpectErr(tl, ID); + sc = TimeUnit(tl); + Fb(tl, 0, "(%d * %g * %g)", sign, v, sc); +} + +void vcc_TimeVal(struct tokenlist *tl) { double v, sc; From phk at projects.linpro.no Mon Jan 14 09:19:06 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 14 Jan 2008 10:19:06 +0100 (CET) Subject: r2342 - trunk/varnish-cache/bin/varnishd Message-ID: <20080114091906.EE0091EC0B5@projects.linpro.no> Author: phk Date: 2008-01-14 10:19:06 +0100 (Mon, 14 Jan 2008) New Revision: 2342 Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_vrt.c Log: Add support for obj.prefetch variable Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2008-01-14 09:14:56 UTC (rev 2341) +++ trunk/varnish-cache/bin/varnishd/cache.h 2008-01-14 09:19:06 UTC (rev 2342) @@ -248,6 +248,7 @@ double age; double entered; double ttl; + double prefetch; double last_modified; Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2008-01-14 09:14:56 UTC (rev 2341) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2008-01-14 09:19:06 UTC (rev 2342) @@ -306,6 +306,27 @@ /*--------------------------------------------------------------------*/ +void +VRT_l_obj_prefetch(const struct sess *sp, double a) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ + sp->obj->prefetch = a; + if (a > 0.0) + sp->obj->prefetch += sp->t_req; +} + +double +VRT_r_obj_prefetch(const struct sess *sp) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ + return (sp->obj->prefetch - sp->t_req); +} + +/*--------------------------------------------------------------------*/ + #define VOBJ(type,onm,field) \ void \ VRT_l_obj_##onm(const struct sess *sp, type a) \ From phk at projects.linpro.no Mon Jan 14 10:30:48 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 14 Jan 2008 11:30:48 +0100 (CET) Subject: r2343 - trunk/varnish-cache/include Message-ID: <20080114103048.220FC1EC1F6@projects.linpro.no> Author: phk Date: 2008-01-14 11:30:47 +0100 (Mon, 14 Jan 2008) New Revision: 2343 Modified: trunk/varnish-cache/include/shmlog_tags.h Log: Add SHM tag VCL_info for informative messages from VCL execution. Modified: trunk/varnish-cache/include/shmlog_tags.h =================================================================== --- trunk/varnish-cache/include/shmlog_tags.h 2008-01-14 09:19:06 UTC (rev 2342) +++ trunk/varnish-cache/include/shmlog_tags.h 2008-01-14 10:30:47 UTC (rev 2343) @@ -85,6 +85,7 @@ SLTM(VCL_trace) SLTM(VCL_return) SLTM(VCL_error) +SLTM(VCL_info) SLTM(ReqStart) SLTM(Hit) SLTM(HitPass) From phk at projects.linpro.no Mon Jan 14 10:42:58 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 14 Jan 2008 11:42:58 +0100 (CET) Subject: r2344 - trunk/varnish-cache/bin/varnishd Message-ID: <20080114104258.794621EC6ED@projects.linpro.no> Author: phk Date: 2008-01-14 11:42:56 +0100 (Mon, 14 Jan 2008) New Revision: 2344 Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_expire.c trunk/varnish-cache/bin/varnishd/cache_hash.c trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/bin/varnishd/mgt_vcc.c Log: Pave more road for prefetch: Sanity-check values assigned to obj.prefetch from VCL: if before present time or after ttl, SHM a VCL_info message and set obj.prefetch to zero disabling prefetch. Change objects/timer interaction: We only keep track of the first timer for each object (->timer_when) and add a field to remember what we intend to do at that time (->timer_what). Rename heap_idx to timer_idx to group the relevant fields (XXX: it should be accessed through function outside cache_expire.c which should be called cache_timer.c now). Abolish the 30 second advance move to death-row. When the prefetch timer expires, SHM a debug message and don't do anything. Minor polishing and cleanup. Add vcl_prefetch{} to default VCL and set prefetch 30 seconds before ttl. Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2008-01-14 10:30:47 UTC (rev 2343) +++ trunk/varnish-cache/bin/varnishd/cache.h 2008-01-14 10:42:56 UTC (rev 2344) @@ -232,7 +232,13 @@ struct ws ws_o[1]; unsigned char *vary; - unsigned heap_idx; + double timer_when; + enum { + TIMER_TTL, + TIMER_PREFETCH + } timer_what; + unsigned timer_idx; + unsigned ban_seq; unsigned pass; Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_expire.c 2008-01-14 10:30:47 UTC (rev 2343) +++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2008-01-14 10:42:56 UTC (rev 2344) @@ -50,7 +50,6 @@ static pthread_t exp_thread; static struct binheap *exp_heap; static MTX exp_mtx; -static unsigned expearly = 30; static VTAILQ_HEAD(,object) exp_deathrow = VTAILQ_HEAD_INITIALIZER(exp_deathrow); static VTAILQ_HEAD(,object) exp_lru = VTAILQ_HEAD_INITIALIZER(exp_lru); @@ -61,6 +60,30 @@ */ static const unsigned lru_target = (unsigned)(-3); +/*-------------------------------------------------------------------- + * Figure out which object timer fires next + */ + +/* When does the timer fire for this object ? */ +static void +update_object_when(struct object *o) +{ + double w; + + w = o->ttl; + if (o->prefetch < 0.0) { + o->timer_when = o->ttl + o->prefetch; + o->timer_what = TIMER_PREFETCH; + } else if (o->prefetch > 0.0) { + assert(o->prefetch <= o->ttl); + o->timer_when = o->prefetch; + o->timer_what = TIMER_PREFETCH; + } else { + o->timer_when = o->ttl; + o->timer_what = TIMER_TTL; + } +} + /*--------------------------------------------------------------------*/ void @@ -68,7 +91,8 @@ { CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); - assert(o->heap_idx == 0); + assert(o->timer_idx == 0); + update_object_when(o); LOCK(&exp_mtx); binheap_insert(exp_heap, o); VTAILQ_INSERT_TAIL(&exp_lru, o, deathrow); @@ -82,7 +106,7 @@ CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); if (o->lru_stamp + params->lru_timeout < now) { LOCK(&exp_mtx); /* XXX: should be ..._TRY */ - if (o->heap_idx != lru_target && o->heap_idx != 0) { + if (o->timer_idx != lru_target && o->timer_idx != 0) { VTAILQ_REMOVE(&exp_lru, o, deathrow); VTAILQ_INSERT_TAIL(&exp_lru, o, deathrow); o->lru_stamp = now; @@ -96,9 +120,10 @@ { LOCK(&exp_mtx); - if (o->heap_idx != lru_target) { - assert(o->heap_idx != 0); - binheap_delete(exp_heap, o->heap_idx); + if (o->timer_idx != lru_target) { + assert(o->timer_idx != 0); /* XXX: symbolic zero ? */ + update_object_when(o); + binheap_delete(exp_heap, o->timer_idx); binheap_insert(exp_heap, o); } UNLOCK(&exp_mtx); @@ -185,40 +210,58 @@ LOCK(&exp_mtx); o = binheap_root(exp_heap); CHECK_OBJ_ORNULL(o, OBJECT_MAGIC); - if (o == NULL || o->ttl > t + expearly) { + if (o == NULL || o->timer_when > t) { /* XXX: >= ? */ UNLOCK(&exp_mtx); + WSL_Flush(&ww); AZ(sleep(1)); VCL_Refresh(&sp->vcl); t = TIM_real(); continue; } - binheap_delete(exp_heap, o->heap_idx); - assert(o->heap_idx == 0); + binheap_delete(exp_heap, o->timer_idx); + assert(o->timer_idx == 0); /* Sanity check */ o2 = binheap_root(exp_heap); if (o2 != NULL) - assert(o2->ttl >= o->ttl); + assert(o2->timer_when >= o->timer_when); UNLOCK(&exp_mtx); - WSL(&ww, SLT_ExpPick, 0, "%u", o->xid); - sp->obj = o; - VCL_timeout_method(sp); + WSL(&ww, SLT_ExpPick, 0, "%u %s", o->xid, + o->timer_what == TIMER_PREFETCH ? "prefetch" : "ttl"); - if (sp->handling == VCL_RET_DISCARD) { + if (o->timer_what == TIMER_PREFETCH) { + o->prefetch = 0.0; + update_object_when(o); LOCK(&exp_mtx); - VTAILQ_REMOVE(&exp_lru, o, deathrow); - VTAILQ_INSERT_TAIL(&exp_deathrow, o, deathrow); - VSL_stats->n_deathrow++; + binheap_insert(exp_heap, o); UNLOCK(&exp_mtx); - continue; + sp->obj = o; + VCL_prefetch_method(sp); + if (sp->handling == VCL_RET_FETCH) { + WSL(&ww, SLT_Debug, 0, "Attempt Prefetch %u", + o->xid); + } + } else { /* TIMER_TTL */ + sp->obj = o; + VCL_timeout_method(sp); + + if (sp->handling == VCL_RET_DISCARD) { + LOCK(&exp_mtx); + VTAILQ_REMOVE(&exp_lru, o, deathrow); + VTAILQ_INSERT_TAIL(&exp_deathrow, o, deathrow); + VSL_stats->n_deathrow++; + UNLOCK(&exp_mtx); + } + assert(sp->handling == VCL_RET_DISCARD); } - assert(sp->handling == VCL_RET_DISCARD); } } -/*--------------------------------------------------------------------*/ +/*-------------------------------------------------------------------- + * BinHeap helper functions for objects. + */ static int object_cmp(void *priv, void *a, void *b) @@ -226,19 +269,19 @@ struct object *aa, *bb; (void)priv; - - aa = a; - bb = b; - return (aa->ttl < bb->ttl); + CAST_OBJ_NOTNULL(aa, a, OBJECT_MAGIC); + CAST_OBJ_NOTNULL(bb, b, OBJECT_MAGIC); + return (aa->timer_when < bb->timer_when); } static void object_update(void *priv, void *p, unsigned u) { - struct object *o = p; + struct object *o; (void)priv; - o->heap_idx = u; + CAST_OBJ_NOTNULL(o, p, OBJECT_MAGIC); + o->timer_idx = u; } /*-------------------------------------------------------------------- @@ -263,9 +306,9 @@ * means that we own the EXP refcnt on this object. */ VTAILQ_REMOVE(&exp_lru, o, deathrow); - binheap_delete(exp_heap, o->heap_idx); - assert(o->heap_idx == 0); - o->heap_idx = lru_target; + binheap_delete(exp_heap, o->timer_idx); + assert(o->timer_idx == 0); + o->timer_idx = lru_target; VSL_stats->n_lru_nuked++; /* May be premature */ } UNLOCK(&exp_mtx); @@ -296,7 +339,7 @@ LOCK(&exp_mtx); VSL_stats->n_lru_nuked--; /* It was premature */ VSL_stats->n_lru_saved++; - o->heap_idx = 0; + o->timer_idx = 0; o->lru_stamp = sp->wrk->used; binheap_insert(exp_heap, o); VTAILQ_INSERT_TAIL(&exp_lru, o, deathrow); Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-14 10:30:47 UTC (rev 2343) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-14 10:42:56 UTC (rev 2344) @@ -216,7 +216,7 @@ h->hd[HTTP_HDR_URL].b, oh->hash)) { o->ttl = 0; WSP(sp, SLT_ExpBan, "%u was banned", o->xid); - if (o->heap_idx != 0) + if (o->timer_idx != 0) EXP_TTLchange(o); } else if (o->vary == NULL || VRY_Match(sp, o->vary)) break; Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2008-01-14 10:30:47 UTC (rev 2343) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2008-01-14 10:42:56 UTC (rev 2344) @@ -292,7 +292,7 @@ if (a < 0) a = 0; sp->obj->ttl = sp->t_req + a; - if (sp->obj->heap_idx != 0) + if (sp->obj->timer_idx != 0) EXP_TTLchange(sp->obj); } @@ -306,15 +306,31 @@ /*--------------------------------------------------------------------*/ +/* XXX: the VCL_info messages has unexpected fractions on the ttl */ + void VRT_l_obj_prefetch(const struct sess *sp, double a) { CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ - sp->obj->prefetch = a; - if (a > 0.0) - sp->obj->prefetch += sp->t_req; + sp->obj->prefetch = 0.0; + if (a == 0.0) + sp->obj->prefetch = a; + else if (a > 0.0 && a + sp->t_req <= sp->obj->ttl) + sp->obj->prefetch = a + sp->t_req; + else if (a < 0.0 && a + sp->obj->ttl > sp->t_req) + sp->obj->prefetch = a; + else if (a > 0.0) + WSL(sp->wrk, SLT_VCL_info, sp->id, + "XID %u: obj.prefetch (%g) after TTL (%g), ignored.", + sp->obj->xid, a, sp->obj->ttl - sp->t_req); + else /* if (a < 0.0) */ + WSL(sp->wrk, SLT_VCL_info, sp->id, + "XID %u: obj.prefetch (%g) less than ttl (%g), ignored.", + sp->obj->xid, a, sp->obj->ttl - sp->t_req); + if (sp->obj->timer_idx != 0) + EXP_TTLchange(sp->obj); } double Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-14 10:30:47 UTC (rev 2343) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-14 10:42:56 UTC (rev 2344) @@ -128,6 +128,7 @@ " if (obj.http.Set-Cookie) {\n" " pass;\n" " }\n" + " set obj.prefetch = -30s;" " insert;\n" "}\n" "sub vcl_deliver {\n" @@ -136,6 +137,9 @@ "sub vcl_discard {\n" " discard;\n" "}\n" + "sub vcl_prefetch {\n" + " fetch;\n" + "}\n" "sub vcl_timeout {\n" " discard;\n" "}\n"; @@ -278,7 +282,7 @@ /* Next, try to load the object into the management process */ if ((dlh = dlopen(of, RTLD_NOW | RTLD_LOCAL)) == NULL) { vsb_printf(sb, - "%s(): failed to load compiled VCL program: %s", + "%s(): failed to load compiled VCL program:\n %s", __func__, dlerror()); unlink(of); free(of); @@ -419,7 +423,7 @@ if (C_flag) return (0); if (vf == NULL) { - fprintf(stderr, "VCL compilation failed"); + fprintf(stderr, "\nVCL compilation failed\n"); return (1); } vp = mgt_vcc_add("boot", vf); From phk at projects.linpro.no Wed Jan 16 10:08:34 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 16 Jan 2008 11:08:34 +0100 (CET) Subject: r2345 - trunk/varnish-cache/bin/varnishd Message-ID: <20080116100834.DD5841EC1F6@projects.linpro.no> Author: phk Date: 2008-01-16 11:08:34 +0100 (Wed, 16 Jan 2008) New Revision: 2345 Modified: trunk/varnish-cache/bin/varnishd/cache_http.c Log: Fix ticket #179: non-ascii reason-phrase. Modified: trunk/varnish-cache/bin/varnishd/cache_http.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-14 10:42:56 UTC (rev 2344) +++ trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-16 10:08:34 UTC (rev 2345) @@ -64,7 +64,7 @@ [' '] = C_SP, }; -#define vctyp(x, y) (vctyptab[(int)(x)] & (y)) +#define vctyp(x, y) (vctyptab[(unsigned)(x) & 0xff] & (y)) #define LOGMTX2(ax, bx, cx) [bx] = SLT_##ax##cx From phk at projects.linpro.no Wed Jan 16 10:15:27 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 16 Jan 2008 11:15:27 +0100 (CET) Subject: r2346 - trunk/varnish-cache/man Message-ID: <20080116101527.B43911EC0B5@projects.linpro.no> Author: phk Date: 2008-01-16 11:15:27 +0100 (Wed, 16 Jan 2008) New Revision: 2346 Modified: trunk/varnish-cache/man/vcl.7 Log: fix spelling mistake reported in #183 Modified: trunk/varnish-cache/man/vcl.7 =================================================================== --- trunk/varnish-cache/man/vcl.7 2008-01-16 10:08:34 UTC (rev 2345) +++ trunk/varnish-cache/man/vcl.7 2008-01-16 10:15:27 UTC (rev 2346) @@ -97,7 +97,7 @@ which can later be used to match client addresses: .Bd -literal -offset 4n acl local { - "locahost"; /* myself */ + "localhost"; /* myself */ "10.0.0.1"/8; /* and everyone on the local network */ ! "10.0.0.23"; /* except for the dialin router */ } From phk at projects.linpro.no Wed Jan 16 11:27:35 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 16 Jan 2008 12:27:35 +0100 (CET) Subject: r2347 - trunk/varnish-cache/bin/varnishd Message-ID: <20080116112735.6B7201EC2A3@projects.linpro.no> Author: phk Date: 2008-01-16 12:27:34 +0100 (Wed, 16 Jan 2008) New Revision: 2347 Modified: trunk/varnish-cache/bin/varnishd/cache.h Log: Move the enum out of the struct to cater for marginal pedantism on the part of FlexeLint. Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2008-01-16 10:15:27 UTC (rev 2346) +++ trunk/varnish-cache/bin/varnishd/cache.h 2008-01-16 11:27:34 UTC (rev 2347) @@ -221,6 +221,11 @@ /* -------------------------------------------------------------------*/ +enum e_objtimer { + TIMER_TTL, + TIMER_PREFETCH +}; + struct object { unsigned magic; #define OBJECT_MAGIC 0x32851d42 @@ -233,10 +238,7 @@ unsigned char *vary; double timer_when; - enum { - TIMER_TTL, - TIMER_PREFETCH - } timer_what; + enum e_objtimer timer_what; unsigned timer_idx; unsigned ban_seq; From phk at projects.linpro.no Wed Jan 16 11:34:28 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 16 Jan 2008 12:34:28 +0100 (CET) Subject: r2348 - trunk/varnish-cache/bin/varnishd Message-ID: <20080116113428.8C6C11EC1F6@projects.linpro.no> Author: phk Date: 2008-01-16 12:34:28 +0100 (Wed, 16 Jan 2008) New Revision: 2348 Modified: trunk/varnish-cache/bin/varnishd/cache_http.c trunk/varnish-cache/bin/varnishd/cache_pool.c trunk/varnish-cache/bin/varnishd/common.h trunk/varnish-cache/bin/varnishd/shmlog.c Log: Introduce the TRUST_ME() macro for voilating the C compilers pointer sensibilities. If only they had done const right... Modified: trunk/varnish-cache/bin/varnishd/cache_http.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-16 11:27:34 UTC (rev 2347) +++ trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-16 11:34:28 UTC (rev 2348) @@ -522,8 +522,8 @@ assert(n < HTTP_HDR_MAX); AN(fm); - to->hd[n].b = (void*)(uintptr_t)fm; - to->hd[n].e = (void*)(uintptr_t)strchr(fm, '\0'); + to->hd[n].b = TRUST_ME(fm); + to->hd[n].e = strchr(to->hd[n].b, '\0'); to->hdf[n] = 0; } Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_pool.c 2008-01-16 11:27:34 UTC (rev 2347) +++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2008-01-16 11:34:28 UTC (rev 2348) @@ -135,7 +135,7 @@ len = strlen(ptr); if (w->niov == MAX_IOVS) (void)WRK_Flush(w); - w->iov[w->niov].iov_base = (void*)(uintptr_t)ptr; + w->iov[w->niov].iov_base = TRUST_ME(ptr); w->iov[w->niov].iov_len = len; w->liov += len; w->niov++; Modified: trunk/varnish-cache/bin/varnishd/common.h =================================================================== --- trunk/varnish-cache/bin/varnishd/common.h 2008-01-16 11:27:34 UTC (rev 2347) +++ trunk/varnish-cache/bin/varnishd/common.h 2008-01-16 11:34:28 UTC (rev 2348) @@ -44,3 +44,5 @@ void TCP_name(const struct sockaddr *addr, unsigned l, char *abuf, unsigned alen, char *pbuf, unsigned plen); void TCP_myname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen); int TCP_filter_http(int sock); + +#define TRUST_ME(ptr) ((void*)(uintptr_t)(ptr)) Modified: trunk/varnish-cache/bin/varnishd/shmlog.c =================================================================== --- trunk/varnish-cache/bin/varnishd/shmlog.c 2008-01-16 11:27:34 UTC (rev 2347) +++ trunk/varnish-cache/bin/varnishd/shmlog.c 2008-01-16 11:34:28 UTC (rev 2348) @@ -77,7 +77,7 @@ } static void -vsl_hdr(enum shmlogtag tag, unsigned char *p, unsigned len, int id) +vsl_hdr(enum shmlogtag tag, unsigned char *p, unsigned len, unsigned id) { p[__SHMLOG_LEN_HIGH] = (len >> 8) & 0xff; @@ -142,8 +142,8 @@ va_start(ap, fmt); if (strchr(fmt, '%') == NULL) { - t.b = (void*)(uintptr_t)fmt; - t.e = strchr(fmt, '\0'); + t.b = TRUST_ME(fmt); + t.e = strchr(t.b, '\0'); VSLR(tag, id, t); } else { LOCKSHM(&vsl_mtx); @@ -239,8 +239,8 @@ va_start(ap, fmt); if (strchr(fmt, '%') == NULL) { - t.b = (void*)(uintptr_t)fmt; - t.e = strchr(fmt, '\0'); + t.b = TRUST_ME(fmt); + t.e = strchr(t.b, '\0'); WSLR(w, tag, id, t); } else { assert(w->wlp < w->wle); From phk at projects.linpro.no Wed Jan 16 11:39:06 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 16 Jan 2008 12:39:06 +0100 (CET) Subject: r2349 - trunk/varnish-cache/bin/varnishd Message-ID: <20080116113906.B29D01EC0B5@projects.linpro.no> Author: phk Date: 2008-01-16 12:39:06 +0100 (Wed, 16 Jan 2008) New Revision: 2349 Modified: trunk/varnish-cache/bin/varnishd/cache_http.c Log: Make Flexelint happier about our private ctype. Modified: trunk/varnish-cache/bin/varnishd/cache_http.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-16 11:34:28 UTC (rev 2348) +++ trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-16 11:39:06 UTC (rev 2349) @@ -64,8 +64,13 @@ [' '] = C_SP, }; -#define vctyp(x, y) (vctyptab[(unsigned)(x) & 0xff] & (y)) +static int +vctyp(unsigned char x, unsigned char y) +{ + return (vctyptab[x] & (y)); +} + #define LOGMTX2(ax, bx, cx) [bx] = SLT_##ax##cx #define LOGMTX1(ax) { \ From phk at projects.linpro.no Wed Jan 16 11:44:30 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 16 Jan 2008 12:44:30 +0100 (CET) Subject: r2350 - trunk/varnish-cache/bin/varnishd Message-ID: <20080116114430.B01561EC1F6@projects.linpro.no> Author: phk Date: 2008-01-16 12:44:30 +0100 (Wed, 16 Jan 2008) New Revision: 2350 Modified: trunk/varnish-cache/bin/varnishd/cache_httpconn.c Log: Mark return value as intentionally unused. Modified: trunk/varnish-cache/bin/varnishd/cache_httpconn.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_httpconn.c 2008-01-16 11:39:06 UTC (rev 2349) +++ trunk/varnish-cache/bin/varnishd/cache_httpconn.c 2008-01-16 11:44:30 UTC (rev 2350) @@ -86,7 +86,7 @@ htc->magic = HTTP_CONN_MAGIC; htc->ws = ws; htc->fd = fd; - WS_Reserve(htc->ws, (htc->ws->e - htc->ws->s) / 2); + (void)WS_Reserve(htc->ws, (htc->ws->e - htc->ws->s) / 2); htc->rxbuf.b = ws->f; htc->rxbuf.e = ws->f; htc->pipeline.b = NULL; @@ -106,7 +106,7 @@ int i; CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC); - WS_Reserve(htc->ws, (htc->ws->e - htc->ws->s) / 2); + (void)WS_Reserve(htc->ws, (htc->ws->e - htc->ws->s) / 2); htc->rxbuf.b = htc->ws->f; htc->rxbuf.e = htc->ws->f; if (htc->pipeline.b != NULL) { From phk at projects.linpro.no Wed Jan 16 14:49:28 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 16 Jan 2008 15:49:28 +0100 (CET) Subject: r2351 - trunk/varnish-cache/bin/varnishd Message-ID: <20080116144928.3E4331EC0B5@projects.linpro.no> Author: phk Date: 2008-01-16 15:49:27 +0100 (Wed, 16 Jan 2008) New Revision: 2351 Modified: trunk/varnish-cache/bin/varnishd/cache_http.c Log: Make the destination pointer optional to http_GetHdr(), we might just want to know if the header is there at all. Modified: trunk/varnish-cache/bin/varnishd/cache_http.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-16 11:44:30 UTC (rev 2350) +++ trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-16 14:49:27 UTC (rev 2351) @@ -233,10 +233,12 @@ *ptr = NULL; return (0); } - p = hp->hd[u].b + l; - while (isspace(*p)) - p++; - *ptr = p; + if (ptr != NULL) { + p = hp->hd[u].b + l; + while (isspace(*p)) + p++; + *ptr = p; + } return (1); } From phk at projects.linpro.no Wed Jan 16 14:53:49 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 16 Jan 2008 15:53:49 +0100 (CET) Subject: r2352 - trunk/varnish-cache/bin/varnishd Message-ID: <20080116145349.2406E1EC1F6@projects.linpro.no> Author: phk Date: 2008-01-16 15:53:48 +0100 (Wed, 16 Jan 2008) New Revision: 2352 Modified: trunk/varnish-cache/bin/varnishd/cache_http.c Log: Missed an assignment in last commit. Modified: trunk/varnish-cache/bin/varnishd/cache_http.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-16 14:49:27 UTC (rev 2351) +++ trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-16 14:53:48 UTC (rev 2352) @@ -230,7 +230,8 @@ hdr++; u = http_findhdr(hp, l - 1, hdr); if (u == 0) { - *ptr = NULL; + if (ptr != NULL) + *ptr = NULL; return (0); } if (ptr != NULL) { From phk at projects.linpro.no Wed Jan 16 15:15:39 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 16 Jan 2008 16:15:39 +0100 (CET) Subject: r2353 - in trunk/varnish-cache: bin/varnishd include Message-ID: <20080116151539.A23FF1EC0B5@projects.linpro.no> Author: phk Date: 2008-01-16 16:15:39 +0100 (Wed, 16 Jan 2008) New Revision: 2353 Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_center.c trunk/varnish-cache/bin/varnishd/cache_fetch.c trunk/varnish-cache/bin/varnishd/mgt_vcc.c trunk/varnish-cache/include/http_headers.h Log: Rework the handling of message-bodies in requests to be closer to RFC2616 and catch things we don't deal with better. Move code to receive body from request into separate function, FetchReqBody() so it can be invoked when center::STP_HIT. Check read errors and make FetchReqBody() return an error code for client/server side so we don't penalize backends for client trouble. Make it a client error, for now, to send chunked encoding. This also isolates the big stack buffer from the subsequent function calls in Fetch() and will be saner if we ever add chunked-encoding handling. Only send the body to the backend on pass, otherwise discard it. This is controlled via the sp->sendbody flag which is reset in at STP_RECV and set it at STP_PASS. In STP_HIT, on deliver, call FetchReqBody() to dispose of any body the request might contain. Filter Content-Length: headers out (c->b) on fetches, but not for pass. Rewrite default vcl_recv{} to be take advantage of our new capabilities. This should make PUT, DELETE, OPTIONS, and TRACE work as well as POST. Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2008-01-16 14:53:48 UTC (rev 2352) +++ trunk/varnish-cache/bin/varnishd/cache.h 2008-01-16 15:15:39 UTC (rev 2353) @@ -329,6 +329,7 @@ enum step step; unsigned cur_method; unsigned handling; + unsigned char sendbody; unsigned char wantbody; int err_code; const char *err_reason; @@ -469,6 +470,7 @@ /* cache_fetch.c */ int Fetch(struct sess *sp); +int FetchReqBody(struct sess *sp); /* cache_hash.c */ void HSH_Prealloc(struct sess *sp); Modified: trunk/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_center.c 2008-01-16 14:53:48 UTC (rev 2352) +++ trunk/varnish-cache/bin/varnishd/cache_center.c 2008-01-16 15:15:39 UTC (rev 2353) @@ -451,6 +451,8 @@ VCL_hit_method(sp); if (sp->handling == VCL_RET_DELIVER) { + /* Dispose of any body part of the request */ + FetchReqBody(sp); sp->step = STP_DELIVER; return (0); } @@ -682,6 +684,7 @@ sp->obj = sp->wrk->nobj; sp->wrk->nobj = NULL; sp->obj->busy = 1; + sp->sendbody = 1; sp->step = STP_FETCH; return (0); } @@ -760,6 +763,7 @@ VCL_recv_method(sp); sp->wantbody = (strcmp(sp->http->hd[HTTP_HDR_REQ].b, "HEAD") != 0); + sp->sendbody = 0; switch(sp->handling) { case VCL_RET_LOOKUP: /* XXX: discard req body, if any */ Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2008-01-16 14:53:48 UTC (rev 2352) +++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2008-01-16 15:15:39 UTC (rev 2353) @@ -246,6 +246,49 @@ return (1); } +/*-------------------------------------------------------------------- + * Fetch any body attached to the incoming request, and either write it + * to the backend (if we pass) or discard it (anything else). + * This is mainly a separate function to isolate the stack buffer and + * to contain the complexity when we start handling chunked encoding. + */ + +int +FetchReqBody(struct sess *sp) +{ + unsigned long content_length; + char buf[8192]; + char *ptr, *endp; + int read; + + if (http_GetHdr(sp->http, H_Content_Length, &ptr)) { + + content_length = strtoul(ptr, &endp, 10); + /* XXX should check result of conversion */ + while (content_length) { + if (content_length > sizeof buf) + read = sizeof buf; + else + read = content_length; + read = HTC_Read(sp->htc, buf, read); + if (read < 0) + return (1); + content_length -= read; + if (!sp->sendbody) + continue; + WRK_Write(sp->wrk, buf, read); + if (WRK_Flush(sp->wrk)) + return (2); + } + } + if (http_GetHdr(sp->http, H_Transfer_Encoding, NULL)) { + /* XXX: Handle chunked encoding. */ + WSL(sp->wrk, SLT_Debug, sp->fd, "Transfer-Encoding in request"); + return (1); + } + return (0); +} + /*--------------------------------------------------------------------*/ int @@ -261,7 +304,6 @@ int mklen, is_head; struct http_conn htc[1]; int i; - char *ptr, *endp; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC); @@ -289,31 +331,13 @@ WRK_Reset(w, &vc->fd); http_Write(w, hp, 0); - /* - * If a POST request was passed to fetch, we must send any - * pipelined bytes to the backend as well - */ - if (http_GetHdr(sp->http, H_Content_Length, &ptr)) { - unsigned long content_length; - char buf[8192]; - int read; - - content_length = strtoul(ptr, &endp, 10); - /* XXX should check result of conversion */ - while (content_length) { - if (content_length > sizeof buf) - read = sizeof buf; - else - read = content_length; - read = HTC_Read(sp->htc, buf, read); - WRK_Write(w, buf, read); - if (WRK_Flush(w)) { - VBE_UpdateHealth(sp, vc, -1); - VBE_ClosedFd(sp->wrk, vc); - return (__LINE__); - } - content_length -= read; - } + /* Deal with any message-body the request might have */ + i = FetchReqBody(sp); + if (i > 0) { + if (i > 1) + VBE_UpdateHealth(sp, vc, -1); + VBE_ClosedFd(sp->wrk, vc); + return (__LINE__); } if (WRK_Flush(w)) { Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-16 14:53:48 UTC (rev 2352) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-16 15:15:39 UTC (rev 2353) @@ -77,13 +77,26 @@ */ static const char *default_vcl = "sub vcl_recv {\n" - " if (req.request != \"GET\" && req.request != \"HEAD\") {\n" + " if (req.request != \"GET\" &&\n" + " req.request != \"HEAD\" &&\n" + " req.request != \"PUT\" &&\n" + " req.request != \"POST\" &&\n" + " req.request != \"TRACE\" &&\n" + " req.request != \"OPTIONS\" &&\n" + " req.request != \"DELETE\") {\n" + " /* Non-RFC2616 or CONNECT which is weird. */\n" " pipe;\n" " }\n" " if (req.http.Expect) {\n" + " /* Expect is just too hard at present. */\n" " pipe;\n" " }\n" + " if (req.request != \"GET\" && req.request != \"HEAD\") {\n" + " /* We only deal with GET and HEAD by default */\n" + " pass;\n" + " }\n" " if (req.http.Authenticate || req.http.Cookie) {\n" + " /* Not cacheable by default */\n" " pass;\n" " }\n" " lookup;\n" Modified: trunk/varnish-cache/include/http_headers.h =================================================================== --- trunk/varnish-cache/include/http_headers.h 2008-01-16 14:53:48 UTC (rev 2352) +++ trunk/varnish-cache/include/http_headers.h 2008-01-16 15:15:39 UTC (rev 2353) @@ -65,7 +65,7 @@ HTTPH("Connection", H_Connection, 3, 3, HTTPH_R_PASS|HTTPH_A_PASS|HTTPH_R_FETCH|HTTPH_A_INS, 0, 0) /* RFC2616 14.10 */ HTTPH("Content-Encoding", H_Content_Encoding, 2, 0, 0, 0, 0) /* RFC2616 14.11 */ HTTPH("Content-Langugae", H_Content_Language, 2, 0, 0, 0, 0) /* RFC2616 14.12 */ -HTTPH("Content-Length", H_Content_Length, 2, 2, HTTPH_A_INS, 0, 0) /* RFC2616 14.13 */ +HTTPH("Content-Length", H_Content_Length, 2, 2, HTTPH_R_FETCH|HTTPH_A_INS, 0, 0) /* RFC2616 14.13 */ HTTPH("Content-Location", H_Content_Location, 2, 0, 0, 0, 0) /* RFC2616 14.14 */ HTTPH("Content-MD5", H_Content_MD5, 2, 0, 0, 0, 0) /* RFC2616 14.15 */ HTTPH("Content-Range", H_Content_Range, 2, 3, HTTPH_R_PASS|HTTPH_A_PASS|HTTPH_R_FETCH|HTTPH_A_INS, 0, 0) /* RFC2616 14.16 */ From ssm at projects.linpro.no Fri Jan 18 07:35:17 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Fri, 18 Jan 2008 08:35:17 +0100 (CET) Subject: r2354 - trunk/varnish-cache/man Message-ID: <20080118073517.B509E1EC2A3@projects.linpro.no> Author: ssm Date: 2008-01-18 08:35:17 +0100 (Fri, 18 Jan 2008) New Revision: 2354 Modified: trunk/varnish-cache/man/vcl.7 Log: Use 192.0.2.0/24 in our examples, this net is reserved for documentation in RFC3330 Modified: trunk/varnish-cache/man/vcl.7 =================================================================== --- trunk/varnish-cache/man/vcl.7 2008-01-16 15:15:39 UTC (rev 2353) +++ trunk/varnish-cache/man/vcl.7 2008-01-18 07:35:17 UTC (rev 2354) @@ -98,8 +98,8 @@ .Bd -literal -offset 4n acl local { "localhost"; /* myself */ - "10.0.0.1"/8; /* and everyone on the local network */ - ! "10.0.0.23"; /* except for the dialin router */ + "192.0.2.0"/24; /* and everyone on the local network */ + ! "192.0.2.23"; /* except for the dialin router */ } .Ed .Pp @@ -616,7 +616,7 @@ .Bd -literal -offset 4n acl purge { "localhost"; - "10.0.0.1"/8; + "192.0.2.1"/24; } sub vcl_recv { From phk at projects.linpro.no Fri Jan 18 10:42:28 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Fri, 18 Jan 2008 11:42:28 +0100 (CET) Subject: r2355 - trunk/varnish-cache/bin/varnishd Message-ID: <20080118104228.195361EC21C@projects.linpro.no> Author: phk Date: 2008-01-18 11:42:27 +0100 (Fri, 18 Jan 2008) New Revision: 2355 Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c Log: Make sure to terminate the movement of a request's body if we get an EOF from the client. Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2008-01-18 07:35:17 UTC (rev 2354) +++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2008-01-18 10:42:27 UTC (rev 2355) @@ -271,7 +271,7 @@ else read = content_length; read = HTC_Read(sp->htc, buf, read); - if (read < 0) + if (read <= 0) return (1); content_length -= read; if (!sp->sendbody) From phk at projects.linpro.no Mon Jan 21 13:09:21 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 21 Jan 2008 14:09:21 +0100 (CET) Subject: r2356 - in trunk/varnish-cache: bin/varnishd include lib/libvcl Message-ID: <20080121130921.427EE1EC2A4@projects.linpro.no> Author: phk Date: 2008-01-21 14:09:17 +0100 (Mon, 21 Jan 2008) New Revision: 2356 Modified: trunk/varnish-cache/bin/varnishd/cache_backend_simple.c trunk/varnish-cache/bin/varnishd/mgt_vcc.c trunk/varnish-cache/include/vrt.h trunk/varnish-cache/lib/libvcl/vcc_backend.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c Log: Start the long awaited overhaul of the backend code and syntax. Off the bat, this affects only the simple backend case, and the main thrust is a syntax change from a dynamic procedural assignment style: backend b1 { set backend.host = "fs.freebsd.dk"; set backend..port = "80"; } to a constant structural definition style: backend b1 { .host = "fs.freebsd.dk"; .port = "80"; } A helpfull compile error will advice on this change. Modified: trunk/varnish-cache/bin/varnishd/cache_backend_simple.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend_simple.c 2008-01-18 10:42:27 UTC (rev 2355) +++ trunk/varnish-cache/bin/varnishd/cache_backend_simple.c 2008-01-21 13:09:17 UTC (rev 2356) @@ -395,11 +395,11 @@ AN(t->name); REPLACE(b->vcl_name, t->name); - AN(t->port); - REPLACE(bes->portname, t->port); + AN(t->host->portname); + REPLACE(bes->portname, t->host->portname); - AN(t->host); - REPLACE(bes->hostname, t->host); + AN(t->host->hostname); + REPLACE(bes->hostname, t->host->hostname); /* * The VCL compiler already did a lookup, but we'll do another one @@ -410,7 +410,7 @@ UNLOCK(&b->mtx); if (p != NULL) printf("Warning: could not lookup backend %s (%s:%s): %s", - t->name, t->host, t->port, p); + b->vcl_name, bes->hostname, bes->portname, p); *bp = b; } Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-18 10:42:27 UTC (rev 2355) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-21 13:09:17 UTC (rev 2356) @@ -418,8 +418,8 @@ buf = NULL; asprintf(&buf, "backend default {\n" - " set backend.host = \"%s\";\n" - " set backend.port = \"%s\";\n" + " .host = \"%s\";\n" + " .port = \"%s\";\n" "}\n", addr, port ? port : "http"); free(addr); free(port); Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2008-01-18 10:42:27 UTC (rev 2355) +++ trunk/varnish-cache/include/vrt.h 2008-01-21 13:09:17 UTC (rev 2356) @@ -40,11 +40,15 @@ struct VCL_conf; struct sockaddr; +struct vrt_backend_host { + const char *portname; + const char *hostname; +}; + struct vrt_simple_backend { - const char *ident; - const char *name; - const char *port; - const char *host; + const char *ident; + const char *name; + const struct vrt_backend_host *host; }; struct vrt_backend_entry { Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-18 10:42:27 UTC (rev 2355) +++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-21 13:09:17 UTC (rev 2356) @@ -84,107 +84,162 @@ Fc(tl, 0, ",\n"); } -void -vcc_ParseSimpleBackend(struct tokenlist *tl) +/*-------------------------------------------------------------------- + * Parse and emit a backend specification. + * + * The syntax is the following: + * + * backend_spec: + * name_of_backend # by reference + * '{' be_elements '}' # by specification + * + * be_elements: + * be_element + * be_element be_elements + * + * be_element: + * '.' name '=' value ';' + * + * The struct vrt_backend_host is emitted to Fh(). + */ + +static void +vcc_ParseBackendHost(struct tokenlist *tl, int *nbh) { - struct var *vp; - struct token *t_be = NULL; + struct token *t_field; + struct token *t_first; struct token *t_host = NULL; struct token *t_port = NULL; - struct token *t_first; const char *ep; t_first = tl->t; + *nbh = tl->nbackend_host++; + + if (tl->t->tok == ID) { + ErrInternal(tl); /* Reference by name */ + return; + } + ExpectErr(tl, '{'); vcc_NextToken(tl); - ExpectErr(tl, ID); - t_be = tl->t; - vcc_AddDef(tl, tl->t, R_BACKEND); - /* In the compiled vcl we use these macros to refer to backends */ - Fh(tl, 1, "#define VGC_backend_%.*s (VCL_conf.backend[%d])\n", - PF(tl->t), tl->nbackend); + Fh(tl, 0, "\nstatic const struct vrt_backend_host bh_%d = {\n", + *nbh); - vcc_NextToken(tl); - ExpectErr(tl, '{'); - vcc_NextToken(tl); - - while (1) { - if (tl->t->tok == '}') - break; - ExpectErr(tl, ID); - if (!vcc_IdIs(tl->t, "set")) { - vsb_printf(tl->sb, - "Expected 'set', found "); - vcc_ErrToken(tl, tl->t); - vsb_printf(tl->sb, " at\n"); - vcc_ErrWhere(tl, tl->t); - return; - } + /* Check for old syntax */ + if (tl->t->tok == ID && vcc_IdIs(tl->t, "set")) { + vsb_printf(tl->sb, + "NB: Backend Syntax has changed:\n" + "Remove \"set\" and \"backend\" in front" + " of backend fields.\n" ); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, " at\n"); + vcc_ErrWhere(tl, tl->t); + return; + } + + while (tl->t->tok == '.') { vcc_NextToken(tl); - ExpectErr(tl, VAR); - vp = vcc_FindVar(tl, tl->t, vcc_be_vars); - ERRCHK(tl); - assert(vp != NULL); + + ExpectErr(tl, ID); /* name */ + t_field = tl->t; vcc_NextToken(tl); + ExpectErr(tl, '='); vcc_NextToken(tl); - switch (vp->fmt) { - case HOSTNAME: + + if (vcc_IdIs(t_field, "host")) { ExpectErr(tl, CSTR); + assert(tl->t->dec != NULL); t_host = tl->t; vcc_NextToken(tl); - break; - case PORTNAME: + } else if (vcc_IdIs(t_field, "port")) { ExpectErr(tl, CSTR); + assert(tl->t->dec != NULL); t_port = tl->t; vcc_NextToken(tl); - break; - default: + } else { vsb_printf(tl->sb, - "Assignments not possible for '%s'\n", vp->name); - vcc_ErrWhere(tl, tl->t); + "Unknown field in backend host specification: "); + vcc_ErrToken(tl, t_field); + vsb_printf(tl->sb, " at\n"); + vcc_ErrWhere(tl, t_field); return; } + ExpectErr(tl, ';'); vcc_NextToken(tl); } - ExpectErr(tl, '}'); if (t_host == NULL) { - vsb_printf(tl->sb, "Backend '%.*s' has no hostname\n", - PF(t_be)); + vsb_printf(tl->sb, "Backend has no hostname\n"); vcc_ErrWhere(tl, tl->t); return; } + + /* Check that the hostname makes sense */ ep = CheckHostPort(t_host->dec, "80"); if (ep != NULL) { - vsb_printf(tl->sb, "Backend '%.*s': %s\n", PF(t_be), ep); + vsb_printf(tl->sb, "Backend host '%.*s': %s\n", PF(t_host), ep); vcc_ErrWhere(tl, t_host); return; } + Fh(tl, 0, "\t.hostname = "); + EncToken(tl->fh, t_host); + Fh(tl, 0, ",\n"); + + /* Check that the hostname makes sense */ if (t_port != NULL) { ep = CheckHostPort(t_host->dec, t_port->dec); if (ep != NULL) { vsb_printf(tl->sb, - "Backend '%.*s': %s\n", PF(t_be), ep); + "Backend port '%.*s': %s\n", PF(t_port), ep); vcc_ErrWhere(tl, t_port); return; } + Fh(tl, 0, "\t.portname = "); + EncToken(tl->fh, t_port); + Fh(tl, 0, ",\n"); } + ExpectErr(tl, '}'); + Fh(tl, 0, "};\n"); vcc_NextToken(tl); +} + +void +vcc_ParseSimpleBackend(struct tokenlist *tl) +{ + struct token *t_be = NULL; + struct token *t_first; + int nbh; + + t_first = tl->t; /* T_BACKEND */ + + vcc_NextToken(tl); + + ExpectErr(tl, ID); /* name */ + t_be = tl->t; + vcc_NextToken(tl); + + vcc_ParseBackendHost(tl, &nbh); + ERRCHK(tl); + + /* In the compiled vcl we use these macros to refer to backends */ + Fh(tl, 1, "\n#define VGC_backend_%.*s (VCL_conf.backend[%d])\n", + PF(t_be), tl->nbackend); + + vcc_AddDef(tl, t_be, R_BACKEND); + + Fi(tl, 0, "\tVRT_init_simple_backend(&VGC_backend_%.*s , &sbe_%.*s);\n", + PF(t_be), PF(t_be)); + Ff(tl, 0, "\tVRT_fini_backend(VGC_backend_%.*s);\n", PF(t_be)); + Fc(tl, 0, "\nstatic const struct vrt_simple_backend sbe_%.*s = {\n", PF(t_be)); Fc(tl, 0, "\t.name = \"%.*s\",\n", PF(t_be)); - if (t_port != NULL) - Fc(tl, 0, "\t.port = %.*s,\n", PF(t_port)); - else - Fc(tl, 0, "\t.port = \"http\",\n"); - Fc(tl, 0, "\t.host = %.*s,\n", PF(t_host)); + Fc(tl, 0, "\t.host = &bh_%d,\n", nbh); vcc_EmitBeIdent(tl, t_first, tl->t); Fc(tl, 0, "};\n"); - Fi(tl, 0, "\tVRT_init_simple_backend(&VGC_backend_%.*s , &sbe_%.*s);\n", - PF(t_be), PF(t_be)); - Ff(tl, 0, "\tVRT_fini_backend(VGC_backend_%.*s);\n", PF(t_be)); + tl->nbackend++; } Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2008-01-18 10:42:27 UTC (rev 2355) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2008-01-21 13:09:17 UTC (rev 2356) @@ -78,6 +78,7 @@ VTAILQ_HEAD(, ref) refs; struct vsb *sb; int err; + int nbackend_host; int nbackend; VTAILQ_HEAD(, proc) procs; struct proc *curproc; Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-18 10:42:27 UTC (rev 2355) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-21 13:09:17 UTC (rev 2356) @@ -420,11 +420,15 @@ vsb_cat(sb, "struct VCL_conf;\n"); vsb_cat(sb, "struct sockaddr;\n"); vsb_cat(sb, "\n"); + vsb_cat(sb, "struct vrt_backend_host {\n"); + vsb_cat(sb, " const char *portname;\n"); + vsb_cat(sb, " const char *hostname;\n"); + vsb_cat(sb, "};\n"); + vsb_cat(sb, "\n"); vsb_cat(sb, "struct vrt_simple_backend {\n"); - vsb_cat(sb, " const char *ident;\n"); - vsb_cat(sb, " const char *name;\n"); - vsb_cat(sb, " const char *port;\n"); - vsb_cat(sb, " const char *host;\n"); + vsb_cat(sb, " const char *ident;\n"); + vsb_cat(sb, " const char *name;\n"); + vsb_cat(sb, " const struct vrt_backend_host *host;\n"); vsb_cat(sb, "};\n"); vsb_cat(sb, "\n"); vsb_cat(sb, "struct vrt_backend_entry {\n"); From ssm at projects.linpro.no Mon Jan 21 19:04:41 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Mon, 21 Jan 2008 20:04:41 +0100 (CET) Subject: r2357 - trunk/varnish-cache/debian Message-ID: <20080121190441.8A69B1EC09F@projects.linpro.no> Author: ssm Date: 2008-01-21 20:04:41 +0100 (Mon, 21 Jan 2008) New Revision: 2357 Modified: trunk/varnish-cache/debian/changelog Log: Debian packaging: Add a debian revision to the version number Modified: trunk/varnish-cache/debian/changelog =================================================================== --- trunk/varnish-cache/debian/changelog 2008-01-21 13:09:17 UTC (rev 2356) +++ trunk/varnish-cache/debian/changelog 2008-01-21 19:04:41 UTC (rev 2357) @@ -1,3 +1,9 @@ +varnish (1.1.2-1) unstable; urgency=low + + * Add debian revision + + -- Stig Sandbeck Mathisen Mon, 21 Jan 2008 20:00:54 +0100 + varnish (1.1.2) unstable; urgency=low * New upstream release From ssm at projects.linpro.no Mon Jan 21 19:08:01 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Mon, 21 Jan 2008 20:08:01 +0100 (CET) Subject: r2358 - in branches/1.1: . debian Message-ID: <20080121190801.CE6321EC2A4@projects.linpro.no> Author: ssm Date: 2008-01-21 20:08:01 +0100 (Mon, 21 Jan 2008) New Revision: 2358 Modified: branches/1.1/ branches/1.1/debian/changelog Log: Merged revisions 2357 via svnmerge from svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache ........ r2357 | ssm | 2008-01-21 20:04:41 +0100 (Mon, 21 Jan 2008) | 1 line Debian packaging: Add a debian revision to the version number ........ Property changes on: branches/1.1 ___________________________________________________________________ Name: svnmerge-integrated - /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324 + /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357 Modified: branches/1.1/debian/changelog =================================================================== --- branches/1.1/debian/changelog 2008-01-21 19:04:41 UTC (rev 2357) +++ branches/1.1/debian/changelog 2008-01-21 19:08:01 UTC (rev 2358) @@ -1,3 +1,9 @@ +varnish (1.1.2-1) unstable; urgency=low + + * Add debian revision + + -- Stig Sandbeck Mathisen Mon, 21 Jan 2008 20:00:54 +0100 + varnish (1.1.2) unstable; urgency=low * New upstream release From ssm at projects.linpro.no Tue Jan 22 08:28:18 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Tue, 22 Jan 2008 09:28:18 +0100 (CET) Subject: r2359 - trunk/varnish-cache/debian Message-ID: <20080122082818.B7C7F1EC412@projects.linpro.no> Author: ssm Date: 2008-01-22 09:28:18 +0100 (Tue, 22 Jan 2008) New Revision: 2359 Modified: trunk/varnish-cache/debian/varnish.logrotate Log: Debian packaging: Only reload varnishlog if it is running. (Debian bug #462029) Modified: trunk/varnish-cache/debian/varnish.logrotate =================================================================== --- trunk/varnish-cache/debian/varnish.logrotate 2008-01-21 19:08:01 UTC (rev 2358) +++ trunk/varnish-cache/debian/varnish.logrotate 2008-01-22 08:28:18 UTC (rev 2359) @@ -4,6 +4,8 @@ compress delaycompress postrotate - /usr/sbin/invoke-rc.d varnishlog reload > /dev/null + if /usr/bin/pgrep -P 1 varnishlog >/dev/null; then + /usr/sbin/invoke-rc.d varnishlog reload > /dev/null + fi endscript } From phk at projects.linpro.no Tue Jan 22 08:32:23 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 22 Jan 2008 09:32:23 +0100 (CET) Subject: r2360 - trunk/varnish-cache/lib/libvcl Message-ID: <20080122083223.86EB91EC09F@projects.linpro.no> Author: phk Date: 2008-01-22 09:32:23 +0100 (Tue, 22 Jan 2008) New Revision: 2360 Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c Log: Bail if there are multiple .host or .port fields in one backend host. Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-22 08:28:18 UTC (rev 2359) +++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-22 08:32:23 UTC (rev 2360) @@ -108,8 +108,8 @@ { struct token *t_field; struct token *t_first; - struct token *t_host = NULL; - struct token *t_port = NULL; + struct token *t_host = NULL, *t_fhost = NULL; + struct token *t_port = NULL, *t_fport = NULL; const char *ep; t_first = tl->t; @@ -150,11 +150,33 @@ if (vcc_IdIs(t_field, "host")) { ExpectErr(tl, CSTR); assert(tl->t->dec != NULL); + if (t_host != NULL) { + vsb_printf(tl->sb, + "Multiple .host fields in backend: "); + vcc_ErrToken(tl, t_field); + vsb_printf(tl->sb, " at\n"); + vcc_ErrWhere(tl, t_fhost); + vsb_printf(tl->sb, " and\n"); + vcc_ErrWhere(tl, t_field); + return; + } + t_fhost = t_field; t_host = tl->t; vcc_NextToken(tl); } else if (vcc_IdIs(t_field, "port")) { ExpectErr(tl, CSTR); assert(tl->t->dec != NULL); + if (t_port != NULL) { + vsb_printf(tl->sb, + "Multiple .port fields in backend: "); + vcc_ErrToken(tl, t_field); + vsb_printf(tl->sb, " at\n"); + vcc_ErrWhere(tl, t_fport); + vsb_printf(tl->sb, " and\n"); + vcc_ErrWhere(tl, t_field); + return; + } + t_fport = t_field; t_port = tl->t; vcc_NextToken(tl); } else { From ssm at projects.linpro.no Tue Jan 22 08:36:08 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Tue, 22 Jan 2008 09:36:08 +0100 (CET) Subject: r2361 - trunk/varnish-cache/debian Message-ID: <20080122083608.1A4A61EC6ED@projects.linpro.no> Author: ssm Date: 2008-01-22 09:36:07 +0100 (Tue, 22 Jan 2008) New Revision: 2361 Modified: trunk/varnish-cache/debian/changelog Log: Debian packaging: update changelog Modified: trunk/varnish-cache/debian/changelog =================================================================== --- trunk/varnish-cache/debian/changelog 2008-01-22 08:32:23 UTC (rev 2360) +++ trunk/varnish-cache/debian/changelog 2008-01-22 08:36:07 UTC (rev 2361) @@ -1,8 +1,10 @@ varnish (1.1.2-1) unstable; urgency=low * Add debian revision + * Check if varnishlog is running before attempting reload from + logrotate postscript (Closes: #462029) - -- Stig Sandbeck Mathisen Mon, 21 Jan 2008 20:00:54 +0100 + -- Stig Sandbeck Mathisen Tue, 22 Jan 2008 09:35:05 +0100 varnish (1.1.2) unstable; urgency=low From ssm at projects.linpro.no Tue Jan 22 08:37:46 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Tue, 22 Jan 2008 09:37:46 +0100 (CET) Subject: r2362 - in branches/1.1: . debian Message-ID: <20080122083746.0E56B1EC412@projects.linpro.no> Author: ssm Date: 2008-01-22 09:37:45 +0100 (Tue, 22 Jan 2008) New Revision: 2362 Modified: branches/1.1/ branches/1.1/debian/changelog branches/1.1/debian/varnish.logrotate Log: Merged revisions 2359,2361 via svnmerge from svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache ........ r2359 | ssm | 2008-01-22 09:28:18 +0100 (Tue, 22 Jan 2008) | 3 lines Debian packaging: Only reload varnishlog if it is running. (Debian bug #462029) ........ r2361 | ssm | 2008-01-22 09:36:07 +0100 (Tue, 22 Jan 2008) | 1 line Debian packaging: update changelog ........ Property changes on: branches/1.1 ___________________________________________________________________ Name: svnmerge-integrated - /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357 + /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357,2359,2361 Modified: branches/1.1/debian/changelog =================================================================== --- branches/1.1/debian/changelog 2008-01-22 08:36:07 UTC (rev 2361) +++ branches/1.1/debian/changelog 2008-01-22 08:37:45 UTC (rev 2362) @@ -1,8 +1,10 @@ varnish (1.1.2-1) unstable; urgency=low * Add debian revision + * Check if varnishlog is running before attempting reload from + logrotate postscript (Closes: #462029) - -- Stig Sandbeck Mathisen Mon, 21 Jan 2008 20:00:54 +0100 + -- Stig Sandbeck Mathisen Tue, 22 Jan 2008 09:35:05 +0100 varnish (1.1.2) unstable; urgency=low Modified: branches/1.1/debian/varnish.logrotate =================================================================== --- branches/1.1/debian/varnish.logrotate 2008-01-22 08:36:07 UTC (rev 2361) +++ branches/1.1/debian/varnish.logrotate 2008-01-22 08:37:45 UTC (rev 2362) @@ -4,6 +4,8 @@ compress delaycompress postrotate - /usr/sbin/invoke-rc.d varnishlog reload > /dev/null + if /usr/bin/pgrep -P 1 varnishlog >/dev/null; then + /usr/sbin/invoke-rc.d varnishlog reload > /dev/null + fi endscript } From ssm at projects.linpro.no Tue Jan 22 09:43:09 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Tue, 22 Jan 2008 10:43:09 +0100 (CET) Subject: r2363 - branches Message-ID: <20080122094309.144CC1EC5D8@projects.linpro.no> Author: ssm Date: 2008-01-22 10:43:08 +0100 (Tue, 22 Jan 2008) New Revision: 2363 Added: branches/debian/ Log: Debian packaging: Add a directory for debian branches From ssm at projects.linpro.no Tue Jan 22 09:48:23 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Tue, 22 Jan 2008 10:48:23 +0100 (CET) Subject: r2364 - branches/debian Message-ID: <20080122094823.E97941EC412@projects.linpro.no> Author: ssm Date: 2008-01-22 10:48:23 +0100 (Tue, 22 Jan 2008) New Revision: 2364 Added: branches/debian/1.1.2/ Log: Debian packaging: Add a branch for debian revisions of 1.1.2 Copied: branches/debian/1.1.2 (from rev 2362, tags/varnish-1.1.2) From phk at projects.linpro.no Tue Jan 22 09:55:36 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 22 Jan 2008 10:55:36 +0100 (CET) Subject: r2365 - in trunk/varnish-cache: include lib/libvcl Message-ID: <20080122095536.5720F1EC5D8@projects.linpro.no> Author: phk Date: 2008-01-22 10:55:36 +0100 (Tue, 22 Jan 2008) New Revision: 2365 Modified: trunk/varnish-cache/include/vrt.h trunk/varnish-cache/lib/libvcl/vcc_backend.c trunk/varnish-cache/lib/libvcl/vcc_compile.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c Log: Make it possible to refer to backend hosts (== simple backends) by name. Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2008-01-22 09:48:23 UTC (rev 2364) +++ trunk/varnish-cache/include/vrt.h 2008-01-22 09:55:36 UTC (rev 2365) @@ -43,6 +43,7 @@ struct vrt_backend_host { const char *portname; const char *hostname; + const char *ident; }; struct vrt_simple_backend { Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-22 09:48:23 UTC (rev 2364) +++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-22 09:55:36 UTC (rev 2365) @@ -69,19 +69,19 @@ */ static void -vcc_EmitBeIdent(struct tokenlist *tl, struct token *first, struct token *last) +vcc_EmitBeIdent(struct vsb *v, const struct token *first, const struct token *last) { - Fc(tl, 0, "\t.ident ="); + vsb_printf(v, "\t.ident ="); while (first != last) { if (first->dec != NULL) - Fc(tl, 0, "\n\t \"\\\"\" %.*s \"\\\" \"", + vsb_printf(v, "\n\t \"\\\"\" %.*s \"\\\" \"", PF(first)); else - Fc(tl, 0, "\n\t \"%.*s \"", PF(first)); + vsb_printf(v, "\n\t \"%.*s \"", PF(first)); first = VTAILQ_NEXT(first, list); } - Fc(tl, 0, ",\n"); + vsb_printf(v, ",\n"); } /*-------------------------------------------------------------------- @@ -111,12 +111,27 @@ struct token *t_host = NULL, *t_fhost = NULL; struct token *t_port = NULL, *t_fport = NULL; const char *ep; + struct host *h; t_first = tl->t; *nbh = tl->nbackend_host++; if (tl->t->tok == ID) { - ErrInternal(tl); /* Reference by name */ + VTAILQ_FOREACH(h, &tl->hosts, list) { + if (vcc_Teq(h->name, tl->t)) + break; + } + if (h == NULL) { + vsb_printf(tl->sb, "Reference to unknown backend "); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, " at\n"); + vcc_ErrWhere(tl, tl->t); + return; + } + vcc_NextToken(tl); + ExpectErr(tl, ';'); + vcc_NextToken(tl); + *nbh = h->hnum; return; } ExpectErr(tl, '{'); @@ -151,6 +166,7 @@ ExpectErr(tl, CSTR); assert(tl->t->dec != NULL); if (t_host != NULL) { + assert(t_fhost != NULL); vsb_printf(tl->sb, "Multiple .host fields in backend: "); vcc_ErrToken(tl, t_field); @@ -167,6 +183,7 @@ ExpectErr(tl, CSTR); assert(tl->t->dec != NULL); if (t_port != NULL) { + assert(t_fport != NULL); vsb_printf(tl->sb, "Multiple .port fields in backend: "); vcc_ErrToken(tl, t_field); @@ -223,6 +240,7 @@ } ExpectErr(tl, '}'); + vcc_EmitBeIdent(tl->fh, t_first, tl->t); Fh(tl, 0, "};\n"); vcc_NextToken(tl); } @@ -230,36 +248,40 @@ void vcc_ParseSimpleBackend(struct tokenlist *tl) { - struct token *t_be = NULL; struct token *t_first; + struct host *h; int nbh; + h = TlAlloc(tl, sizeof *h); t_first = tl->t; /* T_BACKEND */ vcc_NextToken(tl); ExpectErr(tl, ID); /* name */ - t_be = tl->t; + h->name = tl->t; vcc_NextToken(tl); vcc_ParseBackendHost(tl, &nbh); ERRCHK(tl); + h->hnum = nbh; + VTAILQ_INSERT_TAIL(&tl->hosts, h, list); + /* In the compiled vcl we use these macros to refer to backends */ Fh(tl, 1, "\n#define VGC_backend_%.*s (VCL_conf.backend[%d])\n", - PF(t_be), tl->nbackend); + PF(h->name), tl->nbackend); - vcc_AddDef(tl, t_be, R_BACKEND); + vcc_AddDef(tl, h->name, R_BACKEND); Fi(tl, 0, "\tVRT_init_simple_backend(&VGC_backend_%.*s , &sbe_%.*s);\n", - PF(t_be), PF(t_be)); - Ff(tl, 0, "\tVRT_fini_backend(VGC_backend_%.*s);\n", PF(t_be)); + PF(h->name), PF(h->name)); + Ff(tl, 0, "\tVRT_fini_backend(VGC_backend_%.*s);\n", PF(h->name)); Fc(tl, 0, "\nstatic const struct vrt_simple_backend sbe_%.*s = {\n", - PF(t_be)); - Fc(tl, 0, "\t.name = \"%.*s\",\n", PF(t_be)); + PF(h->name)); + Fc(tl, 0, "\t.name = \"%.*s\",\n", PF(h->name)); Fc(tl, 0, "\t.host = &bh_%d,\n", nbh); - vcc_EmitBeIdent(tl, t_first, tl->t); + vcc_EmitBeIdent(tl->fc, t_first, tl->t); Fc(tl, 0, "};\n"); tl->nbackend++; Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2008-01-22 09:48:23 UTC (rev 2364) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2008-01-22 09:55:36 UTC (rev 2365) @@ -478,6 +478,7 @@ tl = calloc(sizeof *tl, 1); assert(tl != NULL); + VTAILQ_INIT(&tl->hosts); VTAILQ_INIT(&tl->membits); VTAILQ_INIT(&tl->tokens); VTAILQ_INIT(&tl->refs); Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2008-01-22 09:48:23 UTC (rev 2364) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2008-01-22 09:55:36 UTC (rev 2365) @@ -59,12 +59,19 @@ char *dec; }; +struct host { + VTAILQ_ENTRY(host) list; + unsigned hnum; + struct token *name; +}; + VTAILQ_HEAD(tokenhead, token); struct tokenlist { struct tokenhead tokens; VTAILQ_HEAD(, source) sources; VTAILQ_HEAD(, membit) membits; + VTAILQ_HEAD(, host) hosts; unsigned nsources; struct source *src; struct token *t; Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-22 09:48:23 UTC (rev 2364) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-22 09:55:36 UTC (rev 2365) @@ -423,6 +423,7 @@ vsb_cat(sb, "struct vrt_backend_host {\n"); vsb_cat(sb, " const char *portname;\n"); vsb_cat(sb, " const char *hostname;\n"); + vsb_cat(sb, " const char *ident;\n"); vsb_cat(sb, "};\n"); vsb_cat(sb, "\n"); vsb_cat(sb, "struct vrt_simple_backend {\n"); From ssm at projects.linpro.no Tue Jan 22 10:00:23 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Tue, 22 Jan 2008 11:00:23 +0100 (CET) Subject: r2366 - in branches/debian/1.1.2: . debian Message-ID: <20080122100023.BE0C11EC412@projects.linpro.no> Author: ssm Date: 2008-01-22 11:00:23 +0100 (Tue, 22 Jan 2008) New Revision: 2366 Removed: branches/debian/1.1.2/debian/lintian-override Modified: branches/debian/1.1.2/ branches/debian/1.1.2/debian/changelog branches/debian/1.1.2/debian/control branches/debian/1.1.2/debian/rules branches/debian/1.1.2/debian/varnish.logrotate Log: Merged revisions 2329-2330,2357-2359,2361 via svnmerge from svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache ........ r2329 | ssm | 2008-01-02 07:25:36 +0100 (Wed, 02 Jan 2008) | 2 lines Debian packaging: Tag library and development package with correct section. ........ r2330 | ssm | 2008-01-02 07:26:23 +0100 (Wed, 02 Jan 2008) | 2 lines Debian packaging: Remove lintian overrides ........ r2357 | ssm | 2008-01-21 20:04:41 +0100 (Mon, 21 Jan 2008) | 1 line Debian packaging: Add a debian revision to the version number ........ r2359 | ssm | 2008-01-22 09:28:18 +0100 (Tue, 22 Jan 2008) | 3 lines Debian packaging: Only reload varnishlog if it is running. (Debian bug #462029) ........ r2361 | ssm | 2008-01-22 09:36:07 +0100 (Tue, 22 Jan 2008) | 1 line Debian packaging: update changelog ........ Property changes on: branches/debian/1.1.2 ___________________________________________________________________ Name: svnmerge-integrated - /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324 + /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2329-2330,2357-2359,2361 Modified: branches/debian/1.1.2/debian/changelog =================================================================== --- branches/debian/1.1.2/debian/changelog 2008-01-22 09:55:36 UTC (rev 2365) +++ branches/debian/1.1.2/debian/changelog 2008-01-22 10:00:23 UTC (rev 2366) @@ -1,3 +1,11 @@ +varnish (1.1.2-1) unstable; urgency=low + + * Add debian revision + * Check if varnishlog is running before attempting reload from + logrotate postscript (Closes: #462029) + + -- Stig Sandbeck Mathisen Tue, 22 Jan 2008 09:35:05 +0100 + varnish (1.1.2) unstable; urgency=low * New upstream release Modified: branches/debian/1.1.2/debian/control =================================================================== --- branches/debian/1.1.2/debian/control 2008-01-22 09:55:36 UTC (rev 2365) +++ branches/debian/1.1.2/debian/control 2008-01-22 10:00:23 UTC (rev 2366) @@ -24,6 +24,7 @@ operating systems. Package: libvarnish0 +Section: libs Replaces: libvarnish Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} @@ -31,6 +32,7 @@ Shared libraries for the Varnish HTTP accelerator. Package: libvarnish0-dev +Section: libdevel Replaces: libvarnish-dev Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libvarnish0 Deleted: branches/debian/1.1.2/debian/lintian-override =================================================================== --- branches/debian/1.1.2/debian/lintian-override 2008-01-22 09:55:36 UTC (rev 2365) +++ branches/debian/1.1.2/debian/lintian-override 2008-01-22 10:00:23 UTC (rev 2366) @@ -1,3 +0,0 @@ -varnish: duplicate-updaterc.d-calls-in-postinst varnish -varnish: duplicate-updaterc.d-calls-in-postinst varnishlog - Modified: branches/debian/1.1.2/debian/rules =================================================================== --- branches/debian/1.1.2/debian/rules 2008-01-22 09:55:36 UTC (rev 2365) +++ branches/debian/1.1.2/debian/rules 2008-01-22 10:00:23 UTC (rev 2366) @@ -70,7 +70,6 @@ dh_install --sourcedir=$(CURDIR)/debian/tmp install -m 644 $(CURDIR)/etc/default.vcl $(CURDIR)/debian/varnish/etc/varnish/ - install -m 644 $(CURDIR)/debian/lintian-override $(CURDIR)/debian/varnish/usr/share/lintian/overrides/varnish install -m 644 $(CURDIR)/debian/varnish.logrotate $(CURDIR)/debian/varnish/etc/logrotate.d/varnish Modified: branches/debian/1.1.2/debian/varnish.logrotate =================================================================== --- branches/debian/1.1.2/debian/varnish.logrotate 2008-01-22 09:55:36 UTC (rev 2365) +++ branches/debian/1.1.2/debian/varnish.logrotate 2008-01-22 10:00:23 UTC (rev 2366) @@ -4,6 +4,8 @@ compress delaycompress postrotate - /usr/sbin/invoke-rc.d varnishlog reload > /dev/null + if /usr/bin/pgrep -P 1 varnishlog >/dev/null; then + /usr/sbin/invoke-rc.d varnishlog reload > /dev/null + fi endscript } From phk at projects.linpro.no Tue Jan 22 10:48:50 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 22 Jan 2008 11:48:50 +0100 (CET) Subject: r2367 - in trunk/varnish-cache: include lib/libvcl Message-ID: <20080122104850.310071EC5D8@projects.linpro.no> Author: phk Date: 2008-01-22 11:48:49 +0100 (Tue, 22 Jan 2008) New Revision: 2367 Modified: trunk/varnish-cache/include/vrt.h trunk/varnish-cache/lib/libvcl/vcc_backend.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_token_defs.h Log: Parse a random director into an appropriate data structure, still bits missing. Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2008-01-22 10:00:23 UTC (rev 2366) +++ trunk/varnish-cache/include/vrt.h 2008-01-22 10:48:49 UTC (rev 2367) @@ -65,6 +65,17 @@ struct vrt_backend_entry *bentry; }; +struct vrt_dir_random_entry { + const struct vrt_backend_host *host; + double weight; +}; + +struct vrt_dir_random { + unsigned nmember; + struct vrt_dir_random_entry *members; + const char *ident; +}; + struct vrt_random_backend { const char *name; unsigned weighted; Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-22 10:00:23 UTC (rev 2366) +++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-22 10:48:49 UTC (rev 2367) @@ -85,7 +85,7 @@ } /*-------------------------------------------------------------------- - * Parse and emit a backend specification. + * Parse and emit a backend host specification. * * The syntax is the following: * @@ -245,8 +245,12 @@ vcc_NextToken(tl); } +/*-------------------------------------------------------------------- + * Parse a plain backend + */ + void -vcc_ParseSimpleBackend(struct tokenlist *tl) +vcc_ParseBackend(struct tokenlist *tl) { struct token *t_first; struct host *h; @@ -287,171 +291,102 @@ tl->nbackend++; } -void -vcc_ParseBalancedBackend(struct tokenlist *tl) +/*-------------------------------------------------------------------- + * Parse directors + */ + +static void +vcc_ParseRandomDirector(struct tokenlist *tl, struct token *t_first, struct token *t_dir) { - struct var *vp; - struct token *t_be = NULL; - struct token *t_host = NULL; - struct token *t_port = NULL; - double t_weight = 0; - const char *ep; - int cnt = 0; - int weighted = 0; - double weight = 0; - unsigned backend_type = tl->t->tok; + struct token *t_field, *tb, *tw; + int nbh, nelem; - vcc_NextToken(tl); - ExpectErr(tl, ID); - t_be = tl->t; - vcc_AddDef(tl, tl->t, R_BACKEND); + (void)t_first; + (void)t_dir; - /* In the compiled vcl we use these macros to refer to backends */ - Fh(tl, 1, "#define VGC_backend_%.*s (VCL_conf.backend[%d])\n", - PF(tl->t), tl->nbackend); + vcc_NextToken(tl); /* ID: policy (= random) */ - vcc_NextToken(tl); ExpectErr(tl, '{'); vcc_NextToken(tl); - - while (1) { - if (tl->t->tok == '}') - break; - ExpectErr(tl, ID); - if (!vcc_IdIs(tl->t, "set")) { - vsb_printf(tl->sb, - "Expected 'set', found "); - vcc_ErrToken(tl, tl->t); - vsb_printf(tl->sb, " at\n"); - vcc_ErrWhere(tl, tl->t); - return; - } - vcc_NextToken(tl); - ExpectErr(tl, VAR); - vp = vcc_FindVar(tl, tl->t, vcc_be_vars); - ERRCHK(tl); - assert(vp != NULL); - vcc_NextToken(tl); - ExpectErr(tl, '='); - vcc_NextToken(tl); - if (vp->fmt != SET) { - vsb_printf(tl->sb, - "Assignments not possible for '%s'\n", vp->name); - vcc_ErrWhere(tl, tl->t); - return; - } - + + Fc(tl, 0, + "\nstatic const struct vrt_dir_random_entry vdre_%.*s[] = {\n", + PF(t_dir)); + + for (nelem = 0; tl->t->tok != '}'; nelem++) { /* List of members */ + tb = NULL; + tw = NULL; + nbh = -1; + ExpectErr(tl, '{'); vcc_NextToken(tl); - - while (1) { - if (tl->t->tok == '}') - break; - - ExpectErr(tl, '{'); + + while (tl->t->tok != '}') { /* Member fields */ + ExpectErr(tl, '.'); vcc_NextToken(tl); - - // Host - ExpectErr(tl, CSTR); - t_host = tl->t; + ExpectErr(tl, ID); + t_field = tl->t; vcc_NextToken(tl); - - ep = CheckHostPort(t_host->dec, "80"); - if (ep != NULL) { - vsb_printf(tl->sb, "Backend '%.*s': %s\n", PF(t_be), ep); - vcc_ErrWhere(tl, t_host); - return; - } - - if (tl->t->tok == ',') { + ExpectErr(tl, '='); + vcc_NextToken(tl); + if (vcc_IdIs(t_field, "backend")) { + assert(tb == NULL); + tb = t_field; + vcc_ParseBackendHost(tl, &nbh); + } else if (vcc_IdIs(t_field, "weight")) { + assert(tw == NULL); + ExpectErr(tl, CNUM); + tw = tl->t; vcc_NextToken(tl); - - // Port - - ExpectErr(tl, CSTR); - t_port = tl->t; + ExpectErr(tl, ';'); vcc_NextToken(tl); - - ep = CheckHostPort(t_host->dec, t_port->dec); - if (ep != NULL) { - vsb_printf(tl->sb, - "Backend '%.*s': %s\n", PF(t_be), ep); - vcc_ErrWhere(tl, t_port); - return; - } - - if (tl->t->tok == ',') { - - vcc_NextToken(tl); - - // Weight - t_weight = vcc_DoubleVal(tl); - weighted = 1; - weight += t_weight; - } + } else { + ExpectErr(tl, '?'); } - - ExpectErr(tl, '}'); - vcc_NextToken(tl); - - Fc(tl, 0, "\nstatic struct vrt_backend_entry bentry_%.*s_%d = {\n", - PF(t_be), cnt); - Fc(tl, 0, "\t.port = %.*s,\n", PF(t_port)); - Fc(tl, 0, "\t.host = %.*s,\n", PF(t_host)); - Fc(tl, 0, "\t.weight = %f,\n", t_weight); - if (cnt > 0) { - Fc(tl, 0, "\t.next = &bentry_%.*s_%d\n", PF(t_be), cnt-1); - } /*else { - Fc(tl, 0, "\t.next = NULL\n"); - }*/ - Fc(tl, 0, "};\n"); - t_weight = 0; - cnt++; } - ExpectErr(tl, '}'); + assert(tb != NULL); + Fc(tl, 0, "\t{"); + Fc(tl, 0, ".host = &bh_%d", nbh); + if (tw != NULL) + Fc(tl, 0, ", .weight = %.*s", PF(tw)); + Fc(tl, 0, "},\n"); vcc_NextToken(tl); - ExpectErr(tl, ';'); - vcc_NextToken(tl); - - if (t_host == NULL) { - vsb_printf(tl->sb, "Backend '%.*s' has no hostname\n", - PF(t_be)); - vcc_ErrWhere(tl, tl->t); - return; - } - - if (weighted && (int)weight != 1) { - vsb_printf(tl->sb, "Total weight must be 1\n"); - vcc_ErrWhere(tl, tl->t); - return; - } - - if (backend_type == T_BACKEND_ROUND_ROBIN) { - Fc(tl, 0, "\nstatic struct vrt_round_robin_backend sbe_%.*s = {\n", - PF(t_be)); - Fc(tl, 0, "\t.name = \"%.*s\",\n", PF(t_be)); - Fc(tl, 0, "\t.count = %d,\n", cnt); - Fc(tl, 0, "\t.bentry = &bentry_%.*s_%d\n", PF(t_be), cnt-1); - Fc(tl, 0, "};\n"); - Fi(tl, 0, "\tVRT_init_round_robin_backend(&VGC_backend_%.*s , &sbe_%.*s);\n", - PF(t_be), PF(t_be)); - } else if (backend_type == T_BACKEND_RANDOM) { - Fc(tl, 0, "\nstatic struct vrt_random_backend sbe_%.*s = {\n", - PF(t_be)); - Fc(tl, 0, "\t.name = \"%.*s\",\n", PF(t_be)); - Fc(tl, 0, "\t.weighted = %d,\n", weighted); - Fc(tl, 0, "\t.count = %d,\n", cnt); - Fc(tl, 0, "\t.bentry = &bentry_%.*s_%d\n", PF(t_be), cnt-1); - Fc(tl, 0, "};\n"); - Fi(tl, 0, "\tVRT_init_random_backend(&VGC_backend_%.*s , &sbe_%.*s);\n", - PF(t_be), PF(t_be)); - } - Ff(tl, 0, "\tVRT_fini_backend(VGC_backend_%.*s);\n", PF(t_be)); - } - ExpectErr(tl, '}'); - + Fc(tl, 0, "\t{ .host = 0 }\n"); + Fc(tl, 0, "}\n"); + Fc(tl, 0, + "\nstatic const struct vrt_dir_random vdr_%.*s[] = {\n", + PF(t_dir)); + Fc(tl, 0, "\t.nmember = %d,\n", nelem); + Fc(tl, 0, "\t.members = vdre_%.*s,\n", PF(t_dir)); + vcc_EmitBeIdent(tl->fc, t_first, tl->t); vcc_NextToken(tl); - tl->nbackend++; } +/*-------------------------------------------------------------------- + * Parse directors + */ + +void +vcc_ParseDirector(struct tokenlist *tl) +{ + struct token *t_dir, *t_first; + + vcc_NextToken(tl); /* ID: director */ + t_first = tl->t; + + ExpectErr(tl, ID); /* ID: name */ + t_dir = tl->t; + vcc_NextToken(tl); + + ExpectErr(tl, ID); /* ID: policy */ + if (vcc_IdIs(tl->t, "random")) + vcc_ParseRandomDirector(tl, t_first, t_dir); + else { + vsb_printf(tl->sb, "Unknown director policy: "); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, " at\n"); + vcc_ErrWhere(tl, tl->t); + return; + } +} Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2008-01-22 10:00:23 UTC (rev 2366) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2008-01-22 10:48:49 UTC (rev 2367) @@ -161,8 +161,8 @@ void vcc_ParseAction(struct tokenlist *tl); /* vcc_backend.c */ -void vcc_ParseSimpleBackend(struct tokenlist *tl); -void vcc_ParseBalancedBackend(struct tokenlist *tl); +void vcc_ParseBackend(struct tokenlist *tl); +void vcc_ParseDirector(struct tokenlist *tl); /* vcc_compile.c */ extern struct method method_tab[]; Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-22 10:00:23 UTC (rev 2366) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-22 10:48:49 UTC (rev 2367) @@ -165,32 +165,6 @@ return (T_ACL); } return (0); - case 'b': - if (p[0] == 'b' && p[1] == 'a' && p[2] == 'c' && - p[3] == 'k' && p[4] == 'e' && p[5] == 'n' && - p[6] == 'd' && p[7] == '_' && p[8] == 'r' && - p[9] == 'o' && p[10] == 'u' && p[11] == 'n' && - p[12] == 'd' && p[13] == '_' && p[14] == 'r' && - p[15] == 'o' && p[16] == 'b' && p[17] == 'i' && - p[18] == 'n' && !isvar(p[19])) { - *q = p + 19; - return (T_BACKEND_ROUND_ROBIN); - } - if (p[0] == 'b' && p[1] == 'a' && p[2] == 'c' && - p[3] == 'k' && p[4] == 'e' && p[5] == 'n' && - p[6] == 'd' && p[7] == '_' && p[8] == 'r' && - p[9] == 'a' && p[10] == 'n' && p[11] == 'd' && - p[12] == 'o' && p[13] == 'm' && !isvar(p[14])) { - *q = p + 14; - return (T_BACKEND_RANDOM); - } - if (p[0] == 'b' && p[1] == 'a' && p[2] == 'c' && - p[3] == 'k' && p[4] == 'e' && p[5] == 'n' && - p[6] == 'd' && !isvar(p[7])) { - *q = p + 7; - return (T_BACKEND); - } - return (0); case 'e': if (p[0] == 'e' && p[1] == 'l' && p[2] == 's' && p[3] == 'i' && p[4] == 'f' && !isvar(p[5])) { @@ -291,9 +265,6 @@ vcl_tnames[EOI] = "EOI"; vcl_tnames[ID] = "ID"; vcl_tnames[T_ACL] = "acl"; - vcl_tnames[T_BACKEND] = "backend"; - vcl_tnames[T_BACKEND_RANDOM] = "backend_random"; - vcl_tnames[T_BACKEND_ROUND_ROBIN] = "backend_round_robin"; vcl_tnames[T_CAND] = "&&"; vcl_tnames[T_COR] = "||"; vcl_tnames[T_DEC] = "--"; @@ -445,6 +416,17 @@ vsb_cat(sb, " struct vrt_backend_entry *bentry;\n"); vsb_cat(sb, "};\n"); vsb_cat(sb, "\n"); + vsb_cat(sb, "struct vrt_dir_random_entry {\n"); + vsb_cat(sb, " const struct vrt_backend_host *host;\n"); + vsb_cat(sb, " double weight;\n"); + vsb_cat(sb, "};\n"); + vsb_cat(sb, "\n"); + vsb_cat(sb, "struct vrt_dir_random {\n"); + vsb_cat(sb, " unsigned nmember;\n"); + vsb_cat(sb, " struct vrt_dir_random_entry *members;\n"); + vsb_cat(sb, " const char *ident;\n"); + vsb_cat(sb, "};\n"); + vsb_cat(sb, "\n"); vsb_cat(sb, "struct vrt_random_backend {\n"); vsb_cat(sb, " const char *name;\n"); vsb_cat(sb, " unsigned weighted;\n"); Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2008-01-22 10:00:23 UTC (rev 2366) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2008-01-22 10:48:49 UTC (rev 2367) @@ -73,12 +73,6 @@ sub acl - - backend - - backend_round_robin - - backend_random } # Non-word tokens Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-01-22 10:00:23 UTC (rev 2366) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-01-22 10:48:49 UTC (rev 2367) @@ -564,13 +564,6 @@ case T_SUB: Function(tl); break; - case T_BACKEND: - vcc_ParseSimpleBackend(tl); - break; - case T_BACKEND_RANDOM: - case T_BACKEND_ROUND_ROBIN: - vcc_ParseBalancedBackend(tl); - break; case CSRC: Fc(tl, 0, "%.*s\n", tl->t->e - (tl->t->b + 4), tl->t->b + 2); @@ -578,6 +571,16 @@ break; case EOI: break; + case ID: + if (vcc_IdIs(tl->t, "backend")) { + vcc_ParseBackend(tl); + break; + } + if (vcc_IdIs(tl->t, "director")) { + vcc_ParseDirector(tl); + break; + } + /* FALLTHROUGH */ default: vsb_printf(tl->sb, "Expected 'acl', 'sub' or 'backend', found "); Modified: trunk/varnish-cache/lib/libvcl/vcc_token_defs.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_token_defs.h 2008-01-22 10:00:23 UTC (rev 2366) +++ trunk/varnish-cache/lib/libvcl/vcc_token_defs.h 2008-01-22 10:48:49 UTC (rev 2367) @@ -14,26 +14,23 @@ #define T_ELSIF 132 #define T_SUB 133 #define T_ACL 134 -#define T_BACKEND 135 -#define T_BACKEND_ROUND_ROBIN 136 -#define T_BACKEND_RANDOM 137 -#define T_INC 138 -#define T_DEC 139 -#define T_CAND 140 -#define T_COR 141 -#define T_LEQ 142 -#define T_EQ 143 -#define T_NEQ 144 -#define T_GEQ 145 -#define T_SHR 146 -#define T_SHL 147 -#define T_INCR 148 -#define T_DECR 149 -#define T_MUL 150 -#define T_DIV 151 -#define ID 152 -#define VAR 153 -#define CNUM 154 -#define CSTR 155 -#define EOI 156 -#define CSRC 157 +#define T_INC 135 +#define T_DEC 136 +#define T_CAND 137 +#define T_COR 138 +#define T_LEQ 139 +#define T_EQ 140 +#define T_NEQ 141 +#define T_GEQ 142 +#define T_SHR 143 +#define T_SHL 144 +#define T_INCR 145 +#define T_DECR 146 +#define T_MUL 147 +#define T_DIV 148 +#define ID 149 +#define VAR 150 +#define CNUM 151 +#define CSTR 152 +#define EOI 153 +#define CSRC 154 From phk at projects.linpro.no Tue Jan 22 11:39:58 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 22 Jan 2008 12:39:58 +0100 (CET) Subject: r2368 - trunk/varnish-cache/lib/libvcl Message-ID: <20080122113958.56A4C1EC09F@projects.linpro.no> Author: phk Date: 2008-01-22 12:39:58 +0100 (Tue, 22 Jan 2008) New Revision: 2368 Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c Log: Add helper functions to check and report errors when fields are defined too much, too little or just plain wrong. Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-22 10:48:49 UTC (rev 2367) +++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-22 11:39:58 UTC (rev 2368) @@ -34,6 +34,7 @@ #include #include +#include #include #include "vsb.h" @@ -85,6 +86,106 @@ } /*-------------------------------------------------------------------- + * Helper functions to complain about duplicate and missing fields + */ + +struct fld_spec { + const char *name; + struct token *found; +}; + +static void +vcc_ResetFldSpec(struct fld_spec *f) +{ + + for (; f->name != NULL; f++) + f->found = NULL; +} + +static struct fld_spec * +vcc_FldSpec(struct tokenlist *tl, const char *first, ...) +{ + struct fld_spec f[100], *r; + int n = 0; + va_list ap; + const char *p; + + f[n++].name = first; + va_start(ap, first); + while (1) { + p = va_arg(ap, const char *); + if (p == NULL) + break; + f[n++].name = p; + assert(n < 100); + } + va_end(ap); + f[n++].name = NULL; + + vcc_ResetFldSpec(f); + + r = TlAlloc(tl, sizeof *r * n); + memcpy(r, f, n * sizeof *r); + return (r); +} + + +static void +vcc_IsField(struct tokenlist *tl, struct token **t, struct fld_spec *fs) +{ + struct token *t_field; + + ExpectErr(tl, '.'); + vcc_NextToken(tl); + ExpectErr(tl, ID); + t_field = tl->t; + *t = t_field; + vcc_NextToken(tl); + ExpectErr(tl, '='); + vcc_NextToken(tl); + + for (; fs->name != NULL; fs++) { + if (!vcc_IdIs(t_field, fs->name + 1)) + continue; + if (fs->found == NULL) { + fs->found = t_field; + return; + } + vsb_printf(tl->sb, "Field "); + vcc_ErrToken(tl, t_field); + vsb_printf(tl->sb, " redefined at:\n"); + vcc_ErrWhere(tl, t_field); + vsb_printf(tl->sb, "\nFirst defined at:\n"); + vcc_ErrWhere(tl, fs->found); + return; + } + vsb_printf(tl->sb, "Unknown field: "); + vcc_ErrToken(tl, t_field); + vsb_printf(tl->sb, " at\n"); + vcc_ErrWhere(tl, t_field); + return; +} + +static void +vcc_FieldsOk(struct tokenlist *tl, const struct fld_spec *fs) +{ + int ok = 1; + + for (; fs->name != NULL; fs++) { + if (*fs->name == '!' && fs->found == NULL) { + vsb_printf(tl->sb, + "Mandatory field .'%s' missing.\n", fs->name + 1); + ok = 0; + } + } + if (!ok) { + vcc_ErrWhere(tl, tl->t); + } + return; +} + + +/*-------------------------------------------------------------------- * Parse and emit a backend host specification. * * The syntax is the following: @@ -108,11 +209,13 @@ { struct token *t_field; struct token *t_first; - struct token *t_host = NULL, *t_fhost = NULL; - struct token *t_port = NULL, *t_fport = NULL; + struct token *t_host = NULL; + struct token *t_port = NULL; const char *ep; struct host *h; + struct fld_spec *fs; + fs = vcc_FldSpec(tl, "!host", "?port", NULL); t_first = tl->t; *nbh = tl->nbackend_host++; @@ -152,69 +255,40 @@ return; } - while (tl->t->tok == '.') { - vcc_NextToken(tl); + while (tl->t->tok != '}') { - ExpectErr(tl, ID); /* name */ - t_field = tl->t; - vcc_NextToken(tl); - - ExpectErr(tl, '='); - vcc_NextToken(tl); - + vcc_IsField(tl, &t_field, fs); + if (tl->err) + break; if (vcc_IdIs(t_field, "host")) { ExpectErr(tl, CSTR); assert(tl->t->dec != NULL); - if (t_host != NULL) { - assert(t_fhost != NULL); - vsb_printf(tl->sb, - "Multiple .host fields in backend: "); - vcc_ErrToken(tl, t_field); - vsb_printf(tl->sb, " at\n"); - vcc_ErrWhere(tl, t_fhost); - vsb_printf(tl->sb, " and\n"); - vcc_ErrWhere(tl, t_field); - return; - } - t_fhost = t_field; t_host = tl->t; vcc_NextToken(tl); } else if (vcc_IdIs(t_field, "port")) { ExpectErr(tl, CSTR); assert(tl->t->dec != NULL); - if (t_port != NULL) { - assert(t_fport != NULL); - vsb_printf(tl->sb, - "Multiple .port fields in backend: "); - vcc_ErrToken(tl, t_field); - vsb_printf(tl->sb, " at\n"); - vcc_ErrWhere(tl, t_fport); - vsb_printf(tl->sb, " and\n"); - vcc_ErrWhere(tl, t_field); - return; - } - t_fport = t_field; t_port = tl->t; vcc_NextToken(tl); } else { - vsb_printf(tl->sb, - "Unknown field in backend host specification: "); - vcc_ErrToken(tl, t_field); - vsb_printf(tl->sb, " at\n"); - vcc_ErrWhere(tl, t_field); + ErrInternal(tl); return; } ExpectErr(tl, ';'); vcc_NextToken(tl); } - if (t_host == NULL) { - vsb_printf(tl->sb, "Backend has no hostname\n"); - vcc_ErrWhere(tl, tl->t); + if (!tl->err) + vcc_FieldsOk(tl, fs); + if (tl->err) { + vsb_printf(tl->sb, + "\nIn backend host specfication starting at:\n"); + vcc_ErrWhere(tl, t_first); return; } /* Check that the hostname makes sense */ + assert(t_host != NULL); ep = CheckHostPort(t_host->dec, "80"); if (ep != NULL) { vsb_printf(tl->sb, "Backend host '%.*s': %s\n", PF(t_host), ep); @@ -296,13 +370,13 @@ */ static void -vcc_ParseRandomDirector(struct tokenlist *tl, struct token *t_first, struct token *t_dir) +vcc_ParseRandomDirector(struct tokenlist *tl, const struct token *t_first, const struct token *t_dir) { - struct token *t_field, *tb, *tw; + struct token *t_field; int nbh, nelem; + struct fld_spec *fs; - (void)t_first; - (void)t_dir; + fs = vcc_FldSpec(tl, "!backend", "?weight", NULL); vcc_NextToken(tl); /* ID: policy (= random) */ @@ -314,42 +388,33 @@ PF(t_dir)); for (nelem = 0; tl->t->tok != '}'; nelem++) { /* List of members */ - tb = NULL; - tw = NULL; + vcc_ResetFldSpec(fs); nbh = -1; ExpectErr(tl, '{'); vcc_NextToken(tl); + Fc(tl, 0, "\t{"); while (tl->t->tok != '}') { /* Member fields */ - ExpectErr(tl, '.'); - vcc_NextToken(tl); - ExpectErr(tl, ID); - t_field = tl->t; - vcc_NextToken(tl); - ExpectErr(tl, '='); - vcc_NextToken(tl); + vcc_IsField(tl, &t_field, fs); + ERRCHK(tl); if (vcc_IdIs(t_field, "backend")) { - assert(tb == NULL); - tb = t_field; vcc_ParseBackendHost(tl, &nbh); + Fc(tl, 0, " .host = &bh_%d,", nbh); + ERRCHK(tl); } else if (vcc_IdIs(t_field, "weight")) { - assert(tw == NULL); ExpectErr(tl, CNUM); - tw = tl->t; + Fc(tl, 0, " .weight = %.*s,", PF(tl->t)); vcc_NextToken(tl); ExpectErr(tl, ';'); vcc_NextToken(tl); } else { - ExpectErr(tl, '?'); + ErrInternal(tl); } } - assert(tb != NULL); - Fc(tl, 0, "\t{"); - Fc(tl, 0, ".host = &bh_%d", nbh); - if (tw != NULL) - Fc(tl, 0, ", .weight = %.*s", PF(tw)); - Fc(tl, 0, "},\n"); + vcc_FieldsOk(tl, fs); + ERRCHK(tl); + Fc(tl, 0, " },\n"); vcc_NextToken(tl); } Fc(tl, 0, "\t{ .host = 0 }\n"); @@ -372,8 +437,8 @@ { struct token *t_dir, *t_first; + t_first = tl->t; vcc_NextToken(tl); /* ID: director */ - t_first = tl->t; ExpectErr(tl, ID); /* ID: name */ t_dir = tl->t; @@ -389,4 +454,11 @@ vcc_ErrWhere(tl, tl->t); return; } + if (tl->err) { + vsb_printf(tl->sb, + "\nIn director specfication starting at:\n", + PF(t_first)); + vcc_ErrWhere(tl, t_first); + return; + } } From phk at projects.linpro.no Wed Jan 23 09:26:03 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 23 Jan 2008 10:26:03 +0100 (CET) Subject: r2369 - trunk/varnish-cache/bin/varnishd Message-ID: <20080123092603.781B81EC1D1@projects.linpro.no> Author: phk Date: 2008-01-23 10:26:03 +0100 (Wed, 23 Jan 2008) New Revision: 2369 Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c Log: Make sure WRK_Flush() always resets w->niov so WRK_Write() does not overrun the w->iov. Because niov is right after iov in struct worker, it is hard to predict what the effect of hitting this bug, but "core dump" is almost a given. I don't think it has been likely to happen a lot however, as it would require a full complement of HTTP headers or a very fragmented object. Coverity Scan (CID:7) Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_pool.c 2008-01-22 11:39:58 UTC (rev 2368) +++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2008-01-23 09:26:03 UTC (rev 2369) @@ -98,11 +98,11 @@ ssize_t i; CHECK_OBJ_NOTNULL(w, WORKER_MAGIC); - if (*w->wfd < 0 || w->niov == 0 || w->werr) - return (w->werr); - i = writev(*w->wfd, w->iov, w->niov); - if (i != w->liov) - w->werr++; + if (*w->wfd >= 0 && w->niov > 0 && w->werr == 0) { + i = writev(*w->wfd, w->iov, w->niov); + if (i != w->liov) + w->werr++; + } w->liov = 0; w->niov = 0; return (w->werr); From phk at projects.linpro.no Wed Jan 23 09:46:14 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 23 Jan 2008 10:46:14 +0100 (CET) Subject: r2370 - trunk/varnish-cache/bin/varnishd Message-ID: <20080123094614.311101EC307@projects.linpro.no> Author: phk Date: 2008-01-23 10:46:13 +0100 (Wed, 23 Jan 2008) New Revision: 2370 Modified: trunk/varnish-cache/bin/varnishd/cache_cli.c trunk/varnish-cache/bin/varnishd/cache_synthetic.c trunk/varnish-cache/bin/varnishd/cache_vary.c trunk/varnish-cache/bin/varnishd/mgt_cli.c trunk/varnish-cache/bin/varnishd/mgt_vcc.c trunk/varnish-cache/bin/varnishd/varnishd.c Log: Protect all vsb's (sbufs) with an assert that they did not overflow. I don't think it is likely that they would, but some users are running out of memory, so make it deterministic when it happens. Noticed by Coverity Scan (CID: 4-6) Modified: trunk/varnish-cache/bin/varnishd/cache_cli.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_cli.c 2008-01-23 09:26:03 UTC (rev 2369) +++ trunk/varnish-cache/bin/varnishd/cache_cli.c 2008-01-23 09:46:13 UTC (rev 2370) @@ -125,6 +125,7 @@ vsb_clear(cli->sb); cli_dispatch(cli, CLI_cmds, buf); vsb_finish(cli->sb); + AZ(vsb_overflowed(cli->sb)); i = cli_writeres(heritage.fds[1], cli); if (i) { VSL(SLT_Error, 0, "CLI write failed (errno=%d)", errno); Modified: trunk/varnish-cache/bin/varnishd/cache_synthetic.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_synthetic.c 2008-01-23 09:26:03 UTC (rev 2369) +++ trunk/varnish-cache/bin/varnishd/cache_synthetic.c 2008-01-23 09:46:13 UTC (rev 2370) @@ -118,6 +118,7 @@ " \n" "\n"); vsb_finish(&vsb); + AZ(vsb_overflowed(&vsb)); w->acct.hdrbytes = WRK_Write(w, vsb_data(&vsb), vsb_len(&vsb)); (void)WRK_Flush(w); vsb_delete(&vsb); Modified: trunk/varnish-cache/bin/varnishd/cache_vary.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vary.c 2008-01-23 09:26:03 UTC (rev 2369) +++ trunk/varnish-cache/bin/varnishd/cache_vary.c 2008-01-23 09:46:13 UTC (rev 2370) @@ -91,6 +91,7 @@ vsb_clear(sbh); vsb_printf(sbh, "%c%.*s:%c", 1 + (q - p), q - p, p, 0); vsb_finish(sbh); + AZ(vsb_overflowed(sbh)); /* Append to vary matching string */ vsb_bcat(sb, vsb_data(sbh), vsb_len(sbh)); @@ -122,6 +123,7 @@ vsb_printf(sb, "%c", 0); vsb_finish(sb); + AZ(vsb_overflowed(sb)); l = vsb_len(sb); sp->obj->vary = malloc(l); AN(sp->obj->vary); Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_cli.c 2008-01-23 09:26:03 UTC (rev 2369) +++ trunk/varnish-cache/bin/varnishd/mgt_cli.c 2008-01-23 09:46:13 UTC (rev 2370) @@ -124,6 +124,7 @@ vsb_putc(sb, '\n'); xxxassert(!vsb_overflowed(sb)); vsb_finish(sb); + AZ(vsb_overflowed(sb)); i = write(cli_o, vsb_data(sb), vsb_len(sb)); xxxassert(i == vsb_len(sb)); vsb_delete(sb); @@ -325,6 +326,7 @@ vsb_clear(cp->cli->sb); cli_dispatch(cp->cli, cli_proto, p); vsb_finish(cp->cli->sb); + AZ(vsb_overflowed(cp->cli->sb)); /* send the result back */ if (cli_writeres(cp->fdo, cp->cli)) Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-23 09:26:03 UTC (rev 2369) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-23 09:46:13 UTC (rev 2370) @@ -237,6 +237,7 @@ vsb_new(&cmdsb, cmdline, sizeof cmdline, 0); mgt_make_cc_cmd(&cmdsb, sf, of); vsb_finish(&cmdsb); + AZ(vsb_overflowed(&cmdsb)); /* XXX check vsb state */ if (pipe(p) < 0) { @@ -430,6 +431,7 @@ vf = mgt_VccCompileFile(sb, f_arg, C_flag, f_fd); } vsb_finish(sb); + AZ(vsb_overflowed(sb)); if (vsb_len(sb) > 0) fprintf(stderr, "%s", vsb_data(sb)); vsb_delete(sb); @@ -511,6 +513,7 @@ XXXAN(sb); vf = mgt_VccCompile(sb, av[3], NULL, 0); vsb_finish(sb); + AZ(vsb_overflowed(sb)); if (vsb_len(sb) > 0) cli_out(cli, "%s", vsb_data(sb)); vsb_delete(sb); @@ -544,6 +547,7 @@ XXXAN(sb); vf = mgt_VccCompileFile(sb, av[3], 0, -1); vsb_finish(sb); + AZ(vsb_overflowed(sb)); if (vsb_len(sb) > 0) cli_out(cli, "%s", vsb_data(sb)); vsb_delete(sb); Modified: trunk/varnish-cache/bin/varnishd/varnishd.c =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.c 2008-01-23 09:26:03 UTC (rev 2369) +++ trunk/varnish-cache/bin/varnishd/varnishd.c 2008-01-23 09:46:13 UTC (rev 2370) @@ -342,6 +342,7 @@ return; } vsb_finish(cli->sb); + AZ(vsb_overflowed(cli->sb)); fprintf(stderr, "Error:\n%s\n", vsb_data(cli->sb)); exit (2); } @@ -477,6 +478,7 @@ if (cli[0].result != CLIS_OK) { fprintf(stderr, "Parameter errors:\n"); vsb_finish(cli[0].sb); + AZ(vsb_overflowed(cli[0].sb)); fprintf(stderr, "%s\n", vsb_data(cli[0].sb)); exit(1); } From phk at projects.linpro.no Wed Jan 23 10:05:45 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 23 Jan 2008 11:05:45 +0100 (CET) Subject: r2371 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080123100545.880961EC1D1@projects.linpro.no> Author: phk Date: 2008-01-23 11:05:45 +0100 (Wed, 23 Jan 2008) New Revision: 2371 Modified: trunk/varnish-cache/lib/libvarnish/cli_common.c Log: Make sure to always NULL the pointer argument to cli_readres(). Implicated in Coverity Scan (CID:12-16) Modified: trunk/varnish-cache/lib/libvarnish/cli_common.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/cli_common.c 2008-01-23 09:46:13 UTC (rev 2370) +++ trunk/varnish-cache/lib/libvarnish/cli_common.c 2008-01-23 10:05:45 UTC (rev 2371) @@ -143,6 +143,8 @@ unsigned u, v; char *p; + if (ptr != NULL) + *ptr = NULL; i = read_tmo(fd, res, CLI_LINE0_LEN, tmo); if (i != CLI_LINE0_LEN) { if (status != NULL) From phk at projects.linpro.no Wed Jan 23 10:13:43 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 23 Jan 2008 11:13:43 +0100 (CET) Subject: r2372 - trunk/varnish-cache/bin/varnishd Message-ID: <20080123101343.D04431EC307@projects.linpro.no> Author: phk Date: 2008-01-23 11:13:43 +0100 (Wed, 23 Jan 2008) New Revision: 2372 Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c Log: mgt_cli_askchild() always returns a pointer. Coverity Scan (CID:12) Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-23 10:05:45 UTC (rev 2371) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-23 10:13:43 UTC (rev 2372) @@ -592,10 +592,12 @@ (void)priv; vp = mcf_find_vcl(cli, av[2]); if (vp != NULL && vp->active == 0) { - if (child_pid >= 0 && - mgt_cli_askchild(&status, &p, "vcl.use %s\n", av[2])) { - cli_result(cli, status); - cli_out(cli, "%s", p); + if (child_pid >= 0) { + if (mgt_cli_askchild(&status, &p, + "vcl.use %s\n", av[2])) { + cli_result(cli, status); + cli_out(cli, "%s", p); + } free(p); } else { vp->active = 2; From phk at projects.linpro.no Wed Jan 23 10:20:12 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 23 Jan 2008 11:20:12 +0100 (CET) Subject: r2373 - trunk/varnish-cache/bin/varnishd Message-ID: <20080123102012.BE5DE1EC055@projects.linpro.no> Author: phk Date: 2008-01-23 11:20:12 +0100 (Wed, 23 Jan 2008) New Revision: 2373 Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c Log: Always dispose of the reason from mgt_cli_askchild() properly. Coverty Scan (CID: 12-14,16) Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-23 10:13:43 UTC (rev 2372) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-23 10:20:12 UTC (rev 2373) @@ -503,7 +503,7 @@ void mcf_config_inline(struct cli *cli, const char * const *av, void *priv) { - char *vf, *p; + char *vf, *p = NULL; struct vsb *sb; unsigned status; @@ -527,10 +527,10 @@ mgt_cli_askchild(&status, &p, "vcl.load %s %s\n", av[2], vf)) { cli_result(cli, status); cli_out(cli, "%s", p); - free(p); - return; + } else { + (void)mgt_vcc_add(av[2], vf); } - (void)mgt_vcc_add(av[2], vf); + free(p); } void @@ -539,7 +539,7 @@ char *vf; struct vsb *sb; unsigned status; - char *p; + char *p = NULL; (void)priv; @@ -561,10 +561,10 @@ mgt_cli_askchild(&status, &p, "vcl.load %s %s\n", av[2], vf)) { cli_result(cli, status); cli_out(cli, "%s", p); - free(p); - return; + } else { + (void)mgt_vcc_add(av[2], vf); } - (void)mgt_vcc_add(av[2], vf); + free(p); } static struct vclprog * @@ -586,19 +586,16 @@ mcf_config_use(struct cli *cli, const char * const *av, void *priv) { unsigned status; - char *p; + char *p = NULL; struct vclprog *vp; (void)priv; vp = mcf_find_vcl(cli, av[2]); if (vp != NULL && vp->active == 0) { - if (child_pid >= 0) { - if (mgt_cli_askchild(&status, &p, - "vcl.use %s\n", av[2])) { - cli_result(cli, status); - cli_out(cli, "%s", p); - } - free(p); + if (child_pid >= 0 && + mgt_cli_askchild(&status, &p, "vcl.use %s\n", av[2])) { + cli_result(cli, status); + cli_out(cli, "%s", p); } else { vp->active = 2; VTAILQ_FOREACH(vp, &vclhead, list) { @@ -609,13 +606,14 @@ } } } + free(p); } void mcf_config_discard(struct cli *cli, const char * const *av, void *priv) { unsigned status; - char *p; + char *p = NULL; struct vclprog *vp; (void)priv; @@ -629,11 +627,11 @@ "vcl.discard %s\n", av[2])) { cli_result(cli, status); cli_out(cli, "%s", p); - free(p); } else { AZ(mgt_vcc_delbyname(av[2])); } } + free(p); } void From des at projects.linpro.no Wed Jan 23 13:45:48 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 23 Jan 2008 14:45:48 +0100 (CET) Subject: r2374 - trunk/varnish-tools/fetcher Message-ID: <20080123134548.6F0751EC475@projects.linpro.no> Author: des Date: 2008-01-23 14:45:48 +0100 (Wed, 23 Jan 2008) New Revision: 2374 Modified: trunk/varnish-tools/fetcher/fetcher.pl Log: Add -c and -r options: - If the former is specified, fetcher will go into a loop after having traversed the entire tree, and continuously re-fetch all known URLs. - The latter is not yet implented, but the idea is to assign a random probability to each URL based on an inverse-exponential (or similar) distribution, and re-fetch URLs at random according to this frequency. This will help simulate a "short head long tail" scenario. Some restructuring. Add a comment about a possible improvement which will help work around bugs in certain commonly used data sets (e.g. the Apache httpd manual) which can result in an infinite set of URLs (which in reality map to a fairly large but finite set of pages) Modified: trunk/varnish-tools/fetcher/fetcher.pl =================================================================== --- trunk/varnish-tools/fetcher/fetcher.pl 2008-01-23 10:20:12 UTC (rev 2373) +++ trunk/varnish-tools/fetcher/fetcher.pl 2008-01-23 13:45:48 UTC (rev 2374) @@ -43,9 +43,15 @@ our %CHILD; our $BUSY; +our $continue = 0; +our $delay = 0; our $jobs = 1; -our $delay = 0; +our $quiet = 0; +our $random = 0; +our $url_re = + qr/\b(?:href|src)=[\'\"]([^\'\"\?\#]+)(?:[\?\#][^\'\"]*)?[\'\"]/io; + sub new($$) { my ($this, $mux, $fh) = @_; my $class = ref($this) || $this; @@ -57,27 +63,40 @@ }; } +# Child sub run($$) { my ($self, $s) = @_; - my $ua = new LWP::UserAgent(); + my $check = 1; + my $ua = new LWP::UserAgent('keep_alive' => 3); for (;;) { $0 = "[fetcher] idle"; my $url = <$s>; exit(0) unless defined($url); chomp($url); - die "no more work\n" - if $url eq "done"; + if ($url eq "done") { + last; + } elsif ($url eq "check") { + $check = 1; + next; + } elsif ($url eq "no check") { + $check = 0; + next; + } $0 = "[fetcher] requesting $url"; - print STDERR "Retrieving $url\n"; + print STDERR "Retrieving $url\n" + unless ($quiet > 1); my $resp = $ua->get($url); - $0 = "[fetcher] checking $url"; - if ($resp->header('Content-Type') =~ m/^text\//) { - my %urls = map { $_ => 1 } - ($resp->content =~ m/\b(?:href|src)=[\'\"]([^\'\"\?\#]+)(?:[\?\#][^\'\"]*)?[\'\"]/g); - foreach (keys(%urls)) { - $s->write("add $_\n"); + if ($check) { + $0 = "[fetcher] checking $url"; + # XXX if we got a redirect, we should blacklist the + # original URL and suggest the target URL instead + if ($resp->header('Content-Type') =~ m/^text\//) { + my %urls = map { $_ => 1 } ($resp->content =~ m/$url_re/g); + foreach (keys(%urls)) { + $s->write("add $_\n"); + } } } select(undef, undef, undef, $delay) @@ -87,6 +106,16 @@ } } +# Send a command for which we don't expect a response +sub send($) { + my ($child, $msg) = @_; + + die "child busy\n" + if $child->{'url'}; + $child->{'mux'}->write($child->{'fh'}, "$msg\n"); +} + +# Send a URL and mark the child as busy sub send_url($) { my ($child) = @_; @@ -102,6 +131,7 @@ ++$BUSY; } +# Convert relative to absolute, check if valid, and add to list sub get_url($$) { my ($child, $url) = @_; @@ -111,13 +141,15 @@ $url = $uri->canonical; if ($uri->scheme() ne 'http' || $uri->host_port() ne URI->new($child->{'url'})->host_port()) { - print STDERR "Rejected $url\n"; + print STDERR "Rejected $url\n" + unless ($quiet > 0); return; } return if $TODO{$url} || $DONE{$url}; $TODO{$url} = 1; } +# Called when mux gets data from a client sub mux_input($$$$) { my ($child, $mux, $fh, $input) = @_; @@ -172,32 +204,53 @@ # main loop for (;;) { + for (;;) { + foreach my $child (values(%CHILD)) { + $child->send_url() + unless $child->{'url'}; + } + last unless $BUSY; + $mux->loop(); + } + last unless $continue; foreach my $child (values(%CHILD)) { - $child->send_url() - unless $child->{'url'}; + $child->send("no check"); } - last unless $BUSY; - $mux->loop(); + %TODO = %DONE; + %DONE = (); + print STDERR "Starting over...\n"; } # done foreach my $child (values(%CHILD)) { + $child->send("done"); $mux->close($$child{'fh'}); } } +sub refetch() { + + # Recycle valid URLs from initial run + %TODO = %DONE; +} + sub usage() { - print STDERR "usage: $0 [-d n] [-j n] URL ...\n"; + print STDERR "usage: $0 [-cqr] [-d n] [-j n] URL ...\n"; exit(1); } MAIN:{ - GetOptions("j|jobs=i" => \$jobs, - "d|delay=i" => \$delay) + GetOptions("c|continue" => \$continue, + "d|delay=i" => \$delay, + "j|jobs=i" => \$jobs, + "q|quiet+" => \$quiet, + "r|random" => \$random) or usage(); $jobs > 0 or usage(); + $random + and die "-r is not yet implemented\n"; @ARGV or usage(); fetcher(@ARGV); From des at projects.linpro.no Wed Jan 23 15:45:03 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 23 Jan 2008 16:45:03 +0100 (CET) Subject: r2375 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080123154503.9FB2C1EC5D8@projects.linpro.no> Author: des Date: 2008-01-23 16:45:03 +0100 (Wed, 23 Jan 2008) New Revision: 2375 Modified: trunk/varnish-cache/lib/libvarnish/vss.c Log: Don't assume that res0 != NULL automatically means i == 0. I can't say for sure (without more coffee) that the assumption is incorrect, but it makes the code gratuitously non-transparent. Coverity Scan (CID:8) Modified: trunk/varnish-cache/lib/libvarnish/vss.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vss.c 2008-01-23 13:45:48 UTC (rev 2374) +++ trunk/varnish-cache/lib/libvarnish/vss.c 2008-01-23 15:45:03 UTC (rev 2375) @@ -135,8 +135,13 @@ fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(ret)); return (0); } - for (res = res0, i = 0; res != NULL; res = res->ai_next) - ++i; + XXXAN(res0); + for (res = res0, i = 0; res != NULL; res = res->ai_next, ++i) + /* nothing */ ; + if (i == 0) { + freeaddrinfo(res0); + return (0); + } va = calloc(i, sizeof *va); XXXAN(va); *vap = va; From des at projects.linpro.no Wed Jan 23 15:50:37 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 23 Jan 2008 16:50:37 +0100 (CET) Subject: r2376 - in branches/1.2: . lib/libvarnish Message-ID: <20080123155037.B74AE1EC484@projects.linpro.no> Author: des Date: 2008-01-23 16:50:37 +0100 (Wed, 23 Jan 2008) New Revision: 2376 Modified: branches/1.2/ branches/1.2/lib/libvarnish/vss.c Log: Merged revisions 2375 via svnmerge from svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache ........ r2375 | des | 2008-01-23 16:45:03 +0100 (Wed, 23 Jan 2008) | 6 lines Don't assume that res0 != NULL automatically means i == 0. I can't say for sure (without more coffee) that the assumption is incorrect, but it makes the code gratuitously non-transparent. Coverity Scan (CID:8) ........ Property changes on: branches/1.2 ___________________________________________________________________ Name: svnmerge-integrated - /trunk/varnish-cache:1-2101,2104-2107,2115-2120,2122-2130,2133,2151,2153-2154,2157,2161-2162,2166-2168,2173,2175-2176,2180-2184,2186-2193,2206,2208,2210-2215,2220,2222-2232,2243,2246-2255 + /trunk/varnish-cache:1-2101,2104-2107,2115-2120,2122-2130,2133,2151,2153-2154,2157,2161-2162,2166-2168,2173,2175-2176,2180-2184,2186-2193,2206,2208,2210-2215,2220,2222-2232,2243,2246-2255,2375 Modified: branches/1.2/lib/libvarnish/vss.c =================================================================== --- branches/1.2/lib/libvarnish/vss.c 2008-01-23 15:45:03 UTC (rev 2375) +++ branches/1.2/lib/libvarnish/vss.c 2008-01-23 15:50:37 UTC (rev 2376) @@ -135,8 +135,13 @@ fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(ret)); return (0); } - for (res = res0, i = 0; res != NULL; res = res->ai_next) - ++i; + XXXAN(res0); + for (res = res0, i = 0; res != NULL; res = res->ai_next, ++i) + /* nothing */ ; + if (i == 0) { + freeaddrinfo(res0); + return (0); + } va = calloc(i, sizeof *va); XXXAN(va); *vap = va; From des at projects.linpro.no Wed Jan 23 15:51:12 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 23 Jan 2008 16:51:12 +0100 (CET) Subject: r2377 - in branches/1.1: . lib/libvarnish Message-ID: <20080123155112.F0F6A1EC475@projects.linpro.no> Author: des Date: 2008-01-23 16:51:12 +0100 (Wed, 23 Jan 2008) New Revision: 2377 Modified: branches/1.1/ branches/1.1/lib/libvarnish/vss.c Log: Merged revisions 2375 via svnmerge from svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache ........ r2375 | des | 2008-01-23 16:45:03 +0100 (Wed, 23 Jan 2008) | 6 lines Don't assume that res0 != NULL automatically means i == 0. I can't say for sure (without more coffee) that the assumption is incorrect, but it makes the code gratuitously non-transparent. Coverity Scan (CID:8) ........ Property changes on: branches/1.1 ___________________________________________________________________ Name: svnmerge-integrated - /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357,2359,2361 + /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357,2359,2361,2375 Modified: branches/1.1/lib/libvarnish/vss.c =================================================================== --- branches/1.1/lib/libvarnish/vss.c 2008-01-23 15:50:37 UTC (rev 2376) +++ branches/1.1/lib/libvarnish/vss.c 2008-01-23 15:51:12 UTC (rev 2377) @@ -135,8 +135,13 @@ fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(ret)); return (0); } - for (res = res0, i = 0; res != NULL; res = res->ai_next) - ++i; + XXXAN(res0); + for (res = res0, i = 0; res != NULL; res = res->ai_next, ++i) + /* nothing */ ; + if (i == 0) { + freeaddrinfo(res0); + return (0); + } va = calloc(i, sizeof *va); XXXAN(va); *vap = va; From des at projects.linpro.no Wed Jan 23 16:11:31 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 23 Jan 2008 17:11:31 +0100 (CET) Subject: r2378 - trunk/varnish-tools/fetcher Message-ID: <20080123161131.4526B1EC484@projects.linpro.no> Author: des Date: 2008-01-23 17:11:31 +0100 (Wed, 23 Jan 2008) New Revision: 2378 Modified: trunk/varnish-tools/fetcher/fetcher.pl Log: Implement URL banning. It is now possible to use the Apache http manual as a test data set. Consistently parenthesize print(). Modified: trunk/varnish-tools/fetcher/fetcher.pl =================================================================== --- trunk/varnish-tools/fetcher/fetcher.pl 2008-01-23 15:51:12 UTC (rev 2377) +++ trunk/varnish-tools/fetcher/fetcher.pl 2008-01-23 16:11:31 UTC (rev 2378) @@ -38,6 +38,7 @@ use Socket; use URI; +our %BANNED; our %TODO; our %DONE; our %CHILD; @@ -69,6 +70,7 @@ my $check = 1; my $ua = new LWP::UserAgent('keep_alive' => 3); + $ua->requests_redirectable([]); for (;;) { $0 = "[fetcher] idle"; my $url = <$s>; @@ -85,18 +87,29 @@ next; } $0 = "[fetcher] requesting $url"; - print STDERR "Retrieving $url\n" + print(STDERR "Retrieving $url\n") unless ($quiet > 1); my $resp = $ua->get($url); if ($check) { $0 = "[fetcher] checking $url"; - # XXX if we got a redirect, we should blacklist the - # original URL and suggest the target URL instead - if ($resp->header('Content-Type') =~ m/^text\//) { - my %urls = map { $_ => 1 } ($resp->content =~ m/$url_re/g); - foreach (keys(%urls)) { - $s->write("add $_\n"); + if ($resp->is_redirect()) { + $s->write("ban $url\n"); + $url = $resp->header('Location') // + $resp->header('Content-Location'); + $s->write("add $url\n") + if $url; + } elsif ($resp->is_success()) { + if ($resp->header('Content-Type') =~ m/^text\//) { + my %urls = map { $_ => 1 } ($resp->content =~ m/$url_re/g); + foreach (keys(%urls)) { + $s->write("add $_\n"); + } } + } elsif ($resp->is_error()) { + # XXX should we ban these? + } else { + print(STDERR "Unsupported response type:", + $resp->status_line(), "\n"); } } select(undef, undef, undef, $delay) @@ -131,6 +144,18 @@ ++$BUSY; } +# Convert relative to absolute and add to blacklist +sub ban_url($$) { + my ($child, $url) = @_; + + die "child not busy\n" + unless $child->{'url'}; + my $uri = URI->new_abs($1, $child->{'url'}); + $url = $uri->canonical; + $BANNED{$url} = 1; + print(STDERR "Banned $url\n"); +} + # Convert relative to absolute, check if valid, and add to list sub get_url($$) { my ($child, $url) = @_; @@ -139,9 +164,10 @@ unless $child->{'url'}; my $uri = URI->new_abs($1, $child->{'url'}); $url = $uri->canonical; - if ($uri->scheme() ne 'http' || + # XXX should cache child URI to avoid new() here + if ($BANNED{$url} || $uri->scheme() ne 'http' || $uri->host_port() ne URI->new($child->{'url'})->host_port()) { - print STDERR "Rejected $url\n" + print(STDERR "Rejected $url\n") unless ($quiet > 0); return; } @@ -164,6 +190,8 @@ $mux->endloop(); } elsif ($line =~ m/^add (.*?)$/) { get_url($child, $1); + } elsif ($line =~ m/^ban (.*?)$/) { + ban_url($child, $1); } else { die "can't grok [$line]\n"; } @@ -218,7 +246,7 @@ } %TODO = %DONE; %DONE = (); - print STDERR "Starting over...\n"; + print(STDERR "Starting over...\n"); } # done @@ -236,7 +264,7 @@ sub usage() { - print STDERR "usage: $0 [-cqr] [-d n] [-j n] URL ...\n"; + print(STDERR "usage: $0 [-cqr] [-d n] [-j n] URL ...\n"); exit(1); } From des at projects.linpro.no Wed Jan 23 16:23:29 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 23 Jan 2008 17:23:29 +0100 (CET) Subject: r2379 - trunk/varnish-cache/bin/varnishd Message-ID: <20080123162329.257D61EC475@projects.linpro.no> Author: des Date: 2008-01-23 17:23:28 +0100 (Wed, 23 Jan 2008) New Revision: 2379 Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c Log: It is possible for VSS_parse() to succeed and return a NULL addr but a non-NULL port (e.g. ":80" which is a valid listening address). In that case, port should be free()d before returning. Coverity Scan (CID:15) Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-23 16:11:31 UTC (rev 2378) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-23 16:23:28 UTC (rev 2379) @@ -412,6 +412,14 @@ * XXX: again: we should check it here in the "trivial" case. */ if (VSS_parse(b_arg, &addr, &port) != 0 || addr == NULL) { + /* + * (addr == NULL && port != NULL) is possible if + * the user incorrectly specified an address such + * as ":80", which is a valid listening address. + * In the future, we may want to interpret this as + * a shortcut for "localhost:80". + */ + free(port); fprintf(stderr, "invalid backend address\n"); return (1); } From des at projects.linpro.no Wed Jan 23 16:24:30 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 23 Jan 2008 17:24:30 +0100 (CET) Subject: r2380 - in branches/1.2: . bin/varnishd Message-ID: <20080123162430.5A2EF1EC2B5@projects.linpro.no> Author: des Date: 2008-01-23 17:24:30 +0100 (Wed, 23 Jan 2008) New Revision: 2380 Modified: branches/1.2/ branches/1.2/bin/varnishd/mgt_vcc.c Log: Merged revisions 2379 via svnmerge from svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache ........ r2379 | des | 2008-01-23 17:23:28 +0100 (Wed, 23 Jan 2008) | 6 lines It is possible for VSS_parse() to succeed and return a NULL addr but a non-NULL port (e.g. ":80" which is a valid listening address). In that case, port should be free()d before returning. Coverity Scan (CID:15) ........ Property changes on: branches/1.2 ___________________________________________________________________ Name: svnmerge-integrated - /trunk/varnish-cache:1-2101,2104-2107,2115-2120,2122-2130,2133,2151,2153-2154,2157,2161-2162,2166-2168,2173,2175-2176,2180-2184,2186-2193,2206,2208,2210-2215,2220,2222-2232,2243,2246-2255,2375 + /trunk/varnish-cache:1-2101,2104-2107,2115-2120,2122-2130,2133,2151,2153-2154,2157,2161-2162,2166-2168,2173,2175-2176,2180-2184,2186-2193,2206,2208,2210-2215,2220,2222-2232,2243,2246-2255,2375,2379 Modified: branches/1.2/bin/varnishd/mgt_vcc.c =================================================================== --- branches/1.2/bin/varnishd/mgt_vcc.c 2008-01-23 16:23:28 UTC (rev 2379) +++ branches/1.2/bin/varnishd/mgt_vcc.c 2008-01-23 16:24:30 UTC (rev 2380) @@ -391,6 +391,14 @@ * XXX: again: we should check it here in the "trivial" case. */ if (VSS_parse(b_arg, &addr, &port) != 0 || addr == NULL) { + /* + * (addr == NULL && port != NULL) is possible if + * the user incorrectly specified an address such + * as ":80", which is a valid listening address. + * In the future, we may want to interpret this as + * a shortcut for "localhost:80". + */ + free(port); fprintf(stderr, "invalid backend address\n"); return (1); } From des at projects.linpro.no Wed Jan 23 16:27:02 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 23 Jan 2008 17:27:02 +0100 (CET) Subject: r2381 - in branches/1.1: . bin/varnishd Message-ID: <20080123162702.B596D1EC475@projects.linpro.no> Author: des Date: 2008-01-23 17:27:02 +0100 (Wed, 23 Jan 2008) New Revision: 2381 Modified: branches/1.1/ branches/1.1/bin/varnishd/mgt_vcc.c Log: Merged revisions 2379 via svnmerge from svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache ........ r2379 | des | 2008-01-23 17:23:28 +0100 (Wed, 23 Jan 2008) | 6 lines It is possible for VSS_parse() to succeed and return a NULL addr but a non-NULL port (e.g. ":80" which is a valid listening address). In that case, port should be free()d before returning. Coverity Scan (CID:15) ........ Property changes on: branches/1.1 ___________________________________________________________________ Name: svnmerge-integrated - /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357,2359,2361,2375 + /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357,2359,2361,2375,2379 Modified: branches/1.1/bin/varnishd/mgt_vcc.c =================================================================== --- branches/1.1/bin/varnishd/mgt_vcc.c 2008-01-23 16:24:30 UTC (rev 2380) +++ branches/1.1/bin/varnishd/mgt_vcc.c 2008-01-23 16:27:02 UTC (rev 2381) @@ -342,6 +342,14 @@ * XXX: again: we should check it here in the "trivial" case. */ if (VSS_parse(b_arg, &addr, &port) != 0 || addr == NULL) { + /* + * (addr == NULL && port != NULL) is possible if + * the user incorrectly specified an address such + * as ":80", which is a valid listening address. + * In the future, we may want to interpret this as + * a shortcut for "localhost:80". + */ + free(port); fprintf(stderr, "invalid backend address\n"); return (1); } From des at projects.linpro.no Wed Jan 23 20:23:20 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Wed, 23 Jan 2008 21:23:20 +0100 (CET) Subject: r2382 - trunk/varnish-cache Message-ID: <20080123202320.E51621EC469@projects.linpro.no> Author: des Date: 2008-01-23 21:23:20 +0100 (Wed, 23 Jan 2008) New Revision: 2382 Modified: trunk/varnish-cache/configure.ac Log: Improve readability, such as it is. Allow the user to disable specific acceptor mechanisms (e.g. do not use epoll even though it is available). Don't look for kqueue on systems where we know it doesn't work. Bail if no acceptor mechanism was found. Bail if no curses or ncurses was found. Warn the user if SO_{RCV,SND}TIMEO are non-functional. Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2008-01-23 16:27:02 UTC (rev 2381) +++ trunk/varnish-cache/configure.ac 2008-01-23 20:23:20 UTC (rev 2382) @@ -43,6 +43,11 @@ LIBS="${save_LIBS}" AC_SUBST(CURSES_LIBS) +# people tend to forget about curses until the build breaks +if test "$ac_cv_search_initscr" = no; then + AC_MSG_ERROR([curses or ncurses is required]) +fi + save_LIBS="${LIBS}" LIBS="" AC_SEARCH_LIBS(pthread_create, [thr pthread c_r]) @@ -125,12 +130,71 @@ AC_CHECK_FUNCS([clock_gettime]) LIBS="${save_LIBS}" -# Check which mechanism to use for the acceptor -AC_CHECK_FUNCS([kqueue]) -AC_CHECK_FUNCS([epoll_ctl]) -AC_CHECK_FUNCS([poll]) +# Check which mechanism to use for the acceptor. We look for kqueue +# only on platforms on which we know that it works, because there are +# platforms where a simple AC_CHECK_FUNCS([kqueue]) would succeed but +# the build would fail. We also allow the user to disable mechanisms +# he doesn't want to use. -# Solaris defines SO_{RCV,SND}TIMEO, but does not implement them +# --enable-kqueue +AC_ARG_ENABLE(kqueue, + AS_HELP_STRING([--enable-kqueue], + [use kqueue if available (default is YES)]), + , + [enable_kqueue=yes]) + +if test "$enable_kqueue" = yes; then + case $host in + *-*-freebsd*) + AC_CHECK_FUNCS([kqueue]) + ;; + *-*-bsd*) + # No other BSD has a sufficiently recent implementation + AC_MSG_WARN([won't look for kqueue() on $host]) + ac_cv_func_kqueue=no + ;; + esac +else + ac_cv_func_kqueue=no +fi + +# --enable-epoll +AC_ARG_ENABLE(epoll, + AS_HELP_STRING([--enable-epoll], + [use epoll if available (default is YES)]), + , + [enable_epoll=yes]) + +if test "$enable_epoll" = yes; then + AC_CHECK_FUNCS([epoll_ctl]) +else + ac_cv_func_epoll_ctl=no +fi + +# --enable-poll +AC_ARG_ENABLE(poll, + AS_HELP_STRING([--enable-poll], + [use poll if available (default is YES)]), + , + [enable_poll=yes]) + +if test "$enable_poll" = yes; then + AC_CHECK_FUNCS([poll]) +else + ac_cv_func_poll=no +fi + +if test "$ac_cv_func_kqueue" != yes && + test "$ac_cv_func_epoll_ctl" != yes && + test "$ac_cv_func_poll" != yes; then + AC_MSG_ERROR([no usable acceptor mechanism]) +fi + +# Solaris defines SO_{RCV,SND}TIMEO, but does not implement them. +# Varnish will build and run without these, but connections will not +# time out, which may leave Varnish vulnerable to denail-of-service +# attacks which would not be possible on other platforms. + AC_CACHE_CHECK([whether SO_RCVTIMEO works], [ac_cv_so_rcvtimeo_works], [AC_RUN_IFELSE( @@ -169,6 +233,11 @@ AC_DEFINE([SO_SNDTIMEO_WORKS], [1], [Define if SO_SNDTIMEO works]) fi +if test "$ac_cv_so_rcvtimeo_works" = no || + test "$ac_cv_so_sndtimeo_works" = no; then + AC_MSG_WARN([connection timeouts will not work]) +fi + # Run-time directory VARNISH_STATE_DIR='${localstatedir}/varnish' AC_SUBST(VARNISH_STATE_DIR) @@ -182,21 +251,32 @@ # Additional flags for GCC 4 EXTRA_DEVELOPER_CFLAGS="-Wextra -Wno-missing-field-initializers -Wno-sign-compare" +# --enable-developer-warnings AC_ARG_ENABLE(developer-warnings, AS_HELP_STRING([--enable-developer-warnings],[enable strict warnings (default is NO)]), CFLAGS="${CFLAGS} ${DEVELOPER_CFLAGS}") + +# --enable-debugging-symbols AC_ARG_ENABLE(debugging-symbols, AS_HELP_STRING([--enable-debugging-symbols],[enable debugging symbols (default is NO)]), CFLAGS="${CFLAGS} -O0 -g -fno-inline") + +# --enable-diagnostics AC_ARG_ENABLE(diagnostics, AS_HELP_STRING([--enable-diagnostics],[enable run-time diagnostics (default is NO)]), CFLAGS="${CFLAGS} -DDIAGNOSTICS") + +# --enable-extra-developer-warnings AC_ARG_ENABLE(extra-developer-warnings, AS_HELP_STRING([--enable-extra-developer-warnings],[enable even stricter warnings (default is NO)]), CFLAGS="${CFLAGS} ${EXTRA_DEVELOPER_CFLAGS}") + +# --enable-stack-protector AC_ARG_ENABLE(stack-protector, AS_HELP_STRING([--enable-stack-protector],[enable stack protector (default is NO)]), CFLAGS="${CFLAGS} -fstack-protector-all") + +# --enable-werror AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],[use -Werror (default is NO)]), CFLAGS="${CFLAGS} -Werror") From ssm at projects.linpro.no Thu Jan 24 06:24:28 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Thu, 24 Jan 2008 07:24:28 +0100 (CET) Subject: r2383 - trunk/varnish-cache/debian Message-ID: <20080124062429.013E31EC2B5@projects.linpro.no> Author: ssm Date: 2008-01-24 07:24:28 +0100 (Thu, 24 Jan 2008) New Revision: 2383 Added: trunk/varnish-cache/debian/source.lintian-overrides Log: Debian packaging: Add an override to the lintian program to stop it from complaining about a false positive Added: trunk/varnish-cache/debian/source.lintian-overrides =================================================================== --- trunk/varnish-cache/debian/source.lintian-overrides (rev 0) +++ trunk/varnish-cache/debian/source.lintian-overrides 2008-01-24 06:24:28 UTC (rev 2383) @@ -0,0 +1,2 @@ +# This is a false positive, upstream Makefile removes config.* with "distclean" +varnish source: configure-generated-file-in-source config.log From ssm at projects.linpro.no Thu Jan 24 06:28:29 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Thu, 24 Jan 2008 07:28:29 +0100 (CET) Subject: r2384 - in branches/1.1: . debian Message-ID: <20080124062829.6C4B51EC418@projects.linpro.no> Author: ssm Date: 2008-01-24 07:28:29 +0100 (Thu, 24 Jan 2008) New Revision: 2384 Added: branches/1.1/debian/source.lintian-overrides Modified: branches/1.1/ Log: Merged revisions 2383 via svnmerge from svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache ........ r2383 | ssm | 2008-01-24 07:24:28 +0100 (Thu, 24 Jan 2008) | 1 line Debian packaging: Add an override to the lintian program to stop it from complaining about a false positive ........ Property changes on: branches/1.1 ___________________________________________________________________ Name: svnmerge-integrated - /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357,2359,2361,2375,2379 + /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2357,2359,2361,2375,2379,2383 Copied: branches/1.1/debian/source.lintian-overrides (from rev 2383, trunk/varnish-cache/debian/source.lintian-overrides) =================================================================== --- branches/1.1/debian/source.lintian-overrides (rev 0) +++ branches/1.1/debian/source.lintian-overrides 2008-01-24 06:28:29 UTC (rev 2384) @@ -0,0 +1,2 @@ +# This is a false positive, upstream Makefile removes config.* with "distclean" +varnish source: configure-generated-file-in-source config.log From ssm at projects.linpro.no Thu Jan 24 06:30:20 2008 From: ssm at projects.linpro.no (ssm at projects.linpro.no) Date: Thu, 24 Jan 2008 07:30:20 +0100 (CET) Subject: r2385 - in branches/debian/1.1.2: . debian Message-ID: <20080124063020.85D201EC2B5@projects.linpro.no> Author: ssm Date: 2008-01-24 07:30:20 +0100 (Thu, 24 Jan 2008) New Revision: 2385 Added: branches/debian/1.1.2/debian/source.lintian-overrides Modified: branches/debian/1.1.2/ Log: Merged revisions 2383 via svnmerge from svn+ssh://projects.linpro.no/svn/varnish/trunk/varnish-cache ........ r2383 | ssm | 2008-01-24 07:24:28 +0100 (Thu, 24 Jan 2008) | 1 line Debian packaging: Add an override to the lintian program to stop it from complaining about a false positive ........ Property changes on: branches/debian/1.1.2 ___________________________________________________________________ Name: svnmerge-integrated - /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2329-2330,2357-2359,2361 + /trunk/varnish-cache:1-1722,1727-1729,1733,1738,1743-1777,1779-1798,1800-1815,1817,1819,1823,1830-1838,1846,1853-1855,1857-1859,1862,1865-1868,1871-1880,1883-1884,1886,1888-1889,1896,1898,1902-1905,1907,1909,1912-1916,1920-1928,1935-1939,1941-1949,1955,1957-1958,1967-1968,1970-1974,1976-1977,1984,1986-1989,1991-1998,2026,2031-2033,2057,2077-2080,2086,2088,2097,2106-2107,2116,2133,2154,2173,2181,2206-2207,2211-2212,2215-2245,2256-2262,2270-2271,2275,2285-2286,2288-2291,2295-2301,2306,2310,2313-2314,2316,2318,2320,2322,2324,2329-2330,2357-2359,2361,2383 Copied: branches/debian/1.1.2/debian/source.lintian-overrides (from rev 2383, trunk/varnish-cache/debian/source.lintian-overrides) =================================================================== --- branches/debian/1.1.2/debian/source.lintian-overrides (rev 0) +++ branches/debian/1.1.2/debian/source.lintian-overrides 2008-01-24 06:30:20 UTC (rev 2385) @@ -0,0 +1,2 @@ +# This is a false positive, upstream Makefile removes config.* with "distclean" +varnish source: configure-generated-file-in-source config.log From des at projects.linpro.no Fri Jan 25 15:38:18 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 25 Jan 2008 16:38:18 +0100 (CET) Subject: r2386 - trunk/varnish-tools/fetcher Message-ID: <20080125153818.C437B1EC484@projects.linpro.no> Author: des Date: 2008-01-25 16:38:18 +0100 (Fri, 25 Jan 2008) New Revision: 2386 Modified: trunk/varnish-tools/fetcher/fetcher.pl Log: Roundup of old uncommitted changes: Getopt::Long cleanup, IO::Multiplex cleanup, statistics. Also improve banning, and avoid // which is only available in very recent Perl versions. Modified: trunk/varnish-tools/fetcher/fetcher.pl =================================================================== --- trunk/varnish-tools/fetcher/fetcher.pl 2008-01-24 06:30:20 UTC (rev 2385) +++ trunk/varnish-tools/fetcher/fetcher.pl 2008-01-25 15:38:18 UTC (rev 2386) @@ -3,6 +3,8 @@ # Copyright (c) 2007 Linpro AS # All rights reserved. # +# Author: Dag-Erling Sm?rgrav +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -28,14 +30,17 @@ # $Id$ # +our $VERSION = '$Id$'; + package Varnish::Fetcher; use strict; -use Getopt::Long; +use Getopt::Long qw(:config bundling require_order auto_version); use IO::Handle; use IO::Multiplex; use LWP::UserAgent; use Socket; +use Time::HiRes qw(gettimeofday tv_interval); use URI; our %BANNED; @@ -50,8 +55,12 @@ our $quiet = 0; our $random = 0; -our $url_re = - qr/\b(?:href|src)=[\'\"]([^\'\"\?\#]+)(?:[\?\#][^\'\"]*)?[\'\"]/io; +our $url_re = qr{ + \b(?:href|src)=[\'\"]\s* + ([^\'\"\?\#]+) # capture URL + (?:[\?\#][^\'\"]*)? # discard fragment / query + \s*[\'\"] + }iox; sub new($$) { my ($this, $mux, $fh) = @_; @@ -94,7 +103,7 @@ $0 = "[fetcher] checking $url"; if ($resp->is_redirect()) { $s->write("ban $url\n"); - $url = $resp->header('Location') // + $url = $resp->header('Location') || $resp->header('Content-Location'); $s->write("add $url\n") if $url; @@ -124,8 +133,8 @@ my ($child, $msg) = @_; die "child busy\n" - if $child->{'url'}; - $child->{'mux'}->write($child->{'fh'}, "$msg\n"); + if $$child{'url'}; + $$child{'fh'}->write("$msg\n"); } # Send a URL and mark the child as busy @@ -133,14 +142,14 @@ my ($child) = @_; die "child busy\n" - if $child->{'url'}; + if $$child{'url'}; return undef unless (keys(%TODO)); my $url = (keys(%TODO))[0]; + $DONE{$url} = $TODO{$url}; delete $TODO{$url}; - $DONE{$url} = 1; - $child->{'url'} = $url; - $child->{'mux'}->write($child->{'fh'}, "$url\n"); + $$child{'url'} = $url; + $$child{'fh'}->write("$url\n"); ++$BUSY; } @@ -149,11 +158,14 @@ my ($child, $url) = @_; die "child not busy\n" - unless $child->{'url'}; - my $uri = URI->new_abs($1, $child->{'url'}); + unless $$child{'url'}; + my $uri = URI->new_abs($1, $$child{'url'}); $url = $uri->canonical; $BANNED{$url} = 1; - print(STDERR "Banned $url\n"); + delete $TODO{$url}; + delete $DONE{$url}; + print(STDERR "Banned $url\n") + unless ($quiet > 2); } # Convert relative to absolute, check if valid, and add to list @@ -161,12 +173,12 @@ my ($child, $url) = @_; die "child not busy\n" - unless $child->{'url'}; - my $uri = URI->new_abs($1, $child->{'url'}); + unless $$child{'url'}; + my $uri = URI->new_abs($1, $$child{'url'}); $url = $uri->canonical; # XXX should cache child URI to avoid new() here if ($BANNED{$url} || $uri->scheme() ne 'http' || - $uri->host_port() ne URI->new($child->{'url'})->host_port()) { + $uri->host_port() ne URI->new($$child{'url'})->host_port()) { print(STDERR "Rejected $url\n") unless ($quiet > 0); return; @@ -232,27 +244,41 @@ # main loop for (;;) { + my $t0 = [gettimeofday()]; + + # keep dispatching URLs until we're done for (;;) { foreach my $child (values(%CHILD)) { $child->send_url() - unless $child->{'url'}; + unless $$child{'url'}; } + printf(STDERR " %d/%d \r", int(keys(%DONE)), + int(keys(%DONE)) + int(keys(%TODO))) + unless ($quiet > 3); last unless $BUSY; $mux->loop(); } + + # summarize + my $dt = tv_interval($t0, [gettimeofday()]); + my $count = int(keys(%DONE)) + int(keys(%BANNED)); + printf(STDERR "retrieved %d documents in %.2f seconds - %.2f tps\n", + $count, $dt, $count / $dt) + unless ($quiet > 3); + last unless $continue; foreach my $child (values(%CHILD)) { $child->send("no check"); } + %BANNED = (); %TODO = %DONE; %DONE = (); - print(STDERR "Starting over...\n"); } # done foreach my $child (values(%CHILD)) { $child->send("done"); - $mux->close($$child{'fh'}); + $$child{'fh'}->close(); } } @@ -269,11 +295,11 @@ } MAIN:{ - GetOptions("c|continue" => \$continue, + GetOptions("c|continue!" => \$continue, "d|delay=i" => \$delay, "j|jobs=i" => \$jobs, "q|quiet+" => \$quiet, - "r|random" => \$random) + "r|random!" => \$random) or usage(); $jobs > 0 or usage(); From des at projects.linpro.no Fri Jan 25 16:00:42 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Fri, 25 Jan 2008 17:00:42 +0100 (CET) Subject: r2387 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080125160042.721C41EC2B5@projects.linpro.no> Author: des Date: 2008-01-25 17:00:42 +0100 (Fri, 25 Jan 2008) New Revision: 2387 Modified: trunk/varnish-cache/lib/libvarnish/assert.c Log: Don't print strerror(errno) unless errno != 0. Modified: trunk/varnish-cache/lib/libvarnish/assert.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/assert.c 2008-01-25 15:38:18 UTC (rev 2386) +++ trunk/varnish-cache/lib/libvarnish/assert.c 2008-01-25 16:00:42 UTC (rev 2387) @@ -42,8 +42,11 @@ fprintf(stderr, "Missing errorhandling code in %s(), %s line %d:\n" - " Condition(%s) not true.\n" - " errno = %d (%s)\n", func, file, line, cond, err, strerror(err)); + " Condition(%s) not true.\n", + func, file, line, cond); + if (err) + fprintf(stderr, + " errno = %d (%s)\n", err, strerror(err)); abort(); } @@ -53,7 +56,10 @@ fprintf(stderr, "Assert error in %s(), %s line %d:\n" - " Condition(%s) not true.\n" - " errno = %d (%s)\n", func, file, line, cond, err, strerror(err)); + " Condition(%s) not true.\n", + func, file, line, cond); + if (err) + fprintf(stderr, + " errno = %d (%s)\n", err, strerror(err)); abort(); } From phk at projects.linpro.no Mon Jan 28 08:46:15 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 28 Jan 2008 09:46:15 +0100 (CET) Subject: r2388 - trunk/varnish-cache/bin/varnishd Message-ID: <20080128084615.D4B4F1ECED2@projects.linpro.no> Author: phk Date: 2008-01-28 09:46:15 +0100 (Mon, 28 Jan 2008) New Revision: 2388 Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c Log: Deoptimize the central object matching loop in the hash code: With the advent of prefetch and degraded mode, the invariants of objectheads change so that more than one object can be busy at any one time. Thus we can no longer assume that the busy object or one subsequent to it, is the one we eventually desire, and we must start our search from the front of the list again. As an amusing sidenote: this eliminates the only "goto" in all of varnishd. Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-25 16:00:42 UTC (rev 2387) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-28 08:46:15 UTC (rev 2388) @@ -185,44 +185,44 @@ HSH_Prealloc(sp); if (sp->obj != NULL) { CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); - o = sp->obj; - oh = o->objhead; + oh = sp->obj->objhead; + HSH_Deref(sp->obj); CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC); LOCK(&oh->mtx); - goto were_back; + } else { + oh = hash->lookup(sp, w->nobjhead); + CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC); + if (oh == w->nobjhead) + w->nobjhead = NULL; + LOCK(&oh->mtx); } - oh = hash->lookup(sp, w->nobjhead); - CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC); - if (oh == w->nobjhead) - w->nobjhead = NULL; - LOCK(&oh->mtx); VTAILQ_FOREACH(o, &oh->objects, list) { - o->refcnt++; if (o->busy) { VTAILQ_INSERT_TAIL(&o->waitinglist, sp, list); sp->obj = o; + o->refcnt++; UNLOCK(&oh->mtx); return (NULL); } - were_back: - if (!o->cacheable) { - /* ignore */ - } else if (o->ttl == 0) { - /* Object banned but not reaped yet */ - } else if (o->ttl <= sp->t_req) { - /* Object expired */ - } else if (BAN_CheckObject(o, - h->hd[HTTP_HDR_URL].b, oh->hash)) { + if (!o->cacheable) + continue; + if (o->ttl == 0) + continue; + if (o->ttl <= sp->t_req) + continue; + if (BAN_CheckObject(o, h->hd[HTTP_HDR_URL].b, oh->hash)) { o->ttl = 0; WSP(sp, SLT_ExpBan, "%u was banned", o->xid); if (o->timer_idx != 0) EXP_TTLchange(o); - } else if (o->vary == NULL || VRY_Match(sp, o->vary)) + continue; + } + if (o->vary == NULL || VRY_Match(sp, o->vary)) break; - o->refcnt--; } if (o != NULL) { + o->refcnt++; UNLOCK(&oh->mtx); (void)hash->deref(oh); return (o); From phk at projects.linpro.no Mon Jan 28 09:01:39 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 28 Jan 2008 10:01:39 +0100 (CET) Subject: r2389 - trunk/varnish-cache/bin/varnishd Message-ID: <20080128090139.8BA7C1EC307@projects.linpro.no> Author: phk Date: 2008-01-28 10:01:38 +0100 (Mon, 28 Jan 2008) New Revision: 2389 Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_center.c trunk/varnish-cache/bin/varnishd/cache_hash.c Log: With Vary, Prefetch and degraded mode, a session sleeps not on a particular object, because we cannot know beforehand if it will work out for us, but sleeps on any one of potentially multiple busy objects becoming ready for us to test against. Therefore it makes sense to move the waiting list from the object to the object head, as this both simplifies the code and eliminates a refhold on busy objects. Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2008-01-28 08:46:15 UTC (rev 2388) +++ trunk/varnish-cache/bin/varnishd/cache.h 2008-01-28 09:01:38 UTC (rev 2389) @@ -267,8 +267,6 @@ VTAILQ_HEAD(, storage) store; - VTAILQ_HEAD(, sess) waitinglist; - VTAILQ_HEAD(, esi_bit) esibits; double lru_stamp; @@ -283,6 +281,7 @@ VTAILQ_HEAD(,object) objects; char *hash; unsigned hashlen; + VTAILQ_HEAD(, sess) waitinglist; }; /* -------------------------------------------------------------------*/ @@ -339,6 +338,7 @@ struct backend *backend; struct bereq *bereq; struct object *obj; + struct objhead *objhead; struct VCL_conf *vcl; /* Various internal stuff */ Modified: trunk/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_center.c 2008-01-28 08:46:15 UTC (rev 2388) +++ trunk/varnish-cache/bin/varnishd/cache_center.c 2008-01-28 09:01:38 UTC (rev 2389) @@ -541,7 +541,7 @@ * We hit a busy object, disembark worker thread and expect * hash code to restart us, still in STP_LOOKUP, later. */ - WSP(sp, SLT_Debug, "on waiting list on obj %u", sp->obj->xid); + WSP(sp, SLT_Debug, "on waiting list <%s>", sp->objhead->hash); /* * There is a non-zero risk that we come here more than once * before we get through, in that case cnt_recv must be set Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-28 08:46:15 UTC (rev 2388) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-28 09:01:38 UTC (rev 2389) @@ -81,6 +81,7 @@ XXXAN(w->nobjhead); w->nobjhead->magic = OBJHEAD_MAGIC; VTAILQ_INIT(&w->nobjhead->objects); + VTAILQ_INIT(&w->nobjhead->waitinglist); MTX_INIT(&w->nobjhead->mtx); VSL_stats->n_objecthead++; } else @@ -98,7 +99,6 @@ w->nobj->busy = 1; w->nobj->refcnt = 1; VTAILQ_INIT(&w->nobj->store); - VTAILQ_INIT(&w->nobj->waitinglist); VTAILQ_INIT(&w->nobj->esibits); VSL_stats->n_object++; } else @@ -183,10 +183,10 @@ h = sp->http; HSH_Prealloc(sp); - if (sp->obj != NULL) { - CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); - oh = sp->obj->objhead; - HSH_Deref(sp->obj); + if (sp->objhead != NULL) { + CHECK_OBJ_NOTNULL(sp->objhead, OBJHEAD_MAGIC); + oh = sp->objhead; + sp->objhead = NULL; CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC); LOCK(&oh->mtx); } else { @@ -199,9 +199,8 @@ VTAILQ_FOREACH(o, &oh->objects, list) { if (o->busy) { - VTAILQ_INSERT_TAIL(&o->waitinglist, sp, list); - sp->obj = o; - o->refcnt++; + VTAILQ_INSERT_TAIL(&oh->waitinglist, sp, list); + sp->objhead = oh; UNLOCK(&oh->mtx); return (NULL); } @@ -245,16 +244,16 @@ } static void -hsh_rush(struct object *o) +hsh_rush(struct objhead *oh) { unsigned u; struct sess *sp; for (u = 0; u < params->rush_exponent; u++) { - sp = VTAILQ_FIRST(&o->waitinglist); + sp = VTAILQ_FIRST(&oh->waitinglist); if (sp == NULL) return; - VTAILQ_REMOVE(&o->waitinglist, sp, list); + VTAILQ_REMOVE(&oh->waitinglist, sp, list); VSL(SLT_Debug, sp->id, "of waiting list"); WRK_QueueSession(sp); } @@ -276,7 +275,7 @@ LOCK(&oh->mtx); } o->busy = 0; - hsh_rush(o); + hsh_rush(oh); if (oh != NULL) UNLOCK(&oh->mtx); } @@ -314,7 +313,7 @@ } assert(o->refcnt > 0); r = --o->refcnt; - hsh_rush(o); + hsh_rush(oh); if (oh != NULL) { if (!r) VTAILQ_REMOVE(&oh->objects, o, list); From phk at projects.linpro.no Mon Jan 28 09:09:12 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 28 Jan 2008 10:09:12 +0100 (CET) Subject: r2390 - trunk/varnish-cache/bin/varnishd Message-ID: <20080128090912.69EE61EC307@projects.linpro.no> Author: phk Date: 2008-01-28 10:09:12 +0100 (Mon, 28 Jan 2008) New Revision: 2390 Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c Log: Instead of sleeping as soon as we see a busy object, traverse the rest of the objects on the objecthead to see if there is anything we can use. This unpessimizes Vary: processing, where we previously might go to sleep on a busy object despite the fact that we have a good and valid object with the Vary: we desire. Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-28 09:01:38 UTC (rev 2389) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-28 09:09:12 UTC (rev 2390) @@ -173,7 +173,7 @@ struct worker *w; struct http *h; struct objhead *oh; - struct object *o; + struct object *o, *busy_o; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC); @@ -197,12 +197,11 @@ LOCK(&oh->mtx); } + busy_o = NULL; VTAILQ_FOREACH(o, &oh->objects, list) { if (o->busy) { - VTAILQ_INSERT_TAIL(&oh->waitinglist, sp, list); - sp->objhead = oh; - UNLOCK(&oh->mtx); - return (NULL); + busy_o = o; + continue; } if (!o->cacheable) continue; @@ -221,12 +220,21 @@ break; } if (o != NULL) { + /* We found an object we like */ o->refcnt++; UNLOCK(&oh->mtx); (void)hash->deref(oh); return (o); } + if (busy_o != NULL) { + /* There are one or more busy objects, wait for them */ + VTAILQ_INSERT_TAIL(&oh->waitinglist, sp, list); + sp->objhead = oh; + UNLOCK(&oh->mtx); + return (NULL); + } + /* Insert (precreated) object in objecthead */ o = w->nobj; w->nobj = NULL; From phk at projects.linpro.no Mon Jan 28 09:28:49 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 28 Jan 2008 10:28:49 +0100 (CET) Subject: r2391 - in trunk/varnish-cache: bin/varnishd include lib/libvcl Message-ID: <20080128092850.281791ECED2@projects.linpro.no> Author: phk Date: 2008-01-28 10:28:47 +0100 (Mon, 28 Jan 2008) New Revision: 2391 Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/include/vrt_obj.h trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl trunk/varnish-cache/lib/libvcl/vcc_obj.c Log: Introduce obj.grace variable: The amount of time after obj.ttl this object can be served, provided we are already trying to fetch a new copy. Nothing inspects this variable yet. Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2008-01-28 09:09:12 UTC (rev 2390) +++ trunk/varnish-cache/bin/varnishd/cache.h 2008-01-28 09:28:47 UTC (rev 2391) @@ -256,6 +256,7 @@ double age; double entered; double ttl; + double grace; double prefetch; double last_modified; Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2008-01-28 09:09:12 UTC (rev 2390) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2008-01-28 09:28:47 UTC (rev 2391) @@ -304,6 +304,29 @@ return (sp->obj->ttl - sp->t_req); } +/*-------------------------------------------------------------------- + * obj.grace is relative to obj.ttl, so no special magic is necessary. + */ + +void +VRT_l_obj_grace(const struct sess *sp, double a) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ + if (a < 0) + a = 0; + sp->obj->grace = a; +} + +double +VRT_r_obj_grace(const struct sess *sp) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ + return (sp->obj->grace); +} + /*--------------------------------------------------------------------*/ /* XXX: the VCL_info messages has unexpected fractions on the ttl */ Modified: trunk/varnish-cache/include/vrt_obj.h =================================================================== --- trunk/varnish-cache/include/vrt_obj.h 2008-01-28 09:09:12 UTC (rev 2390) +++ trunk/varnish-cache/include/vrt_obj.h 2008-01-28 09:28:47 UTC (rev 2391) @@ -40,6 +40,8 @@ void VRT_l_obj_cacheable(const struct sess *, unsigned); double VRT_r_obj_ttl(const struct sess *); void VRT_l_obj_ttl(const struct sess *, double); +double VRT_r_obj_grace(const struct sess *); +void VRT_l_obj_grace(const struct sess *, double); double VRT_r_obj_prefetch(const struct sess *); void VRT_l_obj_prefetch(const struct sess *, double); double VRT_r_obj_lastuse(const struct sess *); Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-28 09:09:12 UTC (rev 2390) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-28 09:28:47 UTC (rev 2391) @@ -539,6 +539,8 @@ vsb_cat(sb, "void VRT_l_obj_cacheable(const struct sess *, unsigned);\n"); vsb_cat(sb, "double VRT_r_obj_ttl(const struct sess *);\n"); vsb_cat(sb, "void VRT_l_obj_ttl(const struct sess *, double);\n"); + vsb_cat(sb, "double VRT_r_obj_grace(const struct sess *);\n"); + vsb_cat(sb, "void VRT_l_obj_grace(const struct sess *, double);\n"); vsb_cat(sb, "double VRT_r_obj_prefetch(const struct sess *);\n"); vsb_cat(sb, "void VRT_l_obj_prefetch(const struct sess *, double);\n"); vsb_cat(sb, "double VRT_r_obj_lastuse(const struct sess *);\n"); Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2008-01-28 09:09:12 UTC (rev 2390) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2008-01-28 09:28:47 UTC (rev 2391) @@ -157,6 +157,11 @@ { hit fetch discard timeout} "const struct sess *" } + { obj.grace + RW TIME + { hit fetch discard timeout} + "const struct sess *" + } { obj.prefetch RW RTIME { fetch prefetch } Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2008-01-28 09:09:12 UTC (rev 2390) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2008-01-28 09:28:47 UTC (rev 2391) @@ -182,6 +182,13 @@ 0, VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DISCARD | VCL_MET_TIMEOUT }, + { "obj.grace", TIME, 9, + "VRT_r_obj_grace(sp)", + "VRT_l_obj_grace(sp, ", + V_RW, + 0, + VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DISCARD | VCL_MET_TIMEOUT + }, { "obj.prefetch", RTIME, 12, "VRT_r_obj_prefetch(sp)", "VRT_l_obj_prefetch(sp, ", From phk at projects.linpro.no Mon Jan 28 10:28:24 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Mon, 28 Jan 2008 11:28:24 +0100 (CET) Subject: r2392 - in trunk/varnish-cache: bin/varnishd include lib/libvcl Message-ID: <20080128102824.D19D31EC307@projects.linpro.no> Author: phk Date: 2008-01-28 11:28:24 +0100 (Mon, 28 Jan 2008) New Revision: 2392 Modified: trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_expire.c trunk/varnish-cache/bin/varnishd/cache_hash.c trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/bin/varnishd/cache_ws.c trunk/varnish-cache/include/vrt_obj.h trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl trunk/varnish-cache/lib/libvcl/vcc_obj.c Log: Finish (the "easy") part of degraded mode: Add req.grace timer: We only serve degraded mode objects if both the request and the object's grace timers are satisfied. Sort expiry list on obj.ttl + obj.grace and fiddle list if either changes. In the hash lookup: record if any objects still in grace by obj.grace which match our Vary: criteria (if any). If no in-ttl object was found AND we have a graced object AND it is also graced by req.grace AND it is being fetched: serve the graced object. Otherwise, mark us as successor to the graced object while we fetch to give others the chance. When we unbusy the object, clean the magic pointers between the two objects again. To play with this you need at least: sub vcl_recv { set req.grace = 2m; } sub vcl_fetch { set obj.grace = 2m; } Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2008-01-28 09:28:47 UTC (rev 2391) +++ trunk/varnish-cache/bin/varnishd/cache.h 2008-01-28 10:28:24 UTC (rev 2392) @@ -220,7 +220,6 @@ }; /* -------------------------------------------------------------------*/ - enum e_objtimer { TIMER_TTL, TIMER_PREFETCH @@ -271,6 +270,10 @@ VTAILQ_HEAD(, esi_bit) esibits; double lru_stamp; + + /* Prefetch */ + struct object *parent; + struct object *child; }; struct objhead { @@ -326,6 +329,9 @@ double t_resp; double t_end; + /* Acceptable grace period */ + double grace; + enum step step; unsigned cur_method; unsigned handling; Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_expire.c 2008-01-28 09:28:47 UTC (rev 2391) +++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2008-01-28 10:28:24 UTC (rev 2392) @@ -79,7 +79,7 @@ o->timer_when = o->prefetch; o->timer_what = TIMER_PREFETCH; } else { - o->timer_when = o->ttl; + o->timer_when = o->ttl + o->grace; o->timer_what = TIMER_TTL; } } Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-28 09:28:47 UTC (rev 2391) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-28 10:28:24 UTC (rev 2392) @@ -173,7 +173,7 @@ struct worker *w; struct http *h; struct objhead *oh; - struct object *o, *busy_o; + struct object *o, *busy_o, *grace_o; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC); @@ -198,6 +198,7 @@ } busy_o = NULL; + grace_o = NULL; VTAILQ_FOREACH(o, &oh->objects, list) { if (o->busy) { busy_o = o; @@ -207,8 +208,6 @@ continue; if (o->ttl == 0) continue; - if (o->ttl <= sp->t_req) - continue; if (BAN_CheckObject(o, h->hd[HTTP_HDR_URL].b, oh->hash)) { o->ttl = 0; WSP(sp, SLT_ExpBan, "%u was banned", o->xid); @@ -216,9 +215,27 @@ EXP_TTLchange(o); continue; } - if (o->vary == NULL || VRY_Match(sp, o->vary)) + if (o->vary != NULL && !VRY_Match(sp, o->vary)) + continue; + + /* If still valid, use it */ + if (o->ttl >= sp->t_req) break; + + /* Remember any matching objects inside their grace period */ + if (o->ttl + o->grace >= sp->t_req) + grace_o = o; } + + /* + * If we have a object in grace and being fetched, + * use it, if req.grace is also satisified. + */ + if (o == NULL && grace_o != NULL && + grace_o->child != NULL && + grace_o->ttl + sp->grace >= sp->t_req) + o = grace_o; + if (o != NULL) { /* We found an object we like */ o->refcnt++; @@ -239,8 +256,14 @@ o = w->nobj; w->nobj = NULL; o->objhead = oh; + /* XXX: Should this not be ..._HEAD now ? */ VTAILQ_INSERT_TAIL(&oh->objects, o, list); /* NB: do not deref objhead the new object inherits our reference */ + if (grace_o != NULL) { + grace_o->child = o; + o->parent = grace_o; + grace_o->refcnt++; + } UNLOCK(&oh->mtx); BAN_NewObj(o); /* @@ -271,6 +294,7 @@ HSH_Unbusy(struct object *o) { struct objhead *oh; + struct object *parent; CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); assert(o->busy); @@ -284,8 +308,14 @@ } o->busy = 0; hsh_rush(oh); + parent = o->parent; + o->parent = NULL; + if (parent != NULL) + parent->child = NULL; if (oh != NULL) UNLOCK(&oh->mtx); + if (parent != NULL) + HSH_Deref(parent); } void Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2008-01-28 09:28:47 UTC (rev 2391) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2008-01-28 10:28:24 UTC (rev 2392) @@ -317,6 +317,8 @@ if (a < 0) a = 0; sp->obj->grace = a; + if (sp->obj->timer_idx != 0) + EXP_TTLchange(sp->obj); } double @@ -427,6 +429,27 @@ return (sp->restarts); } +/*-------------------------------------------------------------------- + * req.grace + */ + +void +VRT_l_req_grace(struct sess *sp, double a) +{ + + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + if (a < 0) + a = 0; + sp->grace = a; +} + +double +VRT_r_req_grace(struct sess *sp) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); + return (sp->grace); +} + /*--------------------------------------------------------------------*/ const char * Modified: trunk/varnish-cache/bin/varnishd/cache_ws.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_ws.c 2008-01-28 09:28:47 UTC (rev 2391) +++ trunk/varnish-cache/bin/varnishd/cache_ws.c 2008-01-28 10:28:24 UTC (rev 2392) @@ -46,7 +46,7 @@ #include "cache.h" /* Enable this to get detailed logging of WS usage */ -#ifdef DIAGNOSTICS +#ifdef DIAGNOSTICS0 # define WS_DEBUG(fmt, ...) VSL(SLT_Debug, 0, fmt, __VA_ARGS__) #else # define WS_DEBUG(fmt, ...) /* nothing */ Modified: trunk/varnish-cache/include/vrt_obj.h =================================================================== --- trunk/varnish-cache/include/vrt_obj.h 2008-01-28 09:28:47 UTC (rev 2391) +++ trunk/varnish-cache/include/vrt_obj.h 2008-01-28 10:28:24 UTC (rev 2392) @@ -22,6 +22,8 @@ struct backend * VRT_r_req_backend(struct sess *); void VRT_l_req_backend(struct sess *, struct backend *); int VRT_r_req_restarts(const struct sess *); +double VRT_r_req_grace(struct sess *); +void VRT_l_req_grace(struct sess *, double); const char * VRT_r_bereq_request(const struct sess *); void VRT_l_bereq_request(const struct sess *, const char *, ...); const char * VRT_r_bereq_url(const struct sess *); Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-28 09:28:47 UTC (rev 2391) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-28 10:28:24 UTC (rev 2392) @@ -521,6 +521,8 @@ vsb_cat(sb, "struct backend * VRT_r_req_backend(struct sess *);\n"); vsb_cat(sb, "void VRT_l_req_backend(struct sess *, struct backend *);\n"); vsb_cat(sb, "int VRT_r_req_restarts(const struct sess *);\n"); + vsb_cat(sb, "double VRT_r_req_grace(const struct sess *);\n"); + vsb_cat(sb, "void VRT_l_req_grace(const struct sess *, double);\n"); vsb_cat(sb, "const char * VRT_r_bereq_request(const struct sess *);\n"); vsb_cat(sb, "void VRT_l_bereq_request(const struct sess *, const char *, ...);\n"); vsb_cat(sb, "const char * VRT_r_bereq_url(const struct sess *);\n"); Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2008-01-28 09:28:47 UTC (rev 2391) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2008-01-28 10:28:24 UTC (rev 2392) @@ -97,6 +97,11 @@ {recv pipe pass hash miss hit fetch deliver } "const struct sess *" } + { req.grace + RW TIME + {recv pipe pass hash miss hit fetch deliver } + "struct sess *" + } # Request sent to backend { bereq.request Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2008-01-28 09:28:47 UTC (rev 2391) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2008-01-28 10:28:24 UTC (rev 2392) @@ -105,6 +105,13 @@ 0, VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER }, + { "req.grace", TIME, 9, + "VRT_r_req_grace(sp)", + "VRT_l_req_grace(sp, ", + V_RW, + 0, + VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER + }, { "bereq.request", STRING, 13, "VRT_r_bereq_request(sp)", "VRT_l_bereq_request(sp, ", From phk at projects.linpro.no Tue Jan 29 08:14:50 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 29 Jan 2008 09:14:50 +0100 (CET) Subject: r2393 - trunk/varnish-cache/bin/varnishd Message-ID: <20080129081450.233C71EC1D1@projects.linpro.no> Author: phk Date: 2008-01-29 09:14:49 +0100 (Tue, 29 Jan 2008) New Revision: 2393 Modified: trunk/varnish-cache/bin/varnishd/mgt_event.c Log: Add a check to ensure that the event handler is never called by foreign threads. Inspired by, but not expected to have any effect on #199 Modified: trunk/varnish-cache/bin/varnishd/mgt_event.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_event.c 2008-01-28 10:28:24 UTC (rev 2392) +++ trunk/varnish-cache/bin/varnishd/mgt_event.c 2008-01-29 08:14:49 UTC (rev 2393) @@ -36,6 +36,7 @@ #include #include #include +#include #include "mgt.h" #include "mgt_event.h" @@ -68,6 +69,7 @@ unsigned char compact_pfd; unsigned char disturbed; unsigned psig; + pthread_t thread; }; /*--------------------------------------------------------------------*/ @@ -175,6 +177,7 @@ evb->magic = EVBASE_MAGIC; VTAILQ_INIT(&evb->events); evb->binheap = binheap_new(evb, ev_bh_cmp, ev_bh_update); + evb->thread = pthread_self(); return (evb); } @@ -184,6 +187,7 @@ ev_destroy_base(struct evbase *evb) { CHECK_OBJ_NOTNULL(evb, EVBASE_MAGIC); + assert(evb->thread == pthread_self()); evb->magic = 0; free(evb); } @@ -215,6 +219,7 @@ assert(e->sig >= 0); assert(e->timeout >= 0.0); assert(e->fd < 0 || e->fd_flags); + assert(evb->thread == pthread_self()); if (e->sig > 0 && ev_get_sig(e->sig)) return (ENOMEM); @@ -281,6 +286,7 @@ CHECK_OBJ_NOTNULL(evb, EVBASE_MAGIC); CHECK_OBJ_NOTNULL(e, EV_MAGIC); assert(evb == e->__evb); + assert(evb->thread == pthread_self()); if (e->__binheap_idx != 0) binheap_delete(evb->binheap, e->__binheap_idx); @@ -323,6 +329,7 @@ int i; CHECK_OBJ_NOTNULL(evb, EVBASE_MAGIC); + assert(evb->thread == pthread_self()); do i = ev_schedule_one(evb); while (i == 1); @@ -409,6 +416,7 @@ struct pollfd *pfd; CHECK_OBJ_NOTNULL(evb, EVBASE_MAGIC); + assert(evb->thread == pthread_self()); e = binheap_root(evb->binheap); if (e != NULL) { CHECK_OBJ_NOTNULL(e, EV_MAGIC); From phk at projects.linpro.no Tue Jan 29 08:45:40 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 29 Jan 2008 09:45:40 +0100 (CET) Subject: r2394 - in trunk/varnish-cache: . bin/varnishd Message-ID: <20080129084540.AC6551EC2B5@projects.linpro.no> Author: phk Date: 2008-01-29 09:45:40 +0100 (Tue, 29 Jan 2008) New Revision: 2394 Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c trunk/varnish-cache/configure.ac Log: Use getdtablesize() to size bitmap if we have it. Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c 2008-01-29 08:14:49 UTC (rev 2393) +++ trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c 2008-01-29 08:45:40 UTC (rev 2394) @@ -86,8 +86,13 @@ vb = calloc(sizeof *vb, 1); AN(vb); - if (initial == 0) + if (initial == 0) { +#ifdef HAVE_GETDTABLESIZE + initial = getdtablesize(); +#else initial = VBITMAP_LUMP; +#endif + } vbit_expand(vb, initial); return (vb); } Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2008-01-29 08:14:49 UTC (rev 2393) +++ trunk/varnish-cache/configure.ac 2008-01-29 08:45:40 UTC (rev 2394) @@ -101,6 +101,7 @@ AC_CHECK_FUNCS([socket]) AC_CHECK_FUNCS([strptime]) AC_CHECK_FUNCS([fmtcheck]) +AC_CHECK_FUNCS([getdtablesize]) # Don't look for sendfile at all, none of them work # anyway. (don't tell when done with passed mem-range) From phk at projects.linpro.no Tue Jan 29 10:57:30 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 29 Jan 2008 11:57:30 +0100 (CET) Subject: r2395 - trunk/varnish-cache/bin/varnishd Message-ID: <20080129105730.5F9E31EC484@projects.linpro.no> Author: phk Date: 2008-01-29 11:57:30 +0100 (Tue, 29 Jan 2008) New Revision: 2395 Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c Log: Fix a possible NULL dereference. Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-29 08:45:40 UTC (rev 2394) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-29 10:57:30 UTC (rev 2395) @@ -307,7 +307,8 @@ LOCK(&oh->mtx); } o->busy = 0; - hsh_rush(oh); + if (oh != NULL) + hsh_rush(oh); parent = o->parent; o->parent = NULL; if (parent != NULL) From phk at projects.linpro.no Tue Jan 29 10:59:02 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 29 Jan 2008 11:59:02 +0100 (CET) Subject: r2396 - trunk/varnish-cache/bin/varnishd Message-ID: <20080129105902.809761EC2B5@projects.linpro.no> Author: phk Date: 2008-01-29 11:59:01 +0100 (Tue, 29 Jan 2008) New Revision: 2396 Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c Log: Close another possible NULL dereference Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-29 10:57:30 UTC (rev 2395) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-29 10:59:01 UTC (rev 2396) @@ -352,7 +352,8 @@ } assert(o->refcnt > 0); r = --o->refcnt; - hsh_rush(oh); + if (oh != NULL) + hsh_rush(oh); if (oh != NULL) { if (!r) VTAILQ_REMOVE(&oh->objects, o, list); From phk at projects.linpro.no Tue Jan 29 11:14:22 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 29 Jan 2008 12:14:22 +0100 (CET) Subject: r2397 - trunk/varnish-cache/bin/varnishd Message-ID: <20080129111422.B4BAB1EC1D1@projects.linpro.no> Author: phk Date: 2008-01-29 12:14:22 +0100 (Tue, 29 Jan 2008) New Revision: 2397 Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c Log: Specifically mark return values we do not wish to check. Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_child.c 2008-01-29 10:59:01 UTC (rev 2396) +++ trunk/varnish-cache/bin/varnishd/mgt_child.c 2008-01-29 11:14:22 UTC (rev 2397) @@ -114,7 +114,7 @@ return (1); if (child_pid > 0 && mgt_cli_askchild(NULL, NULL, "ping\n")) { fprintf(stderr, "Child not responding to ping\n"); - kill(child_pid, SIGKILL); + (void)kill(child_pid, SIGKILL); } return (0); } @@ -156,7 +156,7 @@ VTAILQ_FOREACH(ls, &heritage.socks, list) { if (ls->sock < 0) continue; - close(ls->sock); + (void)close(ls->sock); ls->sock = -1; } } @@ -208,8 +208,8 @@ setproctitle("Varnish-Chld %s", heritage.name); - signal(SIGINT, SIG_DFL); - signal(SIGTERM, SIG_DFL); + (void)signal(SIGINT, SIG_DFL); + (void)signal(SIGTERM, SIG_DFL); child_main(); exit(1); @@ -355,7 +355,7 @@ (void)e; (void)what; fprintf(stderr, "Manager got SIGINT\n"); - fflush(stdout); + (void)fflush(stdout); if (child_pid >= 0) stop_child(); exit (2); From phk at projects.linpro.no Tue Jan 29 11:17:37 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 29 Jan 2008 12:17:37 +0100 (CET) Subject: r2398 - trunk/varnish-cache/bin/varnishd Message-ID: <20080129111737.432CF1EC2B5@projects.linpro.no> Author: phk Date: 2008-01-29 12:17:37 +0100 (Tue, 29 Jan 2008) New Revision: 2398 Modified: trunk/varnish-cache/bin/varnishd/heritage.h Log: missing #ifdef HAVE_SENDFILE Modified: trunk/varnish-cache/bin/varnishd/heritage.h =================================================================== --- trunk/varnish-cache/bin/varnishd/heritage.h 2008-01-29 11:14:22 UTC (rev 2397) +++ trunk/varnish-cache/bin/varnishd/heritage.h 2008-01-29 11:17:37 UTC (rev 2398) @@ -98,8 +98,10 @@ /* Fetcher hints */ unsigned fetch_chunksize; +#ifdef HAVE_SENDFILE /* Sendfile object minimum size */ unsigned sendfile_threshold; +#endif /* VCL traces */ unsigned vcl_trace; From phk at projects.linpro.no Tue Jan 29 11:39:27 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 29 Jan 2008 12:39:27 +0100 (CET) Subject: r2399 - trunk/varnish-cache/bin/varnishd Message-ID: <20080129113927.7C5991EC2B5@projects.linpro.no> Author: phk Date: 2008-01-29 12:39:27 +0100 (Tue, 29 Jan 2008) New Revision: 2399 Modified: trunk/varnish-cache/bin/varnishd/flint.lnt trunk/varnish-cache/bin/varnishd/mgt_vcc.c Log: Flexelint inspired polishing Modified: trunk/varnish-cache/bin/varnishd/flint.lnt =================================================================== --- trunk/varnish-cache/bin/varnishd/flint.lnt 2008-01-29 11:17:37 UTC (rev 2398) +++ trunk/varnish-cache/bin/varnishd/flint.lnt 2008-01-29 11:39:27 UTC (rev 2399) @@ -1,4 +1,4 @@ --passes=3 +-passes=8 +libh mgt_event.h +libh ../../config.h Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-29 11:17:37 UTC (rev 2398) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-29 11:39:27 UTC (rev 2399) @@ -234,7 +234,7 @@ of = strdup(sf); XXXAN(of); of[sizeof sf - 2] = 'o'; - vsb_new(&cmdsb, cmdline, sizeof cmdline, 0); + AN(vsb_new(&cmdsb, cmdline, sizeof cmdline, 0)); mgt_make_cc_cmd(&cmdsb, sf, of); vsb_finish(&cmdsb); AZ(vsb_overflowed(&cmdsb)); @@ -243,7 +243,7 @@ if (pipe(p) < 0) { vsb_printf(sb, "%s(): pipe() failed: %s", __func__, strerror(errno)); - unlink(sf); + (void)unlink(sf); free(of); return (NULL); } @@ -262,7 +262,7 @@ assert(open("/dev/null", O_RDONLY) == STDIN_FILENO); assert(dup2(p[1], STDOUT_FILENO) == STDOUT_FILENO); assert(dup2(p[1], STDERR_FILENO) == STDERR_FILENO); - execl("/bin/sh", "/bin/sh", "-c", cmdline, NULL); + (void)execl("/bin/sh", "/bin/sh", "-c", cmdline, NULL); _exit(1); } AZ(close(p[1])); @@ -272,11 +272,11 @@ vsb_printf(sb, "C-Compiler said: %.*s", status, buf); } while (status > 0); AZ(close(p[0])); - unlink(sf); + (void)unlink(sf); if (waitpid(pid, &status, 0) < 0) { vsb_printf(sb, "%s(): waitpid() failed: %s", __func__, strerror(errno)); - unlink(of); + (void)unlink(of); free(of); return (NULL); } @@ -288,7 +288,7 @@ vsb_printf(sb, ", signal %d", WTERMSIG(status)); if (WCOREDUMP(status)) vsb_printf(sb, ", core dumped"); - unlink(of); + (void)unlink(of); free(of); return (NULL); } @@ -298,7 +298,7 @@ vsb_printf(sb, "%s(): failed to load compiled VCL program:\n %s", __func__, dlerror()); - unlink(of); + (void)unlink(of); free(of); return (NULL); } @@ -339,7 +339,7 @@ csrc = VCC_CompileFile(sb, fn, fd); if (csrc != NULL) { if (C_flag) - fputs(csrc, stdout); + (void)fputs(csrc, stdout); vf = mgt_run_cc(csrc, sb); if (C_flag && vf != NULL) AZ(unlink(vf)); @@ -582,12 +582,10 @@ VTAILQ_FOREACH(vp, &vclhead, list) if (!strcmp(vp->name, name)) - break; - if (vp == NULL) { - cli_result(cli, CLIS_PARAM); - cli_out(cli, "No configuration named %s known.", name); - } - return (vp); + return (vp); + cli_result(cli, CLIS_PARAM); + cli_out(cli, "No configuration named %s known.", name); + return (NULL); } void @@ -599,19 +597,21 @@ (void)priv; vp = mcf_find_vcl(cli, av[2]); - if (vp != NULL && vp->active == 0) { - if (child_pid >= 0 && - mgt_cli_askchild(&status, &p, "vcl.use %s\n", av[2])) { - cli_result(cli, status); - cli_out(cli, "%s", p); - } else { - vp->active = 2; - VTAILQ_FOREACH(vp, &vclhead, list) { - if (vp->active == 1) - vp->active = 0; - else if (vp->active == 2) - vp->active = 1; - } + if (vp == NULL) + return; + if (vp->active != 0) + return; + if (child_pid >= 0 && + mgt_cli_askchild(&status, &p, "vcl.use %s\n", av[2])) { + cli_result(cli, status); + cli_out(cli, "%s", p); + } else { + vp->active = 2; + VTAILQ_FOREACH(vp, &vclhead, list) { + if (vp->active == 1) + vp->active = 0; + else if (vp->active == 2) + vp->active = 1; } } free(p); @@ -652,9 +652,10 @@ (void)av; (void)priv; if (child_pid >= 0) { - mgt_cli_askchild(&status, &p, "vcl.list\n"); - cli_result(cli, status); - cli_out(cli, "%s", p); + if (!mgt_cli_askchild(&status, &p, "vcl.list\n")) { + cli_result(cli, status); + cli_out(cli, "%s", p); + } free(p); } else { VTAILQ_FOREACH(vp, &vclhead, list) { From phk at projects.linpro.no Tue Jan 29 11:53:41 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 29 Jan 2008 12:53:41 +0100 (CET) Subject: r2400 - trunk/varnish-cache/bin/varnishd Message-ID: <20080129115341.E31041EC1D1@projects.linpro.no> Author: phk Date: 2008-01-29 12:53:41 +0100 (Tue, 29 Jan 2008) New Revision: 2400 Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c Log: More FlexeLint inspired cleanup Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_cli.c 2008-01-29 11:39:27 UTC (rev 2399) +++ trunk/varnish-cache/bin/varnishd/mgt_cli.c 2008-01-29 11:53:41 UTC (rev 2400) @@ -294,6 +294,24 @@ }; static int +mgt_cli_close(const struct cli_port *cp) +{ + + vsb_delete(cp->cli->sb); + free(cp->buf); + (void)close(cp->fdi); + if (cp->fdi == 0) + assert(open("/dev/null", O_RDONLY) == 0); + (void)close(cp->fdo); + if (cp->fdo == 1) { + assert(open("/dev/null", O_WRONLY) == 1); + (void)close(2); + assert(open("/dev/null", O_WRONLY) == 2); + } + return (1); +} + +static int mgt_cli_callback(const struct ev *e, int what) { struct cli_port *cp; @@ -303,7 +321,7 @@ CAST_OBJ_NOTNULL(cp, e->priv, CLI_PORT_MAGIC); if (what & (EV_ERR | EV_HUP | EV_GONE)) - goto cli_close; + return (mgt_cli_close(cp)); /* grow the buffer if it is full */ if (cp->nbuf == cp->lbuf) { @@ -315,7 +333,7 @@ /* read more data into the buffer */ i = read(cp->fdi, cp->buf + cp->nbuf, cp->lbuf - cp->nbuf); if (i <= 0) - goto cli_close; + return (mgt_cli_close(cp)); cp->nbuf += i; for (p = q = cp->buf; q < cp->buf + cp->nbuf; ++q) { @@ -330,7 +348,7 @@ /* send the result back */ if (cli_writeres(cp->fdo, cp->cli)) - goto cli_close; + return (mgt_cli_close(cp)); /* ready for next command */ p = q + 1; @@ -344,21 +362,6 @@ } else cp->nbuf = 0; return (0); - -cli_close: - vsb_delete(cp->cli->sb); - free(cp->buf); - (void)close(cp->fdi); - if (cp->fdi == 0) - assert(open("/dev/null", O_RDONLY) == 0); - (void)close(cp->fdo); - if (cp->fdo == 1) { - assert(open("/dev/null", O_WRONLY) == 1); - close(2); - assert(open("/dev/null", O_WRONLY) == 2); - } - free(cp); - return (1); } void @@ -389,7 +392,7 @@ cp->ev->fd_flags = EV_RD; cp->ev->callback = mgt_cli_callback; cp->ev->priv = cp; - ev_add(mgt_evb, cp->ev); + AZ(ev_add(mgt_evb, cp->ev)); } static int @@ -417,7 +420,7 @@ int i, n; XXXAZ(VSS_parse(T_arg, &addr, &port)); - XXXAN(n = VSS_resolve(addr, port, &ta)); + n = VSS_resolve(addr, port, &ta); free(addr); free(port); if (n == 0) { @@ -431,7 +434,7 @@ ev->fd = sock; ev->fd_flags = POLLIN; ev->callback = telnet_accept; - ev_add(mgt_evb, ev); + AZ(ev_add(mgt_evb, ev)); free(ta[i]); ta[i] = NULL; } From phk at projects.linpro.no Tue Jan 29 16:05:54 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Tue, 29 Jan 2008 17:05:54 +0100 (CET) Subject: r2401 - trunk/varnish-cache/bin/varnishd Message-ID: <20080129160554.B730F1EC2B5@projects.linpro.no> Author: phk Date: 2008-01-29 17:05:54 +0100 (Tue, 29 Jan 2008) New Revision: 2401 Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c Log: I am not sure if this is a/the race some users are seeing, or if it even can have any effect, but this will close it at a cost of one extra kevent(2) every 100ms timer tick. The (perceived) problem is that we have pending kqueue changes we have not yet told the kernel about, then close a number of expired FD's which might be instantly be recycled by the accept(2) over in the other thread before we tell the kernel about the pending changes. In that case, the kernel has no way of knowing that our changes referred to the previous instance of the fd and not the new one. The solution is to push the changes to the kernel before servicing the timer. Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c 2008-01-29 11:53:41 UTC (rev 2400) +++ trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c 2008-01-29 16:05:54 UTC (rev 2401) @@ -140,33 +140,41 @@ static unsigned nki; static void -vca_kq_sess(struct sess *sp, short arm) +vca_kq_flush(void) { int i; + if (nki == 0) + return; + i = kevent(kq, ki, nki, NULL, 0, NULL); + assert(i <= 0); + if (i < 0) { + /* + * We do not push kevents into the kernel before + * passing the session off to a worker thread, so + * by the time we get around to delete the event + * the fd may be closed and we get an ENOENT back + * once we do flush. + * We can get EBADF the same way if the client closes + * on us. In that case, we get no kevent on that + * socket, but the TAILQ still has it, and it will + * be GC'ed there after the timeout. + */ + assert(errno == ENOENT || errno == EBADF); + } + nki = 0; +} + +static void +vca_kq_sess(struct sess *sp, short arm) +{ + CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); if (sp->fd < 0) return; EV_SET(&ki[nki], sp->fd, EVFILT_READ, arm, 0, 0, sp); - if (++nki == NKEV) { - i = kevent(kq, ki, nki, NULL, 0, NULL); - assert(i <= 0); - if (i < 0) { - /* - * We do not push kevents into the kernel before - * passing the session off to a worker thread, so - * by the time we get around to delete the event - * the fd may be closed and we get an ENOENT back - * once we do flush. - * We can get EBADF the same way if the client closes - * on us. In that case, we get no kevent on that - * socket, but the TAILQ still has it, and it will - * be GC'ed there after the timeout. - */ - assert(errno == ENOENT || errno == EBADF); - } - nki = 0; - } + if (++nki == NKEV) + vca_kq_flush(); } static void @@ -269,6 +277,14 @@ } if (!dotimer) continue; + /* + * Make sure we have no pending changes for the fd's + * we are about to close, in case the accept(2) in the + * other thread creates new fd's betwen our close and + * the kevent(2) at the top of this loop, the kernel + * would not know we meant "the old fd of this number". + */ + vca_kq_flush(); deadline = TIM_real() - params->sess_timeout; for (;;) { sp = VTAILQ_FIRST(&sesshead); From phk at projects.linpro.no Wed Jan 30 09:50:27 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 10:50:27 +0100 (CET) Subject: r2402 - trunk/varnish-cache/bin/varnishd Message-ID: <20080130095027.2C6AC1EC484@projects.linpro.no> Author: phk Date: 2008-01-30 10:50:26 +0100 (Wed, 30 Jan 2008) New Revision: 2402 Modified: trunk/varnish-cache/bin/varnishd/varnishd.c Log: Check various return values (or not) to reduce Flexelint noise. Modified: trunk/varnish-cache/bin/varnishd/varnishd.c =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.c 2008-01-29 16:05:54 UTC (rev 2401) +++ trunk/varnish-cache/bin/varnishd/varnishd.c 2008-01-30 09:50:26 UTC (rev 2402) @@ -231,7 +231,7 @@ DebugSigPass(int sig) { - kill(d_child, sig); + (void)kill(d_child, sig); } static void @@ -280,8 +280,8 @@ pfd[1].fd = pipes[1][0]; pfd[1].events = POLLIN; - signal(SIGPIPE, SIG_IGN); - signal(SIGINT, DebugSigPass); + (void)signal(SIGPIPE, SIG_IGN); + (void)signal(SIGINT, DebugSigPass); i = read(pipes[1][0], buf, sizeof buf - 1); xxxassert(i >= 0); buf[i] = '\0'; @@ -376,7 +376,7 @@ setbuf(stdout, NULL); setbuf(stderr, NULL); - setenv("TZ", "GMT", 1); + AZ(setenv("TZ", "GMT", 1)); tzset(); memset(cli, 0, sizeof cli); @@ -547,18 +547,18 @@ if (d_flag == 1) DebugStunt(); if (d_flag < 2 && !F_flag) - daemon(1, d_flag); + AZ(daemon(1, d_flag)); if (d_flag == 1) printf("%d\n", getpid()); if (pfh != NULL) - vpf_write(pfh); + vpf_write(pfh); /* XXX: Warn or Err if fail ? */ mgt_cli_init(); mgt_run(d_flag, T_arg); if (pfh != NULL) - vpf_remove(pfh); + (void)vpf_remove(pfh); exit(0); } From phk at projects.linpro.no Wed Jan 30 10:01:13 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:01:13 +0100 (CET) Subject: r2403 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080130100113.3AF5B1EC514@projects.linpro.no> Author: phk Date: 2008-01-30 11:01:13 +0100 (Wed, 30 Jan 2008) New Revision: 2403 Modified: trunk/varnish-cache/lib/libvarnish/assert.c Log: Remove unused #include Modified: trunk/varnish-cache/lib/libvarnish/assert.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/assert.c 2008-01-30 09:50:26 UTC (rev 2402) +++ trunk/varnish-cache/lib/libvarnish/assert.c 2008-01-30 10:01:13 UTC (rev 2403) @@ -31,7 +31,6 @@ #include #include -#include #include #include "libvarnish.h" From phk at projects.linpro.no Wed Jan 30 10:02:19 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:02:19 +0100 (CET) Subject: r2404 - in trunk/varnish-cache: include lib/libvarnish Message-ID: <20080130100219.86A071EC484@projects.linpro.no> Author: phk Date: 2008-01-30 11:02:19 +0100 (Wed, 30 Jan 2008) New Revision: 2404 Modified: trunk/varnish-cache/include/binary_heap.h trunk/varnish-cache/lib/libvarnish/binary_heap.c Log: Make sure we get the right assert() macro. Constification. Modified: trunk/varnish-cache/include/binary_heap.h =================================================================== --- trunk/varnish-cache/include/binary_heap.h 2008-01-30 10:01:13 UTC (rev 2403) +++ trunk/varnish-cache/include/binary_heap.h 2008-01-30 10:02:19 UTC (rev 2404) @@ -69,7 +69,7 @@ * The root item has 'idx' zero */ -void *binheap_root(struct binheap *); +void *binheap_root(const struct binheap *); /* * Return the root item */ Modified: trunk/varnish-cache/lib/libvarnish/binary_heap.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/binary_heap.c 2008-01-30 10:01:13 UTC (rev 2403) +++ trunk/varnish-cache/lib/libvarnish/binary_heap.c 2008-01-30 10:02:19 UTC (rev 2404) @@ -36,11 +36,11 @@ * XXX: the array is not scaled back when items are deleted. */ -#include #include #include #include "binary_heap.h" +#include "libvarnish.h" /* Private definitions -----------------------------------------------*/ @@ -66,7 +66,7 @@ /* Implementation ----------------------------------------------------*/ static void -binheap_update(struct binheap *bh, unsigned u) +binheap_update(const struct binheap *bh, unsigned u) { assert(bh->magic == BINHEAP_MAGIC); assert(u < bh->next); @@ -97,7 +97,7 @@ } static void -binhead_swap(struct binheap *bh, unsigned u, unsigned v) +binhead_swap(const struct binheap *bh, unsigned u, unsigned v) { void *p; @@ -112,7 +112,7 @@ } static unsigned -binheap_trickleup(struct binheap *bh, unsigned u) +binheap_trickleup(const struct binheap *bh, unsigned u) { unsigned v; @@ -129,7 +129,7 @@ } static void -binheap_trickledown(struct binheap *bh, unsigned u) +binheap_trickledown(const struct binheap *bh, unsigned u) { unsigned v1, v2; @@ -182,11 +182,11 @@ u = bh->next++; bh->array[u] = p; binheap_update(bh, u); - binheap_trickleup(bh, u); + (void)binheap_trickleup(bh, u); } void * -binheap_root(struct binheap *bh) +binheap_root(const struct binheap *bh) { assert(bh != NULL); From phk at projects.linpro.no Wed Jan 30 10:03:52 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:03:52 +0100 (CET) Subject: r2405 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080130100352.120CC1EC484@projects.linpro.no> Author: phk Date: 2008-01-30 11:03:51 +0100 (Wed, 30 Jan 2008) New Revision: 2405 Modified: trunk/varnish-cache/lib/libvarnish/cli.c Log: Assert non-NULL pointer return. Modified: trunk/varnish-cache/lib/libvarnish/cli.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/cli.c 2008-01-30 10:02:19 UTC (rev 2404) +++ trunk/varnish-cache/lib/libvarnish/cli.c 2008-01-30 10:03:51 UTC (rev 2405) @@ -75,6 +75,7 @@ cli_result(cli, CLIS_OK); /* XXX: syslog commands */ av = ParseArgv(line, 0); + AN(av); do { if (av[0] != NULL) { cli_out(cli, "Syntax Error: %s\n", av[0]); From phk at projects.linpro.no Wed Jan 30 10:08:42 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:08:42 +0100 (CET) Subject: r2406 - in trunk/varnish-cache: include lib/libvarnish Message-ID: <20080130100842.408D01EC403@projects.linpro.no> Author: phk Date: 2008-01-30 11:08:42 +0100 (Wed, 30 Jan 2008) New Revision: 2406 Modified: trunk/varnish-cache/include/cli_common.h trunk/varnish-cache/include/cli_priv.h trunk/varnish-cache/lib/libvarnish/cli_common.c Log: Flexelint silencing: constification, mark ignored returnvalues etc. Modified: trunk/varnish-cache/include/cli_common.h =================================================================== --- trunk/varnish-cache/include/cli_common.h 2008-01-30 10:03:51 UTC (rev 2405) +++ trunk/varnish-cache/include/cli_common.h 2008-01-30 10:08:42 UTC (rev 2406) @@ -34,7 +34,7 @@ enum cli_status_e result; }; -int cli_writeres(int fd, struct cli *cli); +int cli_writeres(int fd, const struct cli *cli); int cli_readres(int fd, unsigned *status, char **ptr, double tmo); extern struct cli_proto CLI_cmds[]; Modified: trunk/varnish-cache/include/cli_priv.h =================================================================== --- trunk/varnish-cache/include/cli_priv.h 2008-01-30 10:03:51 UTC (rev 2405) +++ trunk/varnish-cache/include/cli_priv.h 2008-01-30 10:08:42 UTC (rev 2406) @@ -53,7 +53,7 @@ }; /* The implementation must provide these functions */ -void cli_out(struct cli *cli, const char *fmt, ...); +void cli_out(const struct cli *cli, const char *fmt, ...); void cli_param(struct cli *cli); void cli_result(struct cli *cli, unsigned r); Modified: trunk/varnish-cache/lib/libvarnish/cli_common.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/cli_common.c 2008-01-30 10:03:51 UTC (rev 2405) +++ trunk/varnish-cache/lib/libvarnish/cli_common.c 2008-01-30 10:08:42 UTC (rev 2406) @@ -32,7 +32,6 @@ #include #include -#include #include #include #include @@ -47,20 +46,22 @@ #include "vsb.h" +#include "libvarnish.h" + #include "cli.h" #include "cli_priv.h" #include "cli_common.h" void -cli_out(struct cli *cli, const char *fmt, ...) +cli_out(const struct cli *cli, const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (cli != NULL) - vsb_vprintf(cli->sb, fmt, ap); + (void)vsb_vprintf(cli->sb, fmt, ap); else - vfprintf(stdout, fmt, ap); + (void)vfprintf(stdout, fmt, ap); va_end(ap); } @@ -84,7 +85,7 @@ } int -cli_writeres(int fd, struct cli *cli) +cli_writeres(int fd, const struct cli *cli) { int i, l; struct iovec iov[3]; From phk at projects.linpro.no Wed Jan 30 10:12:59 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:12:59 +0100 (CET) Subject: r2407 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080130101259.06A181EC475@projects.linpro.no> Author: phk Date: 2008-01-30 11:12:58 +0100 (Wed, 30 Jan 2008) New Revision: 2407 Modified: trunk/varnish-cache/lib/libvarnish/flopen.c Log: Flexelint silencing Modified: trunk/varnish-cache/lib/libvarnish/flopen.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/flopen.c 2008-01-30 10:08:42 UTC (rev 2406) +++ trunk/varnish-cache/lib/libvarnish/flopen.c 2008-01-30 10:12:58 UTC (rev 2407) @@ -56,7 +56,7 @@ va_list ap; va_start(ap, flags); - mode = va_arg(ap, int); /* mode_t promoted to int */ + mode = (mode_t)va_arg(ap, int); /* mode_t promoted to int */ va_end(ap); } @@ -76,32 +76,32 @@ if (fcntl(fd, operation, &lock) == -1) { /* unsupported or interrupted */ serrno = errno; - close(fd); + (void)close(fd); errno = serrno; return (-1); } if (stat(path, &sb) == -1) { /* disappeared from under our feet */ - close(fd); + (void)close(fd); continue; } if (fstat(fd, &fsb) == -1) { /* can't happen [tm] */ serrno = errno; - close(fd); + (void)close(fd); errno = serrno; return (-1); } if (sb.st_dev != fsb.st_dev || sb.st_ino != fsb.st_ino) { /* changed under our feet */ - close(fd); + (void)close(fd); continue; } if (trunc && ftruncate(fd, 0) != 0) { /* can't happen [tm] */ serrno = errno; - close(fd); + (void)close(fd); errno = serrno; return (-1); } From phk at projects.linpro.no Wed Jan 30 10:15:07 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:15:07 +0100 (CET) Subject: r2408 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080130101507.5E84B1EC484@projects.linpro.no> Author: phk Date: 2008-01-30 11:15:07 +0100 (Wed, 30 Jan 2008) New Revision: 2408 Modified: trunk/varnish-cache/lib/libvarnish/time.c Log: Silence Flexelint Modified: trunk/varnish-cache/lib/libvarnish/time.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/time.c 2008-01-30 10:12:58 UTC (rev 2407) +++ trunk/varnish-cache/lib/libvarnish/time.c 2008-01-30 10:15:07 UTC (rev 2408) @@ -93,8 +93,8 @@ time_t tt; tt = (time_t) t; - gmtime_r(&tt, &tm); - strftime(p, 30, "%a, %d %b %Y %T GMT", &tm); + (void)gmtime_r(&tt, &tm); + AN(strftime(p, 30, "%a, %d %b %Y %T GMT", &tm)); } /* XXX: add statistics ? */ From phk at projects.linpro.no Wed Jan 30 10:20:54 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:20:54 +0100 (CET) Subject: r2409 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080130102054.526411EC475@projects.linpro.no> Author: phk Date: 2008-01-30 11:20:54 +0100 (Wed, 30 Jan 2008) New Revision: 2409 Modified: trunk/varnish-cache/lib/libvarnish/vpf.c Log: Silence FlexeLint: ignore returns, a constification and a couple of asserts. Modified: trunk/varnish-cache/lib/libvarnish/vpf.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vpf.c 2008-01-30 10:15:07 UTC (rev 2408) +++ trunk/varnish-cache/lib/libvarnish/vpf.c 2008-01-30 10:20:54 UTC (rev 2409) @@ -43,6 +43,7 @@ #include "compat/strlcpy.h" #endif +#include "libvarnish.h" /* XXX: for assert() */ #include "flopen.h" #include "vpf.h" @@ -56,7 +57,7 @@ static int _vpf_remove(struct pidfh *pfh, int freeit); static int -vpf_verify(struct pidfh *pfh) +vpf_verify(const struct pidfh *pfh) { struct stat sb; @@ -84,7 +85,7 @@ i = read(fd, buf, sizeof(buf) - 1); error = errno; /* Remember errno in case close() wants to change it. */ - close(fd); + (void)close(fd); if (i == -1) return (error); buf[i] = '\0'; @@ -113,8 +114,11 @@ "/var/run/%s.pid", getprogname()); else #endif + { + assert(path != NULL); len = snprintf(pfh->pf_path, sizeof(pfh->pf_path), "%s", path); + } if (len >= (int)sizeof(pfh->pf_path)) { free(pfh); errno = ENAMETOOLONG; @@ -144,8 +148,8 @@ */ if (fstat(fd, &sb) == -1) { error = errno; - unlink(pfh->pf_path); - close(fd); + (void)unlink(pfh->pf_path); + (void)close(fd); free(pfh); errno = error; return (NULL); @@ -182,15 +186,16 @@ */ if (ftruncate(fd, 0) == -1) { error = errno; - _vpf_remove(pfh, 0); + (void)_vpf_remove(pfh, 0); errno = error; return (-1); } - snprintf(pidstr, sizeof(pidstr), "%u", getpid()); + error = snprintf(pidstr, sizeof(pidstr), "%u", getpid()); + assert(error < sizeof pidstr); if (pwrite(fd, pidstr, strlen(pidstr), 0) != (ssize_t)strlen(pidstr)) { error = errno; - _vpf_remove(pfh, 0); + (void)_vpf_remove(pfh, 0); errno = error; return (-1); } From phk at projects.linpro.no Wed Jan 30 10:24:54 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:24:54 +0100 (CET) Subject: r2410 - in trunk/varnish-cache: include lib/libvarnish Message-ID: <20080130102454.3AD9E1EC475@projects.linpro.no> Author: phk Date: 2008-01-30 11:24:54 +0100 (Wed, 30 Jan 2008) New Revision: 2410 Modified: trunk/varnish-cache/include/vsb.h trunk/varnish-cache/lib/libvarnish/vsb.c Log: Flexelint silencing: a (), a couple of const and cast. Modified: trunk/varnish-cache/include/vsb.h =================================================================== --- trunk/varnish-cache/include/vsb.h 2008-01-30 10:20:54 UTC (rev 2409) +++ trunk/varnish-cache/include/vsb.h 2008-01-30 10:24:54 UTC (rev 2410) @@ -69,11 +69,11 @@ #endif int vsb_putc(struct vsb *, int); int vsb_trim(struct vsb *); -int vsb_overflowed(struct vsb *); +int vsb_overflowed(const struct vsb *); void vsb_finish(struct vsb *); char *vsb_data(struct vsb *); int vsb_len(struct vsb *); -int vsb_done(struct vsb *); +int vsb_done(const struct vsb *); void vsb_delete(struct vsb *); #ifdef __cplusplus }; Modified: trunk/varnish-cache/lib/libvarnish/vsb.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vsb.c 2008-01-30 10:20:54 UTC (rev 2409) +++ trunk/varnish-cache/lib/libvarnish/vsb.c 2008-01-30 10:24:54 UTC (rev 2410) @@ -51,7 +51,7 @@ #define VSB_ISFINISHED(s) ((s)->s_flags & VSB_FINISHED) #define VSB_HASOVERFLOWED(s) ((s)->s_flags & VSB_OVERFLOWED) #define VSB_HASROOM(s) ((s)->s_len < (s)->s_size - 1) -#define VSB_FREESPACE(s) ((s)->s_size - (s)->s_len - 1) +#define VSB_FREESPACE(s) ((s)->s_size - ((s)->s_len + 1)) #define VSB_CANEXTEND(s) ((s)->s_flags & VSB_AUTOEXTEND) /* @@ -373,7 +373,7 @@ return (-1); } if (c != '\0') - s->s_buf[s->s_len++] = c; + s->s_buf[s->s_len++] = (char)c; return (0); } @@ -399,7 +399,7 @@ * Check if an vsb overflowed */ int -vsb_overflowed(struct vsb *s) +vsb_overflowed(const struct vsb *s) { return VSB_HASOVERFLOWED(s); } @@ -467,7 +467,7 @@ * Check if an vsb has been finished. */ int -vsb_done(struct vsb *s) +vsb_done(const struct vsb *s) { return(VSB_ISFINISHED(s)); From phk at projects.linpro.no Wed Jan 30 10:30:39 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:30:39 +0100 (CET) Subject: r2411 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080130103039.97FF71EC403@projects.linpro.no> Author: phk Date: 2008-01-30 11:30:39 +0100 (Wed, 30 Jan 2008) New Revision: 2411 Modified: trunk/varnish-cache/lib/libvarnish/vss.c Log: Silence FlexeLint: use a union for sockaddr sizing, mark ignored returns. Modified: trunk/varnish-cache/lib/libvarnish/vss.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vss.c 2008-01-30 10:24:54 UTC (rev 2410) +++ trunk/varnish-cache/lib/libvarnish/vss.c 2008-01-30 10:30:39 UTC (rev 2411) @@ -58,7 +58,10 @@ int va_socktype; int va_protocol; socklen_t va_addrlen; - struct sockaddr_storage va_addr; + union { + struct sockaddr_storage _storage; + struct sockaddr sa; + } va_addr; }; /* @@ -179,7 +182,7 @@ val = 1; if (setsockopt(sd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof val) != 0) { perror("setsockopt(SO_REUSEADDR, 1)"); - close(sd); + (void)close(sd); return (-1); } #ifdef IPV6_V6ONLY @@ -188,18 +191,18 @@ if (va->va_family == AF_INET6 && setsockopt(sd, IPPROTO_IPV6, IPV6_V6ONLY, &val, sizeof val) != 0) { perror("setsockopt(IPV6_V6ONLY, 1)"); - close(sd); + (void)close(sd); return (-1); } #endif - if (bind(sd, (const struct sockaddr *)&va->va_addr, va->va_addrlen) != 0) { + if (bind(sd, &va->va_addr.sa, va->va_addrlen) != 0) { perror("bind()"); - close(sd); + (void)close(sd); return (-1); } if (listen(sd, depth) != 0) { perror("listen()"); - close(sd); + (void)close(sd); return (-1); } return (sd); @@ -219,9 +222,9 @@ perror("socket()"); return (-1); } - if (connect(sd, (const struct sockaddr *)&va->va_addr, va->va_addrlen) != 0) { + if (connect(sd, &va->va_addr.sa, va->va_addrlen) != 0) { perror("connect()"); - close(sd); + (void)close(sd); return (-1); } return (sd); From phk at projects.linpro.no Wed Jan 30 10:32:52 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:32:52 +0100 (CET) Subject: r2412 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080130103252.9B0AA1EC484@projects.linpro.no> Author: phk Date: 2008-01-30 11:32:52 +0100 (Wed, 30 Jan 2008) New Revision: 2412 Modified: trunk/varnish-cache/lib/libvarnish/vtmpfile.c Log: Silence FlexeLint Modified: trunk/varnish-cache/lib/libvarnish/vtmpfile.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vtmpfile.c 2008-01-30 10:30:39 UTC (rev 2411) +++ trunk/varnish-cache/lib/libvarnish/vtmpfile.c 2008-01-30 10:32:52 UTC (rev 2412) @@ -40,7 +40,8 @@ vtmpfile(char *template) { char *b, *e, *p; - int fd, ran; + int fd; + char ran; for (b = template; *b != '#'; ++b) /* nothing */ ; From phk at projects.linpro.no Wed Jan 30 10:33:17 2008 From: phk at projects.linpro.no (phk at projects.linpro.no) Date: Wed, 30 Jan 2008 11:33:17 +0100 (CET) Subject: r2413 - trunk/varnish-cache/lib/libvarnish Message-ID: <20080130103317.A70451EC403@projects.linpro.no> Author: phk Date: 2008-01-30 11:33:17 +0100 (Wed, 30 Jan 2008) New Revision: 2413 Added: trunk/varnish-cache/lib/libvarnish/flint.lnt trunk/varnish-cache/lib/libvarnish/flint.sh Log: Add flexelint files Added: trunk/varnish-cache/lib/libvarnish/flint.lnt =================================================================== --- trunk/varnish-cache/lib/libvarnish/flint.lnt (rev 0) +++ trunk/varnish-cache/lib/libvarnish/flint.lnt 2008-01-30 10:33:17 UTC (rev 2413) @@ -0,0 +1,90 @@ +-passes=8 + ++libh mgt_event.h ++libh ../../config.h + +-emacro((???),va_arg) // the va_arg() macro can yield 415, 416, 661, 662 + // 796 and 797 (out-of-bounds errors). +-elib(123) // size is both a variable and a macro with args +-emacro(736, isnan) // isnanf + + +-header(../../config.h) + +// Fix strchr() semtics, it can only return NULL if arg2 != 0 +-sem(strchr, 1p, type(1), 2n == 0 ? (@p < 1p) : (@p < 1p || @p == 0 )) + +-sem(lbv_assert, r_no) +-sem(lbv_xxxassert, r_no) +-sem(WS_Init, custodial(2)) +-sem(http_Setup, custodial(2)) + +-ffc // No automatic custody + +-e763 // Redundant declaration for symbol '...' previously declared +-e726 // Extraneous comma ignored +-e728 // Symbol ... not explicitly initialized +-e716 // while(1) ... +-e785 // Too few initializers for aggregate +-e786 // String concatenation within initializer + +-emacro(740, VTAILQ_PREV) // Unusual pointer cast (incompatible indirect types) +-emacro(740, VTAILQ_LAST) // Unusual pointer cast (incompatible indirect types) +-emacro((826), VTAILQ_PREV) // Suspicious pointer-to-pointer conversion (area too small) +-emacro((826), VTAILQ_LAST) // Suspicious pointer-to-pointer conversion (area too small) +-emacro(506, VTAILQ_FOREACH_SAFE) // constant value boolean + +-esym(534, sprintf) // Ignoring return value of function +-esym(534, asprintf) // Ignoring return value of function +-esym(534, printf) // Ignoring return value of function +-esym(534, fprintf) // Ignoring return value of function +-esym(534, memset) // Ignoring return value of function +-esym(534, memcpy) // Ignoring return value of function +-esym(534, memmove) // Ignoring return value of function +-esym(534, strcpy) // Ignoring return value of function +-esym(534, vsb_printf) // Ignoring return value of function +-esym(534, vsb_cat) // Ignoring return value of function +-esym(534, vsb_bcat) // Ignoring return value of function +-esym(534, vsb_putc) // Ignoring return value of function +-esym(534, strcat) // Ignoring return value of function +-esym(534, strcpy) // Ignoring return value of function +-esym(534, strlcpy) // Ignoring return value of function + +-emacro(506, isnan) // constant value boolean +-emacro(747, isnan) // significant coersion +-emacro(506, assert) // constant value boolean +-emacro(774, HTTPH) // always false + +// cache.h +-emacro(506, INCOMPL) // Constant value Boolean + +// cache_center.c +-efunc(525, CNT_Session) // Negative indentation from line +-efunc(525, http_FilterFields) // Negative indentation from line +-efunc(539, http_FilterFields) // Positive indentation from line + +// cache_vcl.c +-efunc(525, vcl_handlingname) // Negative indentation from line +-esym(528, vcl_handlingname) // Not referenced +-e641 // Converting enum 'cli_status_e' to int + +// Review all below this line /////////////////////////////////////////////// + +-e732 // Loss of sign (arg. no. 2) (int to unsigned +-e737 // [45] Loss of sign in promotion from int to unsigned +-e713 // Loss of precision (assignment) (unsigned long long to long long) +-e574 // Signed-unsigned mix with relational +-e712 // Loss of precision (assignment) (long long to +-e747 // Significant prototype coercion (arg. no. 2) long + +/* + +-e767 // Macro redef (system queue.h vs ours ) + +-e506 // Constant value boolean +-e818 // Pointer parameter '...' could be declared as pointing to const +-e774 // Boolean within 'if' always evaluates to False +-e534 // Ignoring return value of function +-e557 // unrecog format + +*/ Added: trunk/varnish-cache/lib/libvarnish/flint.sh =================================================================== --- trunk/varnish-cache/lib/libvarnish/flint.sh (rev 0) +++ trunk/varnish-cache/lib/libvarnish/flint.sh 2008-01-30 10:33:17 UTC (rev 2413) @@ -0,0 +1,29 @@ +#!/bin/sh + +T=/tmp/_$$ +flexelint \ + -I/usr/include \ + -I. \ + -I../../include \ + flint.lnt \ + *.c > $T 2>&1 + +for t in Error Warning Info +do + sed -n "/$t [0-9][0-9][0-9]:/s/.*\($t [0-9][0-9][0-9]\).*/\1/p" $T +done | awk ' +$2 == 830 { next } +$2 == 831 { next } + { + i=$2"_"$1 + h[i]++ + n++ + } +END { + printf "%5d %s\n", n, "Total" + for (i in h) + printf "%5d %s\n", h[i], i + } +' | sort -rn + +cat $T Property changes on: trunk/varnish-cache/lib/libvarnish/flint.sh ___________________________________________________________________ Name: svn:executable + * From des at projects.linpro.no Thu Jan 31 11:41:33 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Thu, 31 Jan 2008 12:41:33 +0100 (CET) Subject: r2414 - trunk/varnish-cache/bin/varnishadm Message-ID: <20080131114133.3F5D61EC475@projects.linpro.no> Author: des Date: 2008-01-31 12:41:32 +0100 (Thu, 31 Jan 2008) New Revision: 2414 Modified: trunk/varnish-cache/bin/varnishadm/varnishadm.1 Log: Mention that varnishd(1) has a list of commands and parameters, and also how to obtain them from varnishd itself. Modified: trunk/varnish-cache/bin/varnishadm/varnishadm.1 =================================================================== --- trunk/varnish-cache/bin/varnishadm/varnishadm.1 2008-01-30 10:33:17 UTC (rev 2413) +++ trunk/varnish-cache/bin/varnishadm/varnishadm.1 2008-01-31 11:41:32 UTC (rev 2414) @@ -28,7 +28,7 @@ .\" .\" $Id$ .\" -.Dd September 12, 2007 +.Dd January 31, 2008 .Dt VARNISHADM 1 .Os .Sh NAME @@ -50,6 +50,15 @@ .It Fl T Ar address Ns : Ns Ar port Connect to the management interface at the specified address and port. .El +.Pp +Available commands and parameters are documented in the +.Xr varnishd 1 +manual page. +Additionally, a summary of commands can be obtained by issuing the +.Cm help +command, and a summary of parameters can be obtained by issuing the +.Cm param.show +command. .Sh EXIT STATUS The exit status of the .Nm From des at projects.linpro.no Thu Jan 31 11:57:51 2008 From: des at projects.linpro.no (des at projects.linpro.no) Date: Thu, 31 Jan 2008 12:57:51 +0100 (CET) Subject: r2415 - in trunk: varnish-cache varnish-cache/bin/varnishadm varnish-cache/bin/varnishd varnish-cache/bin/varnishhist varnish-cache/bin/varnishlog varnish-cache/bin/varnishncsa varnish-cache/bin/varnishreplay varnish-cache/bin/varnishstat varnish-cache/bin/varnishtop varnish-cache/include varnish-cache/include/compat varnish-cache/lib/libvarnish varnish-cache/lib/libvarnishapi varnish-cache/lib/libvarnishcompat varnish-cache/lib/libvcl varnish-cache/man varnish-tools/autobuild varnish-tools/fetcher varnish-tools/munin varnish-tools/nagios varnish-tools/regress/lib/Varnish varnish-tools/regress/lib/Varnish/Test varnish-tools/regress/lib/Varnish/Test/Case varnish-tools/regress/lib/Varnish/Test/Report varnish-tools/regress/lib/Varnish/Test/Server Message-ID: <20080131115751.D283A1ECDEC@projects.linpro.no> Author: des Date: 2008-01-31 12:57:51 +0100 (Thu, 31 Jan 2008) New Revision: 2415 Modified: trunk/varnish-cache/LICENSE trunk/varnish-cache/bin/varnishadm/varnishadm.1 trunk/varnish-cache/bin/varnishadm/varnishadm.c trunk/varnish-cache/bin/varnishd/cache.h trunk/varnish-cache/bin/varnishd/cache_acceptor.c trunk/varnish-cache/bin/varnishd/cache_acceptor.h trunk/varnish-cache/bin/varnishd/cache_acceptor_epoll.c trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c trunk/varnish-cache/bin/varnishd/cache_acceptor_poll.c trunk/varnish-cache/bin/varnishd/cache_backend.c trunk/varnish-cache/bin/varnishd/cache_backend_random.c trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c trunk/varnish-cache/bin/varnishd/cache_backend_simple.c trunk/varnish-cache/bin/varnishd/cache_ban.c trunk/varnish-cache/bin/varnishd/cache_center.c trunk/varnish-cache/bin/varnishd/cache_cli.c trunk/varnish-cache/bin/varnishd/cache_expire.c trunk/varnish-cache/bin/varnishd/cache_fetch.c trunk/varnish-cache/bin/varnishd/cache_hash.c trunk/varnish-cache/bin/varnishd/cache_http.c trunk/varnish-cache/bin/varnishd/cache_httpconn.c trunk/varnish-cache/bin/varnishd/cache_main.c trunk/varnish-cache/bin/varnishd/cache_panic.c trunk/varnish-cache/bin/varnishd/cache_pipe.c trunk/varnish-cache/bin/varnishd/cache_pool.c trunk/varnish-cache/bin/varnishd/cache_response.c trunk/varnish-cache/bin/varnishd/cache_session.c trunk/varnish-cache/bin/varnishd/cache_synthetic.c trunk/varnish-cache/bin/varnishd/cache_vary.c trunk/varnish-cache/bin/varnishd/cache_vcl.c trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/bin/varnishd/cache_vrt_acl.c trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c trunk/varnish-cache/bin/varnishd/cache_vrt_re.c trunk/varnish-cache/bin/varnishd/cache_ws.c trunk/varnish-cache/bin/varnishd/common.h trunk/varnish-cache/bin/varnishd/hash_classic.c trunk/varnish-cache/bin/varnishd/hash_simple_list.c trunk/varnish-cache/bin/varnishd/hash_slinger.h trunk/varnish-cache/bin/varnishd/heritage.h trunk/varnish-cache/bin/varnishd/mgt.h trunk/varnish-cache/bin/varnishd/mgt_child.c trunk/varnish-cache/bin/varnishd/mgt_cli.c trunk/varnish-cache/bin/varnishd/mgt_cli.h trunk/varnish-cache/bin/varnishd/mgt_event.c trunk/varnish-cache/bin/varnishd/mgt_event.h trunk/varnish-cache/bin/varnishd/mgt_param.c trunk/varnish-cache/bin/varnishd/mgt_vcc.c trunk/varnish-cache/bin/varnishd/rfc2616.c trunk/varnish-cache/bin/varnishd/shmlog.c trunk/varnish-cache/bin/varnishd/steps.h trunk/varnish-cache/bin/varnishd/stevedore.c trunk/varnish-cache/bin/varnishd/stevedore.h trunk/varnish-cache/bin/varnishd/storage_file.c trunk/varnish-cache/bin/varnishd/storage_malloc.c trunk/varnish-cache/bin/varnishd/tcp.c trunk/varnish-cache/bin/varnishd/varnishd.1 trunk/varnish-cache/bin/varnishd/varnishd.c trunk/varnish-cache/bin/varnishhist/varnishhist.1 trunk/varnish-cache/bin/varnishhist/varnishhist.c trunk/varnish-cache/bin/varnishlog/varnishlog.1 trunk/varnish-cache/bin/varnishlog/varnishlog.c trunk/varnish-cache/bin/varnishncsa/varnishncsa.1 trunk/varnish-cache/bin/varnishncsa/varnishncsa.c trunk/varnish-cache/bin/varnishreplay/varnishreplay.1 trunk/varnish-cache/bin/varnishstat/varnishstat.1 trunk/varnish-cache/bin/varnishstat/varnishstat.c trunk/varnish-cache/bin/varnishtop/varnishtop.1 trunk/varnish-cache/bin/varnishtop/varnishtop.c trunk/varnish-cache/configure.ac trunk/varnish-cache/include/binary_heap.h trunk/varnish-cache/include/cli.h trunk/varnish-cache/include/cli_common.h trunk/varnish-cache/include/cli_priv.h trunk/varnish-cache/include/compat/asprintf.h trunk/varnish-cache/include/compat/daemon.h trunk/varnish-cache/include/compat/setproctitle.h trunk/varnish-cache/include/compat/srandomdev.h trunk/varnish-cache/include/compat/strlcat.h trunk/varnish-cache/include/compat/strlcpy.h trunk/varnish-cache/include/compat/strndup.h trunk/varnish-cache/include/compat/vasprintf.h trunk/varnish-cache/include/http_headers.h trunk/varnish-cache/include/libvarnish.h trunk/varnish-cache/include/libvcl.h trunk/varnish-cache/include/shmlog.h trunk/varnish-cache/include/shmlog_tags.h trunk/varnish-cache/include/stat_field.h trunk/varnish-cache/include/stats.h trunk/varnish-cache/include/varnishapi.h trunk/varnish-cache/include/vrt.h trunk/varnish-cache/include/vss.h trunk/varnish-cache/lib/libvarnish/argv.c trunk/varnish-cache/lib/libvarnish/assert.c trunk/varnish-cache/lib/libvarnish/binary_heap.c trunk/varnish-cache/lib/libvarnish/cli.c trunk/varnish-cache/lib/libvarnish/cli_common.c trunk/varnish-cache/lib/libvarnish/crc32.c trunk/varnish-cache/lib/libvarnish/flopen.c trunk/varnish-cache/lib/libvarnish/time.c trunk/varnish-cache/lib/libvarnish/version.c trunk/varnish-cache/lib/libvarnish/vss.c trunk/varnish-cache/lib/libvarnish/vtmpfile.c trunk/varnish-cache/lib/libvarnishapi/instance.c trunk/varnish-cache/lib/libvarnishapi/shmlog.c trunk/varnish-cache/lib/libvarnishcompat/asprintf.c trunk/varnish-cache/lib/libvarnishcompat/setproctitle.c trunk/varnish-cache/lib/libvarnishcompat/srandomdev.c trunk/varnish-cache/lib/libvarnishcompat/strndup.c trunk/varnish-cache/lib/libvarnishcompat/vasprintf.c trunk/varnish-cache/lib/libvcl/vcc_acl.c trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_backend.c trunk/varnish-cache/lib/libvcl/vcc_compile.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_priv.h trunk/varnish-cache/lib/libvcl/vcc_string.c trunk/varnish-cache/lib/libvcl/vcc_token.c trunk/varnish-cache/lib/libvcl/vcc_var.c trunk/varnish-cache/lib/libvcl/vcc_xref.c trunk/varnish-cache/man/vcl.7 trunk/varnish-tools/autobuild/autobuild.sh trunk/varnish-tools/autobuild/mksummary.pl trunk/varnish-tools/fetcher/fetcher.pl trunk/varnish-tools/munin/configure.ac trunk/varnish-tools/munin/varnish_munin_plugin.pl trunk/varnish-tools/nagios/LICENSE trunk/varnish-tools/nagios/check_varnish.c trunk/varnish-tools/nagios/configure.ac trunk/varnish-tools/regress/lib/Varnish/Test.pm trunk/varnish-tools/regress/lib/Varnish/Test/Case.pm trunk/varnish-tools/regress/lib/Varnish/Test/Case/LRU.pm trunk/varnish-tools/regress/lib/Varnish/Test/Case/POST.pm trunk/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm trunk/varnish-tools/regress/lib/Varnish/Test/Case/RePurge.pm trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket056.pm trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket102.pm trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket128.pm trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket164.pm trunk/varnish-tools/regress/lib/Varnish/Test/Case/Vary.pm trunk/varnish-tools/regress/lib/Varnish/Test/Client.pm trunk/varnish-tools/regress/lib/Varnish/Test/Engine.pm trunk/varnish-tools/regress/lib/Varnish/Test/Report.pm trunk/varnish-tools/regress/lib/Varnish/Test/Report/HTML.pm trunk/varnish-tools/regress/lib/Varnish/Test/Server.pm trunk/varnish-tools/regress/lib/Varnish/Test/Server/Connection.pm trunk/varnish-tools/regress/lib/Varnish/Test/Varnish.pm Log: Update copyright; also convert a couple of files from ISO-8859-1 to UTF-8. Modified: trunk/varnish-cache/LICENSE =================================================================== --- trunk/varnish-cache/LICENSE 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/LICENSE 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,5 +1,5 @@ Copyright (c) 2006 Verdens Gang AS -Copyright (c) 2006-2007 Linpro AS +Copyright (c) 2006-2008 Linpro AS All rights reserved. Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-cache/bin/varnishadm/varnishadm.1 =================================================================== --- trunk/varnish-cache/bin/varnishadm/varnishadm.1 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishadm/varnishadm.1 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2007 Linpro AS +.\" Copyright (c) 2006-2008 Linpro AS .\" All rights reserved. .\" .\" Author: Cecilie Fritzvold Modified: trunk/varnish-cache/bin/varnishadm/varnishadm.c =================================================================== --- trunk/varnish-cache/bin/varnishadm/varnishadm.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishadm/varnishadm.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Cecilie Fritzvold Modified: trunk/varnish-cache/bin/varnishd/cache.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.h =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_acceptor.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_acceptor.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_epoll.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_acceptor_epoll.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_acceptor_epoll.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_acceptor_kqueue.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor_poll.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_acceptor_poll.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_acceptor_poll.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_backend.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_backend_random.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend_random.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_backend_random.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Cecilie Fritzvold Modified: trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_backend_round_robin.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Cecilie Fritzvold Modified: trunk/varnish-cache/bin/varnishd/cache_backend_simple.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_backend_simple.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_backend_simple.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_ban.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_ban.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_ban.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_center.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_center.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_cli.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_cli.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_cli.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_expire.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_fetch.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_fetch.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_http.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_http.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_httpconn.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_httpconn.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_httpconn.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_main.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_main.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_main.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_panic.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_panic.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_panic.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/bin/varnishd/cache_pipe.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_pipe.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_pipe.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_pool.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_pool.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_response.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_response.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_response.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_session.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_session.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_session.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_synthetic.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_synthetic.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_synthetic.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 Linpro AS + * Copyright (c) 2007-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/bin/varnishd/cache_vary.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vary.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_vary.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_vcl.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vcl.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_vcl.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_acl.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt_acl.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_vrt_acl.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_re.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt_re.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_vrt_re.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/cache_ws.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_ws.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/cache_ws.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/common.h =================================================================== --- trunk/varnish-cache/bin/varnishd/common.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/common.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/hash_classic.c =================================================================== --- trunk/varnish-cache/bin/varnishd/hash_classic.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/hash_classic.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/hash_simple_list.c =================================================================== --- trunk/varnish-cache/bin/varnishd/hash_simple_list.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/hash_simple_list.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/hash_slinger.h =================================================================== --- trunk/varnish-cache/bin/varnishd/hash_slinger.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/hash_slinger.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/heritage.h =================================================================== --- trunk/varnish-cache/bin/varnishd/heritage.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/heritage.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/mgt.h =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/mgt.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_child.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/mgt_child.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_cli.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/mgt_cli.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/mgt_cli.h =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_cli.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/mgt_cli.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/mgt_event.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_event.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/mgt_event.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/mgt_event.h =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_event.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/mgt_event.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_param.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/rfc2616.c =================================================================== --- trunk/varnish-cache/bin/varnishd/rfc2616.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/rfc2616.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/shmlog.c =================================================================== --- trunk/varnish-cache/bin/varnishd/shmlog.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/shmlog.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/steps.h =================================================================== --- trunk/varnish-cache/bin/varnishd/steps.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/steps.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/stevedore.c =================================================================== --- trunk/varnish-cache/bin/varnishd/stevedore.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/stevedore.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 Linpro AS + * Copyright (c) 2007-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm?rgav Modified: trunk/varnish-cache/bin/varnishd/stevedore.h =================================================================== --- trunk/varnish-cache/bin/varnishd/stevedore.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/stevedore.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/storage_file.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_file.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/storage_file.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/storage_malloc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/storage_malloc.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/storage_malloc.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/tcp.c =================================================================== --- trunk/varnish-cache/bin/varnishd/tcp.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/tcp.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishd/varnishd.1 =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.1 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/varnishd.1 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2007 Linpro AS +.\" Copyright (c) 2006-2008 Linpro AS .\" All rights reserved. .\" .\" Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/bin/varnishd/varnishd.c =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishd/varnishd.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishhist/varnishhist.1 =================================================================== --- trunk/varnish-cache/bin/varnishhist/varnishhist.1 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishhist/varnishhist.1 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2007 Linpro AS +.\" Copyright (c) 2006-2008 Linpro AS .\" All rights reserved. .\" .\" Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/bin/varnishhist/varnishhist.c =================================================================== --- trunk/varnish-cache/bin/varnishhist/varnishhist.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishhist/varnishhist.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishlog/varnishlog.1 =================================================================== --- trunk/varnish-cache/bin/varnishlog/varnishlog.1 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishlog/varnishlog.1 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2007 Linpro AS +.\" Copyright (c) 2006-2008 Linpro AS .\" All rights reserved. .\" .\" Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/bin/varnishlog/varnishlog.c =================================================================== --- trunk/varnish-cache/bin/varnishlog/varnishlog.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishlog/varnishlog.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.1 =================================================================== --- trunk/varnish-cache/bin/varnishncsa/varnishncsa.1 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.1 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2007 Linpro AS +.\" Copyright (c) 2006-2008 Linpro AS .\" All rights reserved. .\" .\" Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/bin/varnishncsa/varnishncsa.c =================================================================== --- trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Anders Berg Modified: trunk/varnish-cache/bin/varnishreplay/varnishreplay.1 =================================================================== --- trunk/varnish-cache/bin/varnishreplay/varnishreplay.1 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishreplay/varnishreplay.1 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2007 Linpro AS +.\" Copyright (c) 2007-2008 Linpro AS .\" All rights reserved. .\" .\" Author: Cecilie Fritzvold Modified: trunk/varnish-cache/bin/varnishstat/varnishstat.1 =================================================================== --- trunk/varnish-cache/bin/varnishstat/varnishstat.1 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishstat/varnishstat.1 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2007 Linpro AS +.\" Copyright (c) 2006-2008 Linpro AS .\" All rights reserved. .\" .\" Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/bin/varnishstat/varnishstat.c =================================================================== --- trunk/varnish-cache/bin/varnishstat/varnishstat.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishstat/varnishstat.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/bin/varnishtop/varnishtop.1 =================================================================== --- trunk/varnish-cache/bin/varnishtop/varnishtop.1 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishtop/varnishtop.1 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2007 Linpro AS +.\" Copyright (c) 2006-2008 Linpro AS .\" All rights reserved. .\" .\" Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/bin/varnishtop/varnishtop.c =================================================================== --- trunk/varnish-cache/bin/varnishtop/varnishtop.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/bin/varnishtop/varnishtop.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/configure.ac 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,7 +1,7 @@ # $Id$ AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2006-2007 Linpro AS / Verdens Gang AS]) +AC_COPYRIGHT([Copyright (c) 2006-2008 Linpro AS / Verdens Gang AS]) AC_REVISION([$Id$]) AC_INIT([Varnish], [trunk], [varnish-dev at projects.linpro.no]) AC_CONFIG_SRCDIR(include/varnishapi.h) Modified: trunk/varnish-cache/include/binary_heap.h =================================================================== --- trunk/varnish-cache/include/binary_heap.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/binary_heap.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/cli.h =================================================================== --- trunk/varnish-cache/include/cli.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/cli.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/cli_common.h =================================================================== --- trunk/varnish-cache/include/cli_common.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/cli_common.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/cli_priv.h =================================================================== --- trunk/varnish-cache/include/cli_priv.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/cli_priv.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/compat/asprintf.h =================================================================== --- trunk/varnish-cache/include/compat/asprintf.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/compat/asprintf.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/include/compat/daemon.h =================================================================== --- trunk/varnish-cache/include/compat/daemon.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/compat/daemon.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/include/compat/setproctitle.h =================================================================== --- trunk/varnish-cache/include/compat/setproctitle.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/compat/setproctitle.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/include/compat/srandomdev.h =================================================================== --- trunk/varnish-cache/include/compat/srandomdev.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/compat/srandomdev.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/include/compat/strlcat.h =================================================================== --- trunk/varnish-cache/include/compat/strlcat.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/compat/strlcat.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/include/compat/strlcpy.h =================================================================== --- trunk/varnish-cache/include/compat/strlcpy.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/compat/strlcpy.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/include/compat/strndup.h =================================================================== --- trunk/varnish-cache/include/compat/strndup.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/compat/strndup.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/include/compat/vasprintf.h =================================================================== --- trunk/varnish-cache/include/compat/vasprintf.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/compat/vasprintf.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/include/http_headers.h =================================================================== --- trunk/varnish-cache/include/http_headers.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/http_headers.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/libvarnish.h =================================================================== --- trunk/varnish-cache/include/libvarnish.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/libvarnish.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/libvcl.h =================================================================== --- trunk/varnish-cache/include/libvcl.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/libvcl.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/shmlog.h =================================================================== --- trunk/varnish-cache/include/shmlog.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/shmlog.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/shmlog_tags.h =================================================================== --- trunk/varnish-cache/include/shmlog_tags.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/shmlog_tags.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/stat_field.h =================================================================== --- trunk/varnish-cache/include/stat_field.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/stat_field.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/stats.h =================================================================== --- trunk/varnish-cache/include/stats.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/stats.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/varnishapi.h =================================================================== --- trunk/varnish-cache/include/varnishapi.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/varnishapi.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/vrt.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/include/vss.h =================================================================== --- trunk/varnish-cache/include/vss.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/include/vss.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-cache/lib/libvarnish/argv.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/argv.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/argv.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvarnish/assert.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/assert.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/assert.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvarnish/binary_heap.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/binary_heap.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/binary_heap.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvarnish/cli.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/cli.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/cli.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvarnish/cli_common.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/cli_common.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/cli_common.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvarnish/crc32.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/crc32.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/crc32.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvarnish/flopen.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/flopen.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/flopen.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 Dag-Erling Co?dan Sm?rgrav + * Copyright (c) 2007 Dag-Erling Co??dan Sm??rgrav * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-cache/lib/libvarnish/time.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/time.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/time.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvarnish/version.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/version.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/version.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav @@ -40,5 +40,5 @@ { fprintf(stderr, "%s (%s-%s)\n", progname, PACKAGE_TARNAME, PACKAGE_VERSION); - fprintf(stderr, "Copyright (c) 2006-2007 Linpro AS / Verdens Gang AS\n"); + fprintf(stderr, "Copyright (c) 2006-2008 Linpro AS / Verdens Gang AS\n"); } Modified: trunk/varnish-cache/lib/libvarnish/vss.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vss.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/vss.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/lib/libvarnish/vtmpfile.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/vtmpfile.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnish/vtmpfile.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,9 +1,9 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * - * Author: Dag-Erling Sm?rgrav + * Author: Dag-Erling Sm??rgrav * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions Modified: trunk/varnish-cache/lib/libvarnishapi/instance.c =================================================================== --- trunk/varnish-cache/lib/libvarnishapi/instance.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnishapi/instance.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 Linpro AS + * Copyright (c) 2007-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/lib/libvarnishapi/shmlog.c =================================================================== --- trunk/varnish-cache/lib/libvarnishapi/shmlog.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnishapi/shmlog.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvarnishcompat/asprintf.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/asprintf.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnishcompat/asprintf.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/lib/libvarnishcompat/setproctitle.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/setproctitle.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnishcompat/setproctitle.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/lib/libvarnishcompat/srandomdev.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/srandomdev.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnishcompat/srandomdev.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/lib/libvarnishcompat/strndup.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/strndup.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnishcompat/strndup.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/lib/libvarnishcompat/vasprintf.c =================================================================== --- trunk/varnish-cache/lib/libvarnishcompat/vasprintf.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvarnishcompat/vasprintf.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-cache/lib/libvcl/vcc_acl.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_acl.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_acl.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_backend.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -351,7 +351,7 @@ vsb_cat(sb, "};\n"); vsb_cat(sb, "/*-\n"); vsb_cat(sb, " * Copyright (c) 2006 Verdens Gang AS\n"); - vsb_cat(sb, " * Copyright (c) 2006-2007 Linpro AS\n"); + vsb_cat(sb, " * Copyright (c) 2006-2008 Linpro AS\n"); vsb_cat(sb, " * All rights reserved.\n"); vsb_cat(sb, " *\n"); vsb_cat(sb, " * Author: Poul-Henning Kamp \n"); Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_fixed_token.tcl 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,7 +1,7 @@ #!/usr/local/bin/tclsh8.4 #- # Copyright (c) 2006 Verdens Gang AS -# Copyright (c) 2006-2007 Linpro AS +# Copyright (c) 2006-2008 Linpro AS # All rights reserved. # # Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_gen_obj.tcl 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,7 +1,7 @@ #!/usr/local/bin/tclsh8.4 #- # Copyright (c) 2006 Verdens Gang AS -# Copyright (c) 2006-2007 Linpro AS +# Copyright (c) 2006-2008 Linpro AS # All rights reserved. # # Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_priv.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_priv.h 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_priv.h 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_string.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_string.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_string.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_token.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_token.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/lib/libvcl/vcc_xref.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_xref.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/lib/libvcl/vcc_xref.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2007 Linpro AS + * Copyright (c) 2006-2008 Linpro AS * All rights reserved. * * Author: Poul-Henning Kamp Modified: trunk/varnish-cache/man/vcl.7 =================================================================== --- trunk/varnish-cache/man/vcl.7 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-cache/man/vcl.7 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2007 Linpro AS +.\" Copyright (c) 2006-2008 Linpro AS .\" All rights reserved. .\" .\" Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-tools/autobuild/autobuild.sh =================================================================== --- trunk/varnish-tools/autobuild/autobuild.sh 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/autobuild/autobuild.sh 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/bin/sh -e -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/autobuild/mksummary.pl =================================================================== --- trunk/varnish-tools/autobuild/mksummary.pl 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/autobuild/mksummary.pl 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/fetcher/fetcher.pl =================================================================== --- trunk/varnish-tools/fetcher/fetcher.pl 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/fetcher/fetcher.pl 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-tools/munin/configure.ac =================================================================== --- trunk/varnish-tools/munin/configure.ac 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/munin/configure.ac 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,7 +1,7 @@ # $Id$ AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2007 Linpro AS / Verdens Gang AS]) +AC_COPYRIGHT([Copyright (c) 2007-2008 Linpro AS / Verdens Gang AS]) AC_REVISION([$Id$]) AC_INIT([Varnish Munin plugin], [trunk], [varnish-dev at projects.linpro.no]) AC_CONFIG_SRCDIR(varnish_munin_plugin.pl) Modified: trunk/varnish-tools/munin/varnish_munin_plugin.pl =================================================================== --- trunk/varnish-tools/munin/varnish_munin_plugin.pl 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/munin/varnish_munin_plugin.pl 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Author: Dag-Erling Sm??rgrav Modified: trunk/varnish-tools/nagios/LICENSE =================================================================== --- trunk/varnish-tools/nagios/LICENSE 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/nagios/LICENSE 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,4 +1,4 @@ -Copyright (c) 2007 Linpro AS +Copyright (c) 2007-2008 Linpro AS All rights reserved. Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/nagios/check_varnish.c =================================================================== --- trunk/varnish-tools/nagios/check_varnish.c 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/nagios/check_varnish.c 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2007 Linpro AS + * Copyright (c) 2007-2008 Linpro AS * All rights reserved. * * Author: Cecilie Fritzvold Modified: trunk/varnish-tools/nagios/configure.ac =================================================================== --- trunk/varnish-tools/nagios/configure.ac 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/nagios/configure.ac 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,7 +1,7 @@ # $Id$ AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2007 Linpro AS]) +AC_COPYRIGHT([Copyright (c) 2007-2008 Linpro AS]) AC_REVISION([$Id$]) AC_INIT([nagios-varnish-plugin], [1.0], [varnish-dev at projects.linpro.no]) AC_CONFIG_SRCDIR(check_varnish.c) Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case/LRU.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Case/LRU.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Case/LRU.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case/POST.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Case/POST.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Case/POST.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Case/Pipeline.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case/RePurge.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Case/RePurge.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Case/RePurge.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket056.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket056.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket056.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket102.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket102.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket102.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket128.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket128.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket128.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket164.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket164.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Case/Ticket164.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case/Vary.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Case/Vary.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Case/Vary.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Case.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Case.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Case.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2006-2007 Linpro AS +# Copyright (c) 2006-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Client.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Client.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Client.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2006-2007 Linpro AS +# Copyright (c) 2006-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Engine.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Engine.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Engine.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2006-2007 Linpro AS +# Copyright (c) 2006-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Report/HTML.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Report/HTML.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Report/HTML.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Report.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Report.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Report.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2007 Linpro AS +# Copyright (c) 2007-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Server/Connection.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Server/Connection.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Server/Connection.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2006-2007 Linpro AS +# Copyright (c) 2006-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Server.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Server.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Server.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2006-2007 Linpro AS +# Copyright (c) 2006-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test/Varnish.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test/Varnish.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test/Varnish.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2006-2007 Linpro AS +# Copyright (c) 2006-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: trunk/varnish-tools/regress/lib/Varnish/Test.pm =================================================================== --- trunk/varnish-tools/regress/lib/Varnish/Test.pm 2008-01-31 11:41:32 UTC (rev 2414) +++ trunk/varnish-tools/regress/lib/Varnish/Test.pm 2008-01-31 11:57:51 UTC (rev 2415) @@ -1,6 +1,6 @@ #!/usr/bin/perl -w #- -# Copyright (c) 2006-2007 Linpro AS +# Copyright (c) 2006-2008 Linpro AS # All rights reserved. # # Redistribution and use in source and binary forms, with or without