From phk at varnish-cache.org Sat Jul 3 09:04:57 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 3 Jul 2010 11:04:57 +0200 Subject: r4995 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-07-03 11:04:57 +0200 (Sat, 03 Jul 2010) New Revision: 4995 Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c Log: Move the dlopen/dlsym/dlclose check of newly compiled VCL code to a sub process, to make contamination of the MGR process impossible. Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-06-30 12:55:57 UTC (rev 4994) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-07-03 09:04:57 UTC (rev 4995) @@ -55,6 +55,7 @@ #include "mgt_cli.h" #include "heritage.h" +#include "vcl.h" #include "vss.h" struct vclprog { @@ -124,16 +125,6 @@ } /*-------------------------------------------------------------------- - * Invoke system C compiler in a sub-process - */ - -static void -run_cc(void *priv) -{ - (void)execl("/bin/sh", "/bin/sh", "-c", priv, NULL); -} - -/*-------------------------------------------------------------------- * Invoke system VCC compiler in a sub-process */ @@ -168,7 +159,6 @@ fprintf(stderr, "Cannot open %s", vp->sf); exit (1); } - mgt_got_fd(fd); l = strlen(csrc); i = write(fd, csrc, l); if (i != l) { @@ -181,6 +171,57 @@ } /*-------------------------------------------------------------------- + * Invoke system C compiler in a sub-process + */ + +static void +run_cc(void *priv) +{ + (void)execl("/bin/sh", "/bin/sh", "-c", priv, NULL); +} + +/*-------------------------------------------------------------------- + * Attempt to open compiled VCL in a sub-process + */ + +static void +run_dlopen(void *priv) +{ + const char *of; + void *dlh; + struct VCL_conf const *cnf; + + of = priv; + + /* Try to load the object into the management process */ + if ((dlh = dlopen(of, RTLD_NOW | RTLD_LOCAL)) == NULL) { + fprintf(stderr, + "Compiled VCL program failed to load:\n %s\n", + dlerror()); + exit(1); + } + + cnf = dlsym(dlh, "VCL_conf"); + if (cnf == NULL) { + fprintf(stderr, "Compiled VCL program, metadata not found\n"); + exit(1); + } + + if (cnf->magic != VCL_CONF_MAGIC) { + fprintf(stderr, "Compiled VCL program, mangled metadata\n"); + exit(1); + } + + if (dlclose(dlh)) { + fprintf(stderr, + "Compiled VCL program failed to unload:\n %s\n", + dlerror()); + exit(1); + } + exit(0); +} + +/*-------------------------------------------------------------------- * Compile a VCL program, return shared object, errors in sb. */ @@ -193,7 +234,6 @@ char of[sizeof sf + 1]; char *retval; int sfd, i; - void *dlh; struct vcc_priv vp; /* Create temporary C source file */ @@ -235,25 +275,14 @@ (void)unlink(sf); vsb_delete(cmdsb); + if (!i) + i = SUB_run(sb, run_dlopen, of, "dlopen", 10); + if (i) { (void)unlink(of); return (NULL); } - /* Try to load the object into the management process */ - if ((dlh = dlopen(of, RTLD_NOW | RTLD_LOCAL)) == NULL) { - vsb_printf(sb, - "Compiled VCL program failed to load:\n %s", dlerror()); - (void)unlink(of); - return (NULL); - } - - /* - * XXX: we should look up and check the handle in the loaded - * object - */ - - AZ(dlclose(dlh)); retval = strdup(of); XXXAN(retval); return (retval); From perbu at varnish-cache.org Sat Jul 3 09:43:55 2010 From: perbu at varnish-cache.org (perbu at varnish-cache.org) Date: Sat, 3 Jul 2010 11:43:55 +0200 Subject: r4996 - in trunk/varnish-cache/doc/sphinx: . installation tutorial Message-ID: Author: perbu Date: 2010-07-03 11:43:54 +0200 (Sat, 03 Jul 2010) New Revision: 4996 Added: trunk/varnish-cache/doc/sphinx/installation/prerequisites.rst trunk/varnish-cache/doc/sphinx/tutorial/sizing_your_cache.rst Modified: trunk/varnish-cache/doc/sphinx/index.rst trunk/varnish-cache/doc/sphinx/installation/index.rst trunk/varnish-cache/doc/sphinx/tutorial/index.rst trunk/varnish-cache/doc/sphinx/tutorial/starting_varnish.rst Log: prerequisites for installation, cache sizing guidelines + some general cleanup Modified: trunk/varnish-cache/doc/sphinx/index.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/index.rst 2010-07-03 09:04:57 UTC (rev 4995) +++ trunk/varnish-cache/doc/sphinx/index.rst 2010-07-03 09:43:54 UTC (rev 4996) @@ -30,3 +30,6 @@ * :ref:`genindex` * :ref:`modindex` * :ref:`search` + + +`$Id:$` Modified: trunk/varnish-cache/doc/sphinx/installation/index.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/installation/index.rst 2010-07-03 09:04:57 UTC (rev 4995) +++ trunk/varnish-cache/doc/sphinx/installation/index.rst 2010-07-03 09:43:54 UTC (rev 4996) @@ -4,29 +4,16 @@ Varnish Installation %%%%%%%%%%%%%%%%%%%% -This manual explains how to get Varnish onto your system, where +This document explains how to get Varnish onto your system, where to get help, how report bugs etc. In other words, it is a manual about pretty much everything else than actually using Varnish to move traffic. .. toctree:: + prerequisites.rst install.rst help.rst bugs.rst -.. todo:: - [V] on this os, pull this package - [V] .. that ..//.. - [V] to compile from source - [V] how to get help - [V]- mailing list - [V] - IRC - [V] - varnish-software.com - [V] - other listed consultants - reporting bugs - - using varnishtest to reproduce - - what data do we need - - confidentiality - - ... Added: trunk/varnish-cache/doc/sphinx/installation/prerequisites.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/installation/prerequisites.rst (rev 0) +++ trunk/varnish-cache/doc/sphinx/installation/prerequisites.rst 2010-07-03 09:43:54 UTC (rev 4996) @@ -0,0 +1,22 @@ +Prerequisites +============= + + +In order for you to install Varnish you must have the following: + + * A fairly modern and 64 bit version of either + - Linux + - FreeBSD + - Solaris + * root access to said system + + +Varnish can be installed on other UNIX systems as well, but it is not +tested particularly well on these plattforms. Varnish is, from time to +time, said to work on: + + * 32 bit versions of the before-mentioned systems. + * OS X + * NetBSD + * OpenBSD + Modified: trunk/varnish-cache/doc/sphinx/tutorial/index.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/tutorial/index.rst 2010-07-03 09:04:57 UTC (rev 4995) +++ trunk/varnish-cache/doc/sphinx/tutorial/index.rst 2010-07-03 09:43:54 UTC (rev 4996) @@ -4,7 +4,7 @@ Varnish Tutorial %%%%%%%%%%%%%%%% -Varnish is a web accelerator. It is installed in frond of your web +Varnish is a web accelerator. It is installed in front of your web application and it caches the reponses, making your web site run Varnish is fast, flexible and easy to use. @@ -18,13 +18,16 @@ Furthermore we assume you have read the :ref:`install-index` and that it is installed with the default configuration. +Good luck. +perbu. .. toctree:: backend_servers.rst starting_varnish.rst logging.rst + sizing_your_cache.rst putting_varnish_on_port_80.rst vcl.rst statistics.rst Added: trunk/varnish-cache/doc/sphinx/tutorial/sizing_your_cache.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/tutorial/sizing_your_cache.rst (rev 0) +++ trunk/varnish-cache/doc/sphinx/tutorial/sizing_your_cache.rst 2010-07-03 09:43:54 UTC (rev 4996) @@ -0,0 +1,16 @@ + +Sizing your cache +----------------- + +Picking how much memory you should give Varnish can be a tricky +task. A few things to consider: + * How big is your *hot* data set. For a portal or news site that + would be the size of the front page with all the stuff on it, and + the size of all the pages and objects linked from the first page. + * How expensive is it to generate an object? Sometimes it makes sense + to only cache images a little while or not to cache them at all if + they are cheap to serve from the backend and you have a limited + amount of memory. + * Watch the n_lru_nuked counter with varnishstat or some other + tool. If you have a lot of LRU activity then you should consider + increasing the size of the cache. Modified: trunk/varnish-cache/doc/sphinx/tutorial/starting_varnish.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/tutorial/starting_varnish.rst 2010-07-03 09:04:57 UTC (rev 4995) +++ trunk/varnish-cache/doc/sphinx/tutorial/starting_varnish.rst 2010-07-03 09:43:54 UTC (rev 4996) @@ -4,7 +4,7 @@ ---------------- I assume varnishd is in your path. You might want to run ``pkill -varnishd`` to make sure Varnish isn't running. Become root and type: +varnishd`` to make sure varnishd isn't running. Become root and type: ``# varnishd -f /usr/local/etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:8080`` @@ -18,7 +18,7 @@ storing its content. I used the type *malloc*, which just uses memory for storage. There are other backends as well, described in :ref:tutorial-storage. 1G specifies how much memory should be allocated - - one gigabyte. + - one gigabyte. ``-T 127.0.0.1:2000`` Varnish has a buildt in text-based administration From phk at varnish-cache.org Sat Jul 3 09:59:07 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 3 Jul 2010 11:59:07 +0200 Subject: r4997 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-07-03 11:59:07 +0200 (Sat, 03 Jul 2010) New Revision: 4997 Modified: trunk/varnish-cache/bin/varnishd/vclflint.lnt Log: FLexelinting Modified: trunk/varnish-cache/bin/varnishd/vclflint.lnt =================================================================== --- trunk/varnish-cache/bin/varnishd/vclflint.lnt 2010-07-03 09:43:54 UTC (rev 4996) +++ trunk/varnish-cache/bin/varnishd/vclflint.lnt 2010-07-03 09:59:07 UTC (rev 4997) @@ -2,6 +2,19 @@ // -esym(763, sess) // Redundant declaration for symbol 'sess' +-esym(763, cli) // Redundant declaration for symbol 'cli' + +-e785 // Too few initializers for aggregate '___' of type '___' + + +-esym(750, VCL_RET_*) // not ref +-esym(750, VCL_MET_*) // not ref + +-esym(753, vsb) // not ref +-esym(750, vrt_*) // not ref +-esym(753, vrt_*) // not ref +-esym(750, VRT_*) // not ref + // Harmless -e786 // String concatenation within initializer From phk at varnish-cache.org Sat Jul 3 10:23:28 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sat, 3 Jul 2010 12:23:28 +0200 Subject: r4998 - in trunk/varnish-cache: bin/varnishd include lib/libvcl Message-ID: Author: phk Date: 2010-07-03 12:23:28 +0200 (Sat, 03 Jul 2010) New Revision: 4998 Added: trunk/varnish-cache/include/vmod.h Modified: trunk/varnish-cache/bin/varnishd/mgt.h trunk/varnish-cache/bin/varnishd/mgt_param.c trunk/varnish-cache/bin/varnishd/mgt_vcc.c trunk/varnish-cache/include/libvcl.h trunk/varnish-cache/lib/libvcl/generate.py 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: Some boilerplate stuff for VMOD's. Modified: trunk/varnish-cache/bin/varnishd/mgt.h =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt.h 2010-07-03 09:59:07 UTC (rev 4997) +++ trunk/varnish-cache/bin/varnishd/mgt.h 2010-07-03 10:23:28 UTC (rev 4998) @@ -81,6 +81,7 @@ int mgt_has_vcl(void); extern char *mgt_cc_cmd; extern char *mgt_vcl_dir; +extern char *mgt_vmod_dir; #define REPORT0(pri, fmt) \ Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_param.c 2010-07-03 09:59:07 UTC (rev 4997) +++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2010-07-03 10:23:28 UTC (rev 4998) @@ -827,6 +827,10 @@ "include) are opened.", 0, ".", NULL }, + { "vmod_dir", tweak_string, &mgt_vmod_dir, 0, 0, + "Directory where VCL modules are to be found.", + 0, + ".", NULL }, { NULL, NULL, NULL } }; Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c =================================================================== --- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-07-03 09:59:07 UTC (rev 4997) +++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-07-03 10:23:28 UTC (rev 4998) @@ -69,6 +69,7 @@ char *mgt_cc_cmd; char *mgt_vcl_dir; +char *mgt_vmod_dir; static struct vcc *vcc; @@ -145,6 +146,7 @@ sb = vsb_newauto(); XXXAN(sb); VCC_VCL_dir(vcc, mgt_vcl_dir); + VCC_VMOD_dir(vcc, mgt_vmod_dir); csrc = VCC_Compile(vcc, sb, vp->vcl); vsb_finish(sb); AZ(vsb_overflowed(sb)); Modified: trunk/varnish-cache/include/libvcl.h =================================================================== --- trunk/varnish-cache/include/libvcl.h 2010-07-03 09:59:07 UTC (rev 4997) +++ trunk/varnish-cache/include/libvcl.h 2010-07-03 10:23:28 UTC (rev 4998) @@ -34,6 +34,7 @@ struct vcc *VCC_New(void); void VCC_Default_VCL(struct vcc *, const char *str); void VCC_VCL_dir(struct vcc *, const char *str); +void VCC_VMOD_dir(struct vcc *, const char *str); char *VCC_Compile(const struct vcc *, struct vsb *sb, const char *b); const char *VCC_Return_Name(unsigned action); Added: trunk/varnish-cache/include/vmod.h =================================================================== --- trunk/varnish-cache/include/vmod.h (rev 0) +++ trunk/varnish-cache/include/vmod.h 2010-07-03 10:23:28 UTC (rev 4998) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2010 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$ + * + * VCL modules + * + * XXX: When this file is changed, lib/libvcl/generate.py *MUST* be rerun. + */ + +struct vmod_conf { + unsigned magic; +#define VMOD_CONF_MAGIC 0x3f017730 +}; Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-07-03 09:59:07 UTC (rev 4997) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-07-03 10:23:28 UTC (rev 4998) @@ -573,6 +573,7 @@ """) emit_file(fo, "../../include/vcl.h") +emit_file(fo, "../../include/vmod.h") emit_file(fo, "../../include/vrt.h") emit_file(fo, "../../include/vrt_obj.h") Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-03 09:59:07 UTC (rev 4997) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-03 10:23:28 UTC (rev 4998) @@ -709,3 +709,15 @@ CHECK_OBJ_NOTNULL(tl, VCC_MAGIC); REPLACE(tl->vcl_dir, str); } + +/*-------------------------------------------------------------------- + * Configure default VMOD directory + */ + +void +VCC_VMOD_dir(struct vcc *tl, const char *str) +{ + + CHECK_OBJ_NOTNULL(tl, VCC_MAGIC); + REPLACE(tl->vmod_dir, str); +} Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-03 09:59:07 UTC (rev 4997) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-03 10:23:28 UTC (rev 4998) @@ -71,6 +71,7 @@ /* Parameter/Template section */ char *default_vcl; char *vcl_dir; + char *vmod_dir; /* Instance section */ struct tokenhead tokens; Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-03 09:59:07 UTC (rev 4997) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-03 10:23:28 UTC (rev 4998) @@ -189,6 +189,37 @@ "\tvcl_func_f\t*fetch_func;\n\tvcl_func_f\t*deliver_func;\n" "\tvcl_func_f\t*error_func;\n};\n"); + /* ../../include/vmod.h */ + + vsb_cat(sb, "/*-\n * Copyright (c) 2010 Linpro AS\n" + " * All rights reserved.\n *\n * Author: Poul-Henning Kamp " + "\n *\n * Redistribution and use in source " + "and binary forms, with or without\n * modification, are permitte" + "d provided that the following conditions\n * are met:\n" + " * 1. Redistributions of source code must retain the above " + "copyright\n * notice, this list of conditions and the followi" + "ng disclaimer.\n * 2. Redistributions in binary form must " + "reproduce the above copyright\n * notice, this list of " + "conditions and the following disclaimer in the\n * documentat" + "ion and/or other materials provided with the distribution.\n" + " *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS " + "``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, " + "BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILIT" + "Y AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. " + " IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE\n" + " * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, " + "OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, " + "PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, " + "DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED " + "AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n" + " * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) " + "ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN " + "IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n" + " *\n * $Id$\n *\n * VCL modules\n *\n * XXX: When this file " + "is changed, lib/libvcl/generate.py *MUST* be rerun.\n" + " */\n\nstruct vmod_conf {\n\tunsigned\t\tmagic;\n" + "#define VMOD_CONF_MAGIC\t\t0x3f017730\n};\n"); + /* ../../include/vrt.h */ vsb_cat(sb, "/*-\n * Copyright (c) 2006 Verdens Gang AS\n" @@ -215,8 +246,8 @@ "OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR " "TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n" " * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE " - "POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * $Id: vrt.h 4735 2010-04-" - "27 15:19:41Z phk $\n *\n * Runtime support for compiled VCL " + "POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * $Id: vrt.h 4984 2010-06-" + "22 13:01:22Z phk $\n *\n * Runtime support for compiled VCL " "programs.\n *\n * XXX: When this file is changed, lib/libvcl/gen" "erate.py *MUST* be rerun.\n */\n\nstruct sess;\nstruct vsb;\n" "struct cli;\nstruct director;\nstruct VCL_conf;\n" From phk at varnish-cache.org Sun Jul 4 12:49:36 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sun, 4 Jul 2010 14:49:36 +0200 Subject: r4999 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-04 14:49:35 +0200 (Sun, 04 Jul 2010) New Revision: 4999 Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_obj.c trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_string.c trunk/varnish-cache/lib/libvcl/vcc_var.c Log: In preparation for generic types functions, including conversion functions, rename "RTIME" to "DURATION", to appease the POLA. Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-03 10:23:28 UTC (rev 4998) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 12:49:35 UTC (rev 4999) @@ -129,7 +129,7 @@ case INT: case SIZE: case TIME: - case RTIME: + case DURATION: case FLOAT: if (tl->t->tok != '=') Fb(tl, 0, "%s %c ", vp->rname, *tl->t->b); Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-03 10:23:28 UTC (rev 4998) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-04 12:49:35 UTC (rev 4999) @@ -116,7 +116,7 @@ FLOAT, SIZE, TIME, - RTIME, + DURATION, STRING, IP, HASH, Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2010-07-03 10:23:28 UTC (rev 4998) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2010-07-04 12:49:35 UTC (rev 4999) @@ -128,7 +128,7 @@ 0, 0, }, - { "req.grace", RTIME, 9, + { "req.grace", DURATION, 9, "VRT_r_req_grace(sp)", VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER @@ -192,21 +192,21 @@ VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH, "HDR_BEREQ", }, - { "bereq.connect_timeout", RTIME, 21, + { "bereq.connect_timeout", DURATION, 21, "VRT_r_bereq_connect_timeout(sp)", VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS, "VRT_l_bereq_connect_timeout(sp, ", VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS, 0, }, - { "bereq.first_byte_timeout", RTIME, 24, + { "bereq.first_byte_timeout", DURATION, 24, "VRT_r_bereq_first_byte_timeout(sp)", VCL_MET_PASS | VCL_MET_MISS, "VRT_l_bereq_first_byte_timeout(sp, ", VCL_MET_PASS | VCL_MET_MISS, 0, }, - { "bereq.between_bytes_timeout", RTIME, 27, + { "bereq.between_bytes_timeout", DURATION, 27, "VRT_r_bereq_between_bytes_timeout(sp)", VCL_MET_PASS | VCL_MET_MISS, "VRT_l_bereq_between_bytes_timeout(sp, ", @@ -220,7 +220,7 @@ VCL_MET_FETCH, 0, }, - { "beresp.saintmode", RTIME, 16, + { "beresp.saintmode", DURATION, 16, NULL, /* No reads allowed */ 0, "VRT_l_beresp_saintmode(sp, ", @@ -255,14 +255,14 @@ VCL_MET_FETCH, 0, }, - { "beresp.ttl", RTIME, 10, + { "beresp.ttl", DURATION, 10, "VRT_r_beresp_ttl(sp)", VCL_MET_FETCH, "VRT_l_beresp_ttl(sp, ", VCL_MET_FETCH, 0, }, - { "beresp.grace", RTIME, 12, + { "beresp.grace", DURATION, 12, "VRT_r_beresp_grace(sp)", VCL_MET_FETCH, "VRT_l_beresp_grace(sp, ", @@ -311,21 +311,21 @@ VCL_MET_HIT, 0, }, - { "obj.ttl", RTIME, 7, + { "obj.ttl", DURATION, 7, "VRT_r_obj_ttl(sp)", VCL_MET_HIT | VCL_MET_ERROR, "VRT_l_obj_ttl(sp, ", VCL_MET_HIT | VCL_MET_ERROR, 0, }, - { "obj.grace", RTIME, 9, + { "obj.grace", DURATION, 9, "VRT_r_obj_grace(sp)", VCL_MET_HIT | VCL_MET_ERROR, "VRT_l_obj_grace(sp, ", VCL_MET_HIT | VCL_MET_ERROR, 0, }, - { "obj.lastuse", RTIME, 11, + { "obj.lastuse", DURATION, 11, "VRT_r_obj_lastuse(sp)", VCL_MET_HIT | VCL_MET_DELIVER | VCL_MET_ERROR, NULL, /* No writes allowed */ Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-03 10:23:28 UTC (rev 4998) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 12:49:35 UTC (rev 4999) @@ -347,7 +347,7 @@ case IP: L(tl, vcc_Cond_Ip(vp, tl)); break; case STRING: L(tl, vcc_Cond_String(vp, tl)); break; case TIME: L(tl, vcc_Cond_Int(vp, tl)); break; - case RTIME: L(tl, vcc_Cond_Int(vp, tl)); break; + case DURATION: L(tl, vcc_Cond_Int(vp, tl)); break; case BACKEND: L(tl, vcc_Cond_Backend(vp, tl)); break; default: vsb_printf(tl->sb, Modified: trunk/varnish-cache/lib/libvcl/vcc_string.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-03 10:23:28 UTC (rev 4998) +++ trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-04 12:49:35 UTC (rev 4999) @@ -179,7 +179,7 @@ case TIME: Fb(tl, 0, "VRT_time_string(sp, %s)", vp->rname); break; - case RTIME: + case DURATION: Fb(tl, 0, "VRT_double_string(sp, %s)", vp->rname); break; case BACKEND: Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-03 10:23:28 UTC (rev 4998) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-04 12:49:35 UTC (rev 4999) @@ -140,7 +140,7 @@ vcc_TimeVal(tl, &d); ERRCHK(tl); Fb(tl, 0, "%g", d); - } else if (vp->fmt == RTIME) { + } else if (vp->fmt == DURATION) { vcc_RTimeVal(tl, &d); ERRCHK(tl); Fb(tl, 0, "%g", d); From phk at varnish-cache.org Sun Jul 4 14:15:29 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sun, 4 Jul 2010 16:15:29 +0200 Subject: r5000 - in trunk/varnish-cache: include lib/libvcl Message-ID: Author: phk Date: 2010-07-04 16:15:28 +0200 (Sun, 04 Jul 2010) New Revision: 5000 Modified: trunk/varnish-cache/include/vrt_obj.h trunk/varnish-cache/lib/libvcl/generate.py trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c Log: The Tcl-Py conversion left out code to generate vrt_obj.h, add that. Rename RTIME->DURATION in the python code and regenerate output. Remove fluff from python script Modified: trunk/varnish-cache/include/vrt_obj.h =================================================================== --- trunk/varnish-cache/include/vrt_obj.h 2010-07-04 12:49:35 UTC (rev 4999) +++ trunk/varnish-cache/include/vrt_obj.h 2010-07-04 14:15:28 UTC (rev 5000) @@ -1,3 +1,4 @@ + /* * $Id$ * @@ -3,7 +4,6 @@ * NB: This file is machine generated, DO NOT EDIT! * - * Edit and run vcc_gen_fixed_token.tcl instead + * Edit and run generate.py instead */ - struct sockaddr * VRT_r_client_ip(const struct sess *); struct sockaddr * VRT_r_server_ip(struct sess *); Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-07-04 12:49:35 UTC (rev 4999) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-07-04 14:15:28 UTC (rev 5000) @@ -167,7 +167,7 @@ 'const struct sess *' ), ('req.grace', - 'RTIME', + 'DURATION', ( 'all',), ( 'all',), 'struct sess *' @@ -215,19 +215,19 @@ 'const struct sess *' ), ('bereq.connect_timeout', - 'RTIME', + 'DURATION', ( 'pipe', 'pass', 'miss',), ( 'pipe', 'pass', 'miss',), 'struct sess *' ), ('bereq.first_byte_timeout', - 'RTIME', + 'DURATION', ( 'pass', 'miss',), ( 'pass', 'miss',), 'struct sess *' ), ('bereq.between_bytes_timeout', - 'RTIME', + 'DURATION', ( 'pass', 'miss',), ( 'pass', 'miss',), 'struct sess *' @@ -239,7 +239,7 @@ 'const struct sess *' ), ('beresp.saintmode', - 'RTIME', + 'DURATION', ( ), ( 'fetch',), 'const struct sess *' @@ -269,13 +269,13 @@ 'const struct sess *' ), ('beresp.ttl', - 'RTIME', + 'DURATION', ( 'fetch',), ( 'fetch',), 'const struct sess *' ), ('beresp.grace', - 'RTIME', + 'DURATION', ( 'fetch',), ( 'fetch',), 'const struct sess *' @@ -317,19 +317,19 @@ 'const struct sess *' ), ('obj.ttl', - 'RTIME', + 'DURATION', ( 'hit', 'error',), ( 'hit', 'error',), 'const struct sess *' ), ('obj.grace', - 'RTIME', + 'DURATION', ( 'hit', 'error',), ( 'hit', 'error',), 'const struct sess *' ), ('obj.lastuse', - 'RTIME', + 'DURATION', ( 'hit', 'deliver', 'error',), ( ), 'const struct sess *' @@ -375,16 +375,10 @@ 'BOOL': "unsigned", 'BACKEND': "struct director *", 'TIME': "double", - 'RTIME': "double", + 'DURATION': "double", 'INT': "int", - 'HDR_RESP': "const char *", - 'HDR_OBJ': "const char *", - 'HDR_REQ': "const char *", - 'HDR_BEREQ': "const char *", - 'HOSTNAME': "const char *", - 'PORTNAME': "const char *", + 'HEADER': "const char *", 'HASH': "const char *", - 'SET': "struct vrt_backend_entry *", } ####################################################################### @@ -727,6 +721,9 @@ ####################################################################### +fh=open("../../include/vrt_obj.h", "w") +file_header(fh) + fo=open("vcc_obj.c", "w") file_header(fo) @@ -742,16 +739,28 @@ typ = i[1] if typ[:4] == "HDR_": typ = "HEADER" + + cnam = i[0].replace(".", "_") + ctyp = vcltypes[typ] + fo.write("\t{ \"%s\", %s, %d,\n" % (i[0], typ, len(i[0]))) if len(i[2]) > 0: - fo.write('\t "VRT_r_%s(sp)",\n' % i[0].replace(".", "_")) + fo.write('\t "VRT_r_%s(sp)",\n' % cnam) + if typ != "HEADER": + fh.write(ctyp + " VRT_r_%s(%s);\n" % (cnam, i[4])) else: fo.write('\t NULL,\t/* No reads allowed */\n') restrict(fo, i[2]) if len(i[3]) > 0: - fo.write('\t "VRT_l_%s(sp, ",\n' % i[0].replace(".", "_")) + fo.write('\t "VRT_l_%s(sp, ",\n' % cnam) + if typ != "HEADER": + fh.write("void VRT_l_%s(%s, " % (cnam, i[4])) + if typ != "STRING": + fh.write(ctyp + ");\n") + else: + fh.write(ctyp + ", ...);\n") else: fo.write('\t NULL,\t/* No writes allowed */\n') restrict(fo, i[3]) @@ -765,3 +774,4 @@ fo.write("\t{ NULL }\n};\n") fo.close() +fh.close() Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-04 12:49:35 UTC (rev 4999) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-04 14:15:28 UTC (rev 5000) @@ -315,11 +315,10 @@ /* ../../include/vrt_obj.h */ - vsb_cat(sb, "/*\n * $Id: vcc_gen_fixed_token.tcl 4428 2010-01-06 " - "17:38:59Z tfheen $\n *\n * NB: This file is machine generated, " - "DO NOT EDIT!\n *\n * Edit and run vcc_gen_fixed_token.tcl " - "instead\n */\n\nstruct sockaddr * VRT_r_client_ip(const struct " - "sess *);\nstruct sockaddr * VRT_r_server_ip(struct sess *);\n" + vsb_cat(sb, "\n/*\n * $Id$\n *\n * NB: This file is machine " + "generated, DO NOT EDIT!\n *\n * Edit and run generate.py instead" + "\n */\nstruct sockaddr * VRT_r_client_ip(const struct sess " + "*);\nstruct sockaddr * VRT_r_server_ip(struct sess *);\n" "const char * VRT_r_server_hostname(struct sess *);\n" "const char * VRT_r_server_identity(struct sess *);\n" "int VRT_r_server_port(struct sess *);\nconst char * VRT_r_req_re" From phk at varnish-cache.org Sun Jul 4 14:40:34 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sun, 4 Jul 2010 16:40:34 +0200 Subject: r5001 - in trunk/varnish-cache: bin/varnishd bin/varnishtest/tests include lib/libvcl Message-ID: Author: phk Date: 2010-07-04 16:40:33 +0200 (Sun, 04 Jul 2010) New Revision: 5001 Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/bin/varnishd/default.vcl trunk/varnish-cache/bin/varnishtest/tests/r00693.vtc trunk/varnish-cache/bin/varnishtest/tests/v00018.vtc trunk/varnish-cache/include/vrt.h trunk/varnish-cache/include/vrt_obj.h trunk/varnish-cache/lib/libvcl/generate.py trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_obj.c Log: Convert the "req.hash +=" pseudo variable handing of the hask-key build process to look like a function call instead: hash_data(req.http.foo_bar) and allow string concatenation while we're at it. the name "hash_data()" is not quite to my liking, but I want to avoid "hash()" since that clashes with previous syntax for "return(hash)". Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-07-04 14:15:28 UTC (rev 5000) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-07-04 14:40:33 UTC (rev 5001) @@ -747,10 +747,19 @@ */ void -VRT_l_req_hash(struct sess *sp, const char *str) +VRT_hashdata(struct sess *sp, const char *str, ...) { + va_list ap; + const char *p; HSH_AddString(sp, str); + va_start(ap, str); + while (1) { + p = va_arg(ap, const char *); + if (p == vrt_magic_string_end) + break; + HSH_AddString(sp, p); + } } /*--------------------------------------------------------------------*/ Modified: trunk/varnish-cache/bin/varnishd/default.vcl =================================================================== --- trunk/varnish-cache/bin/varnishd/default.vcl 2010-07-04 14:15:28 UTC (rev 5000) +++ trunk/varnish-cache/bin/varnishd/default.vcl 2010-07-04 14:40:33 UTC (rev 5001) @@ -82,11 +82,11 @@ } sub vcl_hash { - set req.hash += req.url; + hash_data(req.url); if (req.http.host) { - set req.hash += req.http.host; + hash_data(req.http.host); } else { - set req.hash += server.ip; + hash_data(server.ip); } return (hash); } Modified: trunk/varnish-cache/bin/varnishtest/tests/r00693.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/r00693.vtc 2010-07-04 14:15:28 UTC (rev 5000) +++ trunk/varnish-cache/bin/varnishtest/tests/r00693.vtc 2010-07-04 14:40:33 UTC (rev 5001) @@ -60,7 +60,7 @@ return (pass); } sub vcl_hash { - set req.hash += req.url; + hash_data(req.url); return (hash); } } -start Modified: trunk/varnish-cache/bin/varnishtest/tests/v00018.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/v00018.vtc 2010-07-04 14:15:28 UTC (rev 5000) +++ trunk/varnish-cache/bin/varnishtest/tests/v00018.vtc 2010-07-04 14:40:33 UTC (rev 5001) @@ -53,7 +53,7 @@ varnish v1 -badvcl { backend b { .host = "127.0.0.1"; } - sub vcl_hash { set req.hash += 1; } + sub vcl_hash { hash_data(req.hash); } } varnish v1 -badvcl { Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2010-07-04 14:15:28 UTC (rev 5000) +++ trunk/varnish-cache/include/vrt.h 2010-07-04 14:40:33 UTC (rev 5001) @@ -150,6 +150,8 @@ const char *, ...); void VRT_handling(struct sess *sp, unsigned hand); +void VRT_hashdata(struct sess *sp, const char *str, ...); + /* Simple stuff */ int VRT_strcmp(const char *s1, const char *s2); void VRT_memmove(void *dst, const void *src, unsigned len); Modified: trunk/varnish-cache/include/vrt_obj.h =================================================================== --- trunk/varnish-cache/include/vrt_obj.h 2010-07-04 14:15:28 UTC (rev 5000) +++ trunk/varnish-cache/include/vrt_obj.h 2010-07-04 14:40:33 UTC (rev 5001) @@ -17,7 +17,6 @@ void VRT_l_req_url(const struct sess *, const char *, ...); const char * VRT_r_req_proto(const struct sess *); void VRT_l_req_proto(const struct sess *, const char *, ...); -void VRT_l_req_hash(struct sess *, const char *); struct director * VRT_r_req_backend(struct sess *); void VRT_l_req_backend(struct sess *, struct director *); int VRT_r_req_restarts(const struct sess *); Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-07-04 14:15:28 UTC (rev 5000) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-07-04 14:40:33 UTC (rev 5001) @@ -148,12 +148,6 @@ ( 'all',), 'const struct sess *' ), - ('req.hash', - 'HASH', - ( ), - ( 'hash', 'error',), # XXX error ??? - 'struct sess *' - ), ('req.backend', 'BACKEND', ( 'all',), @@ -378,7 +372,6 @@ 'DURATION': "double", 'INT': "int", 'HEADER': "const char *", - 'HASH': "const char *", } ####################################################################### Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 14:15:28 UTC (rev 5000) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 14:40:33 UTC (rev 5001) @@ -400,6 +400,26 @@ /*--------------------------------------------------------------------*/ static void +parse_hash_data(struct vcc *tl) +{ + vcc_NextToken(tl); + SkipToken(tl, '('); + + Fb(tl, 1, "VRT_hashdata(sp, "); + if (!vcc_StringVal(tl)) { + vcc_ExpectedStringval(tl); + return; + } + do + Fb(tl, 0, ", "); + while (vcc_StringVal(tl)); + Fb(tl, 0, " vrt_magic_string_end);\n"); + SkipToken(tl, ')'); +} + +/*--------------------------------------------------------------------*/ + +static void parse_panic(struct vcc *tl) { vcc_NextToken(tl); @@ -494,6 +514,7 @@ /* Keep list sorted from here */ { "call", parse_call }, { "esi", parse_esi, VCL_MET_FETCH }, + { "hash_data", parse_hash_data, VCL_MET_HASH }, { "panic", parse_panic }, { "purge", parse_purge }, { "purge_url", parse_purge_url }, Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-04 14:15:28 UTC (rev 5000) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-04 14:40:33 UTC (rev 5001) @@ -315,10 +315,11 @@ /* ../../include/vrt_obj.h */ - vsb_cat(sb, "\n/*\n * $Id$\n *\n * NB: This file is machine " - "generated, DO NOT EDIT!\n *\n * Edit and run generate.py instead" - "\n */\nstruct sockaddr * VRT_r_client_ip(const struct sess " - "*);\nstruct sockaddr * VRT_r_server_ip(struct sess *);\n" + vsb_cat(sb, "\n/*\n * $Id: vrt_obj.h 5000 2010-07-04 14:15:28Z " + "phk $\n *\n * NB: This file is machine generated, DO NOT " + "EDIT!\n *\n * Edit and run generate.py instead\n */\n" + "struct sockaddr * VRT_r_client_ip(const struct sess *);\n" + "struct sockaddr * VRT_r_server_ip(struct sess *);\n" "const char * VRT_r_server_hostname(struct sess *);\n" "const char * VRT_r_server_identity(struct sess *);\n" "int VRT_r_server_port(struct sess *);\nconst char * VRT_r_req_re" Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2010-07-04 14:15:28 UTC (rev 5000) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2010-07-04 14:40:33 UTC (rev 5001) @@ -101,13 +101,6 @@ | VCL_MET_ERROR, "HDR_REQ", }, - { "req.hash", HASH, 8, - NULL, /* No reads allowed */ - 0, - "VRT_l_req_hash(sp, ", - VCL_MET_HASH | VCL_MET_ERROR, - 0, - }, { "req.backend", BACKEND, 11, "VRT_r_req_backend(sp)", VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH From phk at varnish-cache.org Sun Jul 4 19:55:12 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sun, 4 Jul 2010 21:55:12 +0200 Subject: r5002 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-04 21:55:12 +0200 (Sun, 04 Jul 2010) New Revision: 5002 Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_string.c trunk/varnish-cache/lib/libvcl/vcc_var.c trunk/varnish-cache/lib/libvcl/vcc_xref.c Log: Various cleanups. Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 14:40:33 UTC (rev 5001) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 19:55:12 UTC (rev 5002) @@ -53,7 +53,7 @@ vcc_NextToken(tl); ExpectErr(tl, ID); vcc_AddCall(tl, tl->t); - vcc_AddRef(tl, tl->t, R_FUNC); + vcc_AddRef(tl, tl->t, R_SUB); Fb(tl, 1, "if (VGC_function_%.*s(sp))\n", PF(tl->t)); Fb(tl, 1, "\treturn (1);\n"); vcc_NextToken(tl); @@ -130,7 +130,7 @@ case SIZE: case TIME: case DURATION: - case FLOAT: +// case FLOAT: if (tl->t->tok != '=') Fb(tl, 0, "%s %c ", vp->rname, *tl->t->b); at = tl->t; @@ -182,15 +182,6 @@ vcc_NextToken(tl); Fb(tl, 0, ");\n"); break; - case HASH: - SkipToken(tl, T_INCR); - if (!vcc_StringVal(tl)) { - ERRCHK(tl); - vcc_ExpectedStringval(tl); - return; - } - Fb(tl, 0, ");\n"); - break; case STRING: if (tl->t->tok != '=') { illegal_assignment(tl, "strings"); Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-04 14:40:33 UTC (rev 5001) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-04 19:55:12 UTC (rev 5002) @@ -113,18 +113,16 @@ BACKEND, BOOL, INT, - FLOAT, SIZE, TIME, DURATION, STRING, IP, - HASH, HEADER }; enum ref_type { - R_FUNC, + R_SUB, R_ACL, R_BACKEND, R_PROBE Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 14:40:33 UTC (rev 5001) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 19:55:12 UTC (rev 5002) @@ -518,8 +518,8 @@ tl->fb = tl->fm[m]; if (tl->mprocs[m] == NULL) { tl->mprocs[m] = vcc_AddProc(tl, tl->t); - vcc_AddDef(tl, tl->t, R_FUNC); - vcc_AddRef(tl, tl->t, R_FUNC); + vcc_AddDef(tl, tl->t, R_SUB); + vcc_AddRef(tl, tl->t, R_SUB); } tl->curproc = tl->mprocs[m]; Fb(tl, 1, " /* ... from "); @@ -528,7 +528,7 @@ } else { tl->fb = tl->fc; tl->curproc = vcc_AddProc(tl, tl->t); - vcc_AddDef(tl, tl->t, R_FUNC); + vcc_AddDef(tl, tl->t, R_SUB); Fh(tl, 0, "static int VGC_function_%.*s (struct sess *sp);\n", PF(tl->t)); Fc(tl, 1, "\nstatic int\n"); Modified: trunk/varnish-cache/lib/libvcl/vcc_string.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-04 14:40:33 UTC (rev 5001) +++ trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-04 19:55:12 UTC (rev 5002) @@ -173,9 +173,11 @@ case INT: Fb(tl, 0, "VRT_int_string(sp, %s)", vp->rname); break; +#if 0 case FLOAT: Fb(tl, 0, "VRT_double_string(sp, %s)", vp->rname); break; +#endif case TIME: Fb(tl, 0, "VRT_time_string(sp, %s)", vp->rname); break; Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-04 14:40:33 UTC (rev 5001) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-04 19:55:12 UTC (rev 5002) @@ -148,8 +148,10 @@ vcc_SizeVal(tl, &d); ERRCHK(tl); Fb(tl, 0, "%g", d); +#if 0 } else if (vp->fmt == FLOAT) { Fb(tl, 0, "%g", vcc_DoubleVal(tl)); +#endif } else if (vp->fmt == INT) { Fb(tl, 0, "%u", vcc_UintVal(tl)); } else { Modified: trunk/varnish-cache/lib/libvcl/vcc_xref.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-07-04 14:40:33 UTC (rev 5001) +++ trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-07-04 19:55:12 UTC (rev 5002) @@ -28,11 +28,11 @@ * * This file contains code for two cross-reference or consistency checks. * - * The first check is simply that all functions, acls and backends are + * The first check is simply that all subroutine, acls and backends are * both defined and referenced. Complaints about referenced but undefined * or defined but unreferenced objects will be emitted. * - * The second check recursively decends through function calls to make + * The second check recursively decends through subroutine calls to make * sure that action actions are correct for the methods through which * they are called. */ @@ -83,7 +83,7 @@ vcc_typename(struct vcc *tl, const struct ref *r) { switch (r->type) { - case R_FUNC: return ("function"); + case R_SUB: return ("subroutine"); case R_ACL: return ("acl"); case R_BACKEND: return ("backend"); case R_PROBE: return ("probe"); @@ -280,7 +280,8 @@ #include "vcl_returns.h" #undef VCL_RET_MAC /*lint -restore */ - vsb_printf(tl->sb, "\n...in function \"%.*s\"\n", PF(p->name)); + vsb_printf(tl->sb, "\n...in subroutine \"%.*s\"\n", + PF(p->name)); vcc_ErrWhere(tl, p->name); return (1); } @@ -360,7 +361,7 @@ "'%.*s': %s not possible in method '%.*s'.\n", PF(pu->t), pu->use, PF(p->name)); vcc_ErrWhere(tl, pu->t); - vsb_printf(tl->sb, "\n...in function \"%.*s\"\n", + vsb_printf(tl->sb, "\n...in subroutine \"%.*s\"\n", PF(p->name)); vcc_ErrWhere(tl, p->name); return (1); From phk at varnish-cache.org Sun Jul 4 20:06:37 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sun, 4 Jul 2010 22:06:37 +0200 Subject: r5003 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-04 22:06:37 +0200 (Sun, 04 Jul 2010) New Revision: 5003 Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_var.c Log: Comment out unused SIZE type Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 19:55:12 UTC (rev 5002) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 20:06:37 UTC (rev 5003) @@ -127,7 +127,7 @@ vcc_NextToken(tl); switch (vp->fmt) { case INT: - case SIZE: +// case SIZE: case TIME: case DURATION: // case FLOAT: Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-04 19:55:12 UTC (rev 5002) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-04 20:06:37 UTC (rev 5003) @@ -113,7 +113,8 @@ BACKEND, BOOL, INT, - SIZE, + // SIZE, + // FLOAT, TIME, DURATION, STRING, Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 19:55:12 UTC (rev 5002) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 20:06:37 UTC (rev 5003) @@ -342,7 +342,7 @@ vcc_NextToken(tl); switch (vp->fmt) { case INT: L(tl, vcc_Cond_Int(vp, tl)); break; - case SIZE: L(tl, vcc_Cond_Int(vp, tl)); break; + // case SIZE: L(tl, vcc_Cond_Int(vp, tl)); break; case BOOL: L(tl, vcc_Cond_Bool(vp, tl)); break; case IP: L(tl, vcc_Cond_Ip(vp, tl)); break; case STRING: L(tl, vcc_Cond_String(vp, tl)); break; Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-04 19:55:12 UTC (rev 5002) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-04 20:06:37 UTC (rev 5003) @@ -144,10 +144,12 @@ vcc_RTimeVal(tl, &d); ERRCHK(tl); Fb(tl, 0, "%g", d); +#if 0 } else if (vp->fmt == SIZE) { vcc_SizeVal(tl, &d); ERRCHK(tl); Fb(tl, 0, "%g", d); +#endif #if 0 } else if (vp->fmt == FLOAT) { Fb(tl, 0, "%g", vcc_DoubleVal(tl)); From phk at varnish-cache.org Sun Jul 4 20:07:38 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sun, 4 Jul 2010 22:07:38 +0200 Subject: r5004 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-04 22:07:37 +0200 (Sun, 04 Jul 2010) New Revision: 5004 Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c Log: Comment out parse functions for SIZE type. Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 20:06:37 UTC (rev 5003) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 20:07:37 UTC (rev 5004) @@ -93,6 +93,7 @@ return (sc); } +#if 0 /*-------------------------------------------------------------------- * Recognize and convert units of size, return bytes. */ @@ -121,6 +122,7 @@ vcc_NextToken(tl); return (sc); } +#endif /*-------------------------------------------------------------------- * Recognize and convert { CNUM } to unsigned value @@ -207,6 +209,7 @@ *d = v * sc; } +#if 0 /*--------------------------------------------------------------------*/ void @@ -220,6 +223,7 @@ sc = vcc_SizeUnit(tl); *d = v * sc; } +#endif /*--------------------------------------------------------------------*/ From phk at varnish-cache.org Sun Jul 4 21:44:28 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Sun, 4 Jul 2010 23:44:28 +0200 Subject: r5005 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-04 23:44:28 +0200 (Sun, 04 Jul 2010) New Revision: 5005 Modified: trunk/varnish-cache/lib/libvcl/generate.py trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_string.c trunk/varnish-cache/lib/libvcl/vcc_token.c trunk/varnish-cache/lib/libvcl/vcc_token_defs.h Log: Collapse the "VAR" token into ID. Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-07-04 20:07:37 UTC (rev 5004) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-07-04 21:44:28 UTC (rev 5005) @@ -67,7 +67,6 @@ # These have handwritten recognizers "ID": None, - "VAR": None, "CNUM": None, "CSTR": None, "EOI": None, Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 20:07:37 UTC (rev 5004) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 21:44:28 UTC (rev 5005) @@ -68,7 +68,7 @@ struct var *vp; vcc_NextToken(tl); - if (tl->t->tok == VAR) { + if (tl->t->tok == ID) { vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read"); ERRCHK(tl); assert(vp != NULL); @@ -85,7 +85,7 @@ if (tl->t->tok == CSTR) { Fb(tl, 0, ", %.*s", PF(tl->t)); vcc_NextToken(tl); - } else if (tl->t->tok == VAR) { + } else if (tl->t->tok == ID) { Fb(tl, 0, ", "); if (!vcc_StringVal(tl)) { ERRCHK(tl); @@ -118,7 +118,7 @@ struct token *at, *vt; vcc_NextToken(tl); - ExpectErr(tl, VAR); + ExpectErr(tl, ID); vt = tl->t; vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "set"); ERRCHK(tl); @@ -240,7 +240,7 @@ struct var *vp; vcc_NextToken(tl); - ExpectErr(tl, VAR); + ExpectErr(tl, ID); vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "unset"); ERRCHK(tl); assert(vp != NULL); @@ -277,11 +277,11 @@ ExpectErr(tl, '('); vcc_NextToken(tl); - if (tl->t->tok == VAR) { + if (tl->t->tok == ID) { Fb(tl, 1, "VRT_ban(sp,\n"); tl->indent += INDENT; while (1) { - ExpectErr(tl, VAR); + ExpectErr(tl, ID); /* Check valididity of purge variable */ for (pv = purge_var; pv->name != NULL; pv++) { Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-04 20:07:37 UTC (rev 5004) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-04 21:44:28 UTC (rev 5005) @@ -152,7 +152,6 @@ [T_NOMATCH] = "!~", [T_SHL] = "<<", [T_SHR] = ">>", - [VAR] = "VAR", }; void @@ -246,8 +245,8 @@ "OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR " "TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n" " * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE " - "POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * $Id: vrt.h 4984 2010-06-" - "22 13:01:22Z phk $\n *\n * Runtime support for compiled VCL " + "POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * $Id: vrt.h 5001 2010-07-" + "04 14:40:33Z phk $\n *\n * Runtime support for compiled VCL " "programs.\n *\n * XXX: When this file is changed, lib/libvcl/gen" "erate.py *MUST* be rerun.\n */\n\nstruct sess;\nstruct vsb;\n" "struct cli;\nstruct director;\nstruct VCL_conf;\n" @@ -296,6 +295,7 @@ "const char *);\nvoid VRT_SetHdr(const struct sess *, enum " "gethdr_e where, const char *,\n const char *, ...);\n" "void VRT_handling(struct sess *sp, unsigned hand);\n" + "\nvoid VRT_hashdata(struct sess *sp, const char *str, ...);\n" "\n/* Simple stuff */\nint VRT_strcmp(const char *s1, const " "char *s2);\nvoid VRT_memmove(void *dst, const void *src, unsigne" "d len);\n\nvoid VRT_ESI(struct sess *sp);\nvoid VRT_Rollback(str" @@ -315,7 +315,7 @@ /* ../../include/vrt_obj.h */ - vsb_cat(sb, "\n/*\n * $Id: vrt_obj.h 5000 2010-07-04 14:15:28Z " + vsb_cat(sb, "\n/*\n * $Id: vrt_obj.h 5001 2010-07-04 14:40:33Z " "phk $\n *\n * NB: This file is machine generated, DO NOT " "EDIT!\n *\n * Edit and run generate.py instead\n */\n" "struct sockaddr * VRT_r_client_ip(const struct sess *);\n" @@ -328,9 +328,8 @@ "onst struct sess *);\nvoid VRT_l_req_url(const struct sess " "*, const char *, ...);\nconst char * VRT_r_req_proto(const " "struct sess *);\nvoid VRT_l_req_proto(const struct sess *, " - "const char *, ...);\nvoid VRT_l_req_hash(struct sess *, const " - "char *);\nstruct director * VRT_r_req_backend(struct sess " - "*);\nvoid VRT_l_req_backend(struct sess *, struct director " + "const char *, ...);\nstruct director * VRT_r_req_backend(struct " + "sess *);\nvoid VRT_l_req_backend(struct sess *, struct director " "*);\nint VRT_r_req_restarts(const struct sess *);\n" "double VRT_r_req_grace(struct sess *);\nvoid VRT_l_req_grace(str" "uct sess *, double);\nconst char * VRT_r_req_xid(struct sess " Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 20:07:37 UTC (rev 5004) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-04 21:44:28 UTC (rev 5005) @@ -339,7 +339,7 @@ vcc_NextToken(tl); vcc_Cond_0(tl); SkipToken(tl, ')'); - } else if (tl->t->tok == VAR) { + } else if (tl->t->tok == ID) { vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read"); ERRCHK(tl); assert(vp != NULL); Modified: trunk/varnish-cache/lib/libvcl/vcc_string.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-04 20:07:37 UTC (rev 5004) +++ trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-04 21:44:28 UTC (rev 5005) @@ -158,7 +158,7 @@ vcc_NextToken(tl); return 1; } - if (tl->t->tok == VAR) { + if (tl->t->tok == ID) { vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read"); if (tl->err) return (0); Modified: trunk/varnish-cache/lib/libvcl/vcc_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_token.c 2010-07-04 20:07:37 UTC (rev 5004) +++ trunk/varnish-cache/lib/libvcl/vcc_token.c 2010-07-04 21:44:28 UTC (rev 5005) @@ -462,16 +462,9 @@ /* Match Identifiers */ if (isident1(*p)) { for (q = p; q < sp->e; q++) - if (!isident(*q)) + if (!isvar(*q)) break; - if (isvar(*q)) { - for (; q < sp->e; q++) - if (!isvar(*q)) - break; - vcc_AddToken(tl, VAR, p, q); - } else { - vcc_AddToken(tl, ID, p, q); - } + vcc_AddToken(tl, ID, p, q); p = q; continue; } Modified: trunk/varnish-cache/lib/libvcl/vcc_token_defs.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_token_defs.h 2010-07-04 20:07:37 UTC (rev 5004) +++ trunk/varnish-cache/lib/libvcl/vcc_token_defs.h 2010-07-04 21:44:28 UTC (rev 5005) @@ -31,4 +31,3 @@ #define T_NOMATCH 150 #define T_SHL 151 #define T_SHR 152 -#define VAR 153 From phk at varnish-cache.org Mon Jul 5 08:27:30 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 5 Jul 2010 10:27:30 +0200 Subject: r5006 - in trunk/varnish-cache: include lib/libvcl Message-ID: Author: phk Date: 2010-07-05 10:27:30 +0200 (Mon, 05 Jul 2010) New Revision: 5006 Modified: trunk/varnish-cache/include/vcl_returns.h trunk/varnish-cache/lib/libvcl/generate.py trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_compile.c trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_xref.c Log: Add a bitmap of allowed actions for the returns macro Modified: trunk/varnish-cache/include/vcl_returns.h =================================================================== --- trunk/varnish-cache/include/vcl_returns.h 2010-07-04 21:44:28 UTC (rev 5005) +++ trunk/varnish-cache/include/vcl_returns.h 2010-07-05 08:27:30 UTC (rev 5006) @@ -8,14 +8,14 @@ */ #ifdef VCL_RET_MAC -VCL_RET_MAC(deliver, DELIVER) -VCL_RET_MAC(error, ERROR) -VCL_RET_MAC(fetch, FETCH) -VCL_RET_MAC(hash, HASH) -VCL_RET_MAC(lookup, LOOKUP) -VCL_RET_MAC(pass, PASS) -VCL_RET_MAC(pipe, PIPE) -VCL_RET_MAC(restart, RESTART) +VCL_RET_MAC(deliver, DELIVER, VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER | VCL_MET_ERROR) +VCL_RET_MAC(error, ERROR, VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH) +VCL_RET_MAC(fetch, FETCH, VCL_MET_MISS) +VCL_RET_MAC(hash, HASH, VCL_MET_HASH) +VCL_RET_MAC(lookup, LOOKUP, VCL_MET_RECV) +VCL_RET_MAC(pass, PASS, VCL_MET_RECV | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH) +VCL_RET_MAC(pipe, PIPE, VCL_MET_RECV | VCL_MET_PIPE) +VCL_RET_MAC(restart, RESTART, VCL_MET_PASS | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER | VCL_MET_ERROR) #endif #ifdef VCL_MET_MAC Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-07-04 21:44:28 UTC (rev 5005) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-07-05 08:27:30 UTC (rev 5006) @@ -607,8 +607,15 @@ l = list(rets.keys()) l.sort() for i in l: - fo.write("VCL_RET_MAC(%s, %s)\n" % (i.lower(), i.upper())) + fo.write("VCL_RET_MAC(%s, %s" % (i.lower(), i.upper())) + s=", " + for j in returns: + if i in j[1]: + fo.write("%sVCL_MET_%s" % (s, j[0].upper())) + s = " | " + fo.write(")\n") fo.write("#endif\n") + fo.write("\n#ifdef VCL_MET_MAC\n") for i in returns: fo.write("VCL_MET_MAC(%s,%s,\n" % (i[0].lower(), i[0].upper())) Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-04 21:44:28 UTC (rev 5005) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-05 08:27:30 UTC (rev 5006) @@ -438,7 +438,7 @@ vcc_NextToken(tl); ExpectErr(tl, ID); -#define VCL_RET_MAC(l, U) \ +#define VCL_RET_MAC(l, U, B) \ do { \ if (vcc_IdIs(tl->t, #l)) { \ Fb(tl, 1, "VRT_done(sp, VCL_RET_" #U ");\n"); \ @@ -497,7 +497,7 @@ } action_table[] = { { "error", parse_error }, -#define VCL_RET_MAC(l, U) \ +#define VCL_RET_MAC(l, U, B) \ { #l, parse_new_syntax }, #include "vcl_returns.h" #undef VCL_RET_MAC Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-04 21:44:28 UTC (rev 5005) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-05 08:27:30 UTC (rev 5006) @@ -665,7 +665,7 @@ { switch (method) { -#define VCL_RET_MAC(l, U) case VCL_RET_##U: return(#l); +#define VCL_RET_MAC(l, U, B) case VCL_RET_##U: return(#l); #include "vcl_returns.h" #undef VCL_RET_MAC default: Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-04 21:44:28 UTC (rev 5005) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-05 08:27:30 UTC (rev 5006) @@ -315,11 +315,10 @@ /* ../../include/vrt_obj.h */ - vsb_cat(sb, "\n/*\n * $Id: vrt_obj.h 5001 2010-07-04 14:40:33Z " - "phk $\n *\n * NB: This file is machine generated, DO NOT " - "EDIT!\n *\n * Edit and run generate.py instead\n */\n" - "struct sockaddr * VRT_r_client_ip(const struct sess *);\n" - "struct sockaddr * VRT_r_server_ip(struct sess *);\n" + vsb_cat(sb, "\n/*\n * $Id$\n *\n * NB: This file is machine " + "generated, DO NOT EDIT!\n *\n * Edit and run generate.py instead" + "\n */\nstruct sockaddr * VRT_r_client_ip(const struct sess " + "*);\nstruct sockaddr * VRT_r_server_ip(struct sess *);\n" "const char * VRT_r_server_hostname(struct sess *);\n" "const char * VRT_r_server_identity(struct sess *);\n" "int VRT_r_server_port(struct sess *);\nconst char * VRT_r_req_re" Modified: trunk/varnish-cache/lib/libvcl/vcc_xref.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-07-04 21:44:28 UTC (rev 5005) +++ trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-07-05 08:27:30 UTC (rev 5006) @@ -272,7 +272,7 @@ u = p->ret_bitmap & ~bitmap; if (u) { /*lint -save -e525 -e539 */ -#define VCL_RET_MAC(l, U) \ +#define VCL_RET_MAC(l, U, B) \ if (u & (1 << (VCL_RET_##U))) { \ vsb_printf(tl->sb, "Invalid return \"" #l "\"\n");\ vcc_ErrWhere(tl, p->return_tok[VCL_RET_##U]); \ @@ -315,7 +315,7 @@ vsb_printf(tl->sb, "\n...which is the \"%s\" method\n", m->name); vsb_printf(tl->sb, "Legal returns are:"); -#define VCL_RET_MAC(l, U) \ +#define VCL_RET_MAC(l, U, B) \ if (m->ret_bitmap & ((1 << VCL_RET_##U))) \ vsb_printf(tl->sb, " \"%s\"", #l); /*lint -save -e525 -e539 */ From phk at varnish-cache.org Mon Jul 5 09:37:53 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 5 Jul 2010 11:37:53 +0200 Subject: r5007 - in trunk/varnish-cache: include lib/libvcl Message-ID: Author: phk Date: 2010-07-05 11:37:53 +0200 (Mon, 05 Jul 2010) New Revision: 5007 Modified: trunk/varnish-cache/include/vcl.h trunk/varnish-cache/lib/libvcl/generate.py 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: Polishing Modified: trunk/varnish-cache/include/vcl.h =================================================================== --- trunk/varnish-cache/include/vcl.h 2010-07-05 08:27:30 UTC (rev 5006) +++ trunk/varnish-cache/include/vcl.h 2010-07-05 09:37:53 UTC (rev 5007) @@ -27,6 +27,8 @@ #define VCL_MET_MAX 9 +#define VCL_MET_MASK 0x1ff + /* VCL Returns */ #define VCL_RET_DELIVER 0 #define VCL_RET_ERROR 1 Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-07-05 08:27:30 UTC (rev 5006) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-07-05 09:37:53 UTC (rev 5007) @@ -650,6 +650,7 @@ n += 1 fo.write("\n#define VCL_MET_MAX\t\t%d\n" % n) +fo.write("\n#define VCL_MET_MASK\t\t0x%x\n" % ((1 << n) - 1)) fo.write("\n/* VCL Returns */\n") Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-05 08:27:30 UTC (rev 5006) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-05 09:37:53 UTC (rev 5007) @@ -114,6 +114,7 @@ { struct method *m; + assert(t->tok == ID); for(m = method_tab; m->name != NULL; m++) { if (vcc_IdIs(t, m->name)) return (m - method_tab); Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-05 08:27:30 UTC (rev 5006) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-05 09:37:53 UTC (rev 5007) @@ -86,8 +86,15 @@ int iindent; int findent; unsigned cnt; - struct vsb *fc, *fh, *fi, *ff, *fb; - struct vsb *fm[VCL_MET_MAX]; + + struct vsb *fc; /* C-code */ + struct vsb *fh; /* H-code (before C-code) */ + struct vsb *fi; /* Init func code */ + struct vsb *ff; /* Finish func code */ + struct vsb *fb; /* Body of current sub + * NULL otherwise + */ + struct vsb *fm[VCL_MET_MAX]; /* Method bodies */ VTAILQ_HEAD(, ref) refs; struct vsb *sb; int err; Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-05 08:27:30 UTC (rev 5006) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-05 09:37:53 UTC (rev 5007) @@ -171,14 +171,15 @@ "#define VCL_MET_HIT\t\t(1U << 5)\n#define VCL_MET_FETCH\t\t" "(1U << 6)\n#define VCL_MET_DELIVER\t\t(1U << 7)\n" "#define VCL_MET_ERROR\t\t(1U << 8)\n\n#define VCL_MET_MAX\t" - "\t9\n\n/* VCL Returns */\n#define VCL_RET_DELIVER\t\t0\n" - "#define VCL_RET_ERROR\t\t1\n#define VCL_RET_FETCH\t\t2\n" - "#define VCL_RET_HASH\t\t3\n#define VCL_RET_LOOKUP\t\t4\n" - "#define VCL_RET_PASS\t\t5\n#define VCL_RET_PIPE\t\t6\n" - "#define VCL_RET_RESTART\t\t7\n\n#define VCL_RET_MAX\t\t8\n" - "\nstruct VCL_conf {\n\tunsigned\tmagic;\n#define VCL_CONF_MAGIC\t" - "0x7406c509\t/* from /dev/random */\n\n\tstruct director\t**direc" - "tor;\n\tunsigned\tndirector;\n\tstruct vrt_ref\t*ref;\n" + "\t9\n\n#define VCL_MET_MASK\t\t0x1ff\n\n/* VCL Returns */\n" + "#define VCL_RET_DELIVER\t\t0\n#define VCL_RET_ERROR\t\t1\n" + "#define VCL_RET_FETCH\t\t2\n#define VCL_RET_HASH\t\t3\n" + "#define VCL_RET_LOOKUP\t\t4\n#define VCL_RET_PASS\t\t5\n" + "#define VCL_RET_PIPE\t\t6\n#define VCL_RET_RESTART\t\t7\n" + "\n#define VCL_RET_MAX\t\t8\n\nstruct VCL_conf {\n" + "\tunsigned\tmagic;\n#define VCL_CONF_MAGIC\t0x7406c509\t/* " + "from /dev/random */\n\n\tstruct director\t**director;\n" + "\tunsigned\tndirector;\n\tstruct vrt_ref\t*ref;\n" "\tunsigned\tnref;\n\tunsigned\tbusy;\n\tunsigned\tdiscard;\n" "\n\tunsigned\tnsrc;\n\tconst char\t**srcname;\n\tconst char\t" "**srcbody;\n\n\tvcl_init_f\t*init_func;\n\tvcl_fini_f\t*fini_fun" From phk at varnish-cache.org Mon Jul 5 10:10:20 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 5 Jul 2010 12:10:20 +0200 Subject: r5008 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-05 12:10:19 +0200 (Mon, 05 Jul 2010) New Revision: 5008 Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_string.c trunk/varnish-cache/lib/libvcl/vcc_xref.c Log: Improve usage restriction messages a little bit. Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-05 09:37:53 UTC (rev 5007) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-05 10:10:19 UTC (rev 5008) @@ -69,7 +69,7 @@ vcc_NextToken(tl); if (tl->t->tok == ID) { - vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read"); + vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "cannot be read"); ERRCHK(tl); assert(vp != NULL); if (vp->fmt == INT) { @@ -120,7 +120,7 @@ vcc_NextToken(tl); ExpectErr(tl, ID); vt = tl->t; - vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "set"); + vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "cannot be set"); ERRCHK(tl); assert(vp != NULL); Fb(tl, 1, "%s", vp->lname); @@ -241,7 +241,7 @@ vcc_NextToken(tl); ExpectErr(tl, ID); - vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "unset"); + vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "cannot be unset"); ERRCHK(tl); assert(vp != NULL); if (vp->fmt != STRING || vp->hdr == NULL) { @@ -529,7 +529,8 @@ for(atp = action_table; atp->name != NULL; atp++) { if (vcc_IdIs(at, atp->name)) { if (atp->bitmask != 0) - vcc_AddUses(tl, at, atp->bitmask, "is"); + vcc_AddUses(tl, at, atp->bitmask, + "not a valid action"); atp->func(tl); return(1); } Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-05 09:37:53 UTC (rev 5007) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-05 10:10:19 UTC (rev 5008) @@ -340,7 +340,7 @@ vcc_Cond_0(tl); SkipToken(tl, ')'); } else if (tl->t->tok == ID) { - vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read"); + vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "cannot be read"); ERRCHK(tl); assert(vp != NULL); vcc_NextToken(tl); Modified: trunk/varnish-cache/lib/libvcl/vcc_string.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-05 09:37:53 UTC (rev 5007) +++ trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-05 10:10:19 UTC (rev 5008) @@ -159,7 +159,7 @@ return 1; } if (tl->t->tok == ID) { - vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "read"); + vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "cannot be read"); if (tl->err) return (0); assert(vp != NULL); Modified: trunk/varnish-cache/lib/libvcl/vcc_xref.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-07-05 09:37:53 UTC (rev 5007) +++ trunk/varnish-cache/lib/libvcl/vcc_xref.c 2010-07-05 10:10:19 UTC (rev 5008) @@ -60,7 +60,7 @@ struct procuse { VTAILQ_ENTRY(procuse) list; - struct token *t; + const struct token *t; unsigned mask; const char *use; }; @@ -217,12 +217,11 @@ { struct procuse *pu; - (void)t; if (tl->curproc == NULL) /* backend */ return; pu = TlAlloc(tl, sizeof *pu); assert(pu != NULL); - pu->t = tl->t; + pu->t = t; pu->mask = mask; pu->use = use; VTAILQ_INSERT_TAIL(&tl->curproc->uses, pu, list); @@ -358,7 +357,7 @@ pu = vcc_FindIllegalUse(p, m); if (pu != NULL) { vsb_printf(tl->sb, - "'%.*s': %s not possible in method '%.*s'.\n", + "'%.*s': %s from method '%.*s'.\n", PF(pu->t), pu->use, PF(p->name)); vcc_ErrWhere(tl, pu->t); vsb_printf(tl->sb, "\n...in subroutine \"%.*s\"\n", @@ -393,7 +392,7 @@ pu = vcc_FindIllegalUse(p, m); if (pu != NULL) { vsb_printf(tl->sb, - "'%.*s': %s not possible in method '%.*s'.", + "'%.*s': %s in method '%.*s'.", PF(pu->t), pu->use, PF(p->name)); vsb_cat(tl->sb, "\nAt: "); vcc_ErrWhere(tl, pu->t); From kristian at varnish-cache.org Mon Jul 5 11:56:03 2010 From: kristian at varnish-cache.org (kristian at varnish-cache.org) Date: Mon, 5 Jul 2010 13:56:03 +0200 Subject: r5009 - in trunk/varnish-cache: doc/sphinx/reference man Message-ID: Author: kristian Date: 2010-07-05 13:56:03 +0200 (Mon, 05 Jul 2010) New Revision: 5009 Removed: trunk/varnish-cache/man/vcl.7so Modified: trunk/varnish-cache/doc/sphinx/reference/vcl.rst trunk/varnish-cache/man/Makefile.am Log: generate vcl.7 from rst, include default.vcl in vcl.rst Modified: trunk/varnish-cache/doc/sphinx/reference/vcl.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/reference/vcl.rst 2010-07-05 10:10:19 UTC (rev 5008) +++ trunk/varnish-cache/doc/sphinx/reference/vcl.rst 2010-07-05 11:56:03 UTC (rev 5009) @@ -583,106 +583,9 @@ .port = "http"; } - sub vcl_recv { - if (req.http.x-forwarded-for) { - set req.http.X-Forwarded-For = req.http.X-Forwarded-For ", " client.ip; - } else { - set req.http.X-Forwarded-For = client.ip; - } - - if (req.request != "GET" && - req.request != "HEAD" && - req.request != "PUT" && - req.request != "POST" && - req.request != "TRACE" && - req.request != "OPTIONS" && - req.request != "DELETE") { - // Non-RFC2616 or CONNECT which is weird. - return (pipe); - } - if (req.request != "GET" && req.request != "HEAD") { - // We only deal with GET and HEAD by default - return (pass); - } - if (req.http.Authorization || req.http.Cookie) { - // Not cacheable by default - return (pass); - } - return (lookup); - } - - sub vcl_pipe { - # Note that only the first request to the backend will have - # X-Forwarded-For set. If you use X-Forwarded-For and want to - # have it set for all requests, make sure to have: - # set req.http.connection = "close"; - # here. It is not set by default as it might break some broken web - # applications, like IIS with NTLM authentication. - return (pipe); - } - - sub vcl_pass { - return (pass); - } +.. include:: ../../../man/default.vcl + :literal: - sub vcl_hash { - set req.hash += req.url; - if (req.http.host) { - set req.hash += req.http.host; - } else { - set req.hash += server.ip; - } - return (hash); - } - - sub vcl_hit { - if (!obj.cacheable) { - return (pass); - } - return (deliver); - } - - sub vcl_miss { - return (fetch); - } - - sub vcl_fetch { - if (!beresp.cacheable) { - return (pass); - } - if (beresp.http.Set-Cookie) { - return (pass); - } - return (deliver); - } - - sub vcl_deliver { - return (deliver); - } - - sub vcl_error { - set obj.http.Content-Type = "text/html; charset=utf-8"; - synthetic {" - - - - - "} obj.status " " obj.response {" - - -

Error "} obj.status " " obj.response {"

-

"} obj.response {"

-

Guru Meditation:

-

XID: "} req.xid {"

-
- Varnish cache server - - - "}; - return (deliver); - } - The following example shows how to support multiple sites running on separate backends in the same Varnish instance, by selecting backends based on the request URL::: Modified: trunk/varnish-cache/man/Makefile.am =================================================================== --- trunk/varnish-cache/man/Makefile.am 2010-07-05 10:10:19 UTC (rev 5008) +++ trunk/varnish-cache/man/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) @@ -1,11 +1,20 @@ # $Id$ -EXTRA_DIST = vcl.7so DISTCLEANFILES = vcl.7 default.vcl +if HAVE_RST2MAN dist_man_MANS = vcl.7 +endif -vcl.7: vcl.7so default.vcl Makefile - soelim $(srcdir)/vcl.7so > $@ default.vcl: $(top_srcdir)/bin/varnishd/default.vcl Makefile sed -n '/vcl_recv/,$$p' $(top_srcdir)/bin/varnishd/default.vcl > $@ + +vcl.7: ../doc/sphinx/reference/vcl.rst default.vcl +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/man/vcl.7so =================================================================== --- trunk/varnish-cache/man/vcl.7so 2010-07-05 10:10:19 UTC (rev 5008) +++ trunk/varnish-cache/man/vcl.7so 2010-07-05 11:56:03 UTC (rev 5009) @@ -1,752 +0,0 @@ -.\"- -.\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2009 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: -.\" 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$ -.\" -.Dd August 10, 2007 -.Dt VCL 7 -.Os -.Sh NAME -.Nm VCL -.Nd Varnish Configuration Language -.Sh DESCRIPTION -The -.Nm -language is a small domain-specific language designed to be used to -define request handling and document caching policies for the Varnish -HTTP accelerator. -.Pp -When a new configuration is loaded, the -.Nm varnishd -management process translates the VCL code to C and compiles it to a -shared object which is then dynamically linked into the server -process. -.Ss Syntax -The VCL syntax is very simple, and deliberately similar to C and Perl. -Blocks are delimited by curly braces, statements end with semicolons, -and comments may be written as in C, C++ or Perl according to your own -preferences. -.Pp -In addition to the C-like assignment (=), comparison (==) and boolean -(!, && and ||) operators, VCL supports regular expression and ACL -matching using the ~ operator. -.Pp -Unlike C and Perl, the backslash (\e) character has no special meaning -in strings in VCL, which use the (%xx) escape mechanism just like URLs, -so it can be freely used in regular expressions without doubling. -.Pp -Strings are concatenated by just putting them one after each other -without any operator in between. -.Pp -Assignments are introduced with the -.Cm set -keyword. -There are no user-defined variables; values can only be assigned to -variables attached to backend, request or document objects. -Most of these are typed, and the values assigned to them must have a -compatible unit suffix. -.Pp -VCL has -.Cm if -tests, but no loops. -.Pp -The contents of another VCL file may be inserted at any point in the -code by using the -.Cm include -keyword followed by the name of the other file as a quoted string. -.Ss Backend declarations -A backend declaration creates and initializes a named backend object: -.Bd -literal -offset 4n -backend www { - .host = "www.example.com"; - .port = "http"; -} -.Ed -.Pp -The backend object can later be used to select a backend at request -time: -.Bd -literal -offset 4n -if (req.http.host ~ "^(www\.)?example.com$") { - set req.backend = www; -} -.Ed -.Pp -To avoid overloading backend servers, -.Fa .max_connections -can be set to limit the maximum number of concurrent backend connections. -.Pp -The timeout parameters can be overridden in the backend declaration. -The timeout parameters are -.Fa .connect_timeout -for the time to wait for a backend connection, -.Fa .first_byte_timeout -for the time to wait for the first byte from the backend and -.Fa .between_bytes_timeout -for time to wait between each received byte. -.Pp -These can be set in the declaration like this: -.Bd -literal -offset 4n -backend www { - .host = "www.example.com"; - .port = "http"; - .connect_timeout = 1s; - .first_byte_timeout = 5s; - .between_bytes_timeout = 2s; -} -.Ed -.Pp -To mark a backend as unhealthy after number of items have been added to -it's saintmode list -.Fa .saintmode_threshold -can be set to the maximum list size. Setting a value of 0 disables -saintmode checking entirely for that backend. The value in the backend -declaration overrides the parameter. -.Ss Directors -Directors choose from different backends based on health status and a -per-director algorithm. -There currently exists a round-robin and a random director. -.Pp -Directors are defined using: -.Bd -literal -offset 4n -director b2 random { - .retries = 5; - { - /* We can refer to named backends */ - .backend = b1; - .weight = 7; - } - { - /* Or define them inline */ - .backend = { - .host = "fs2"; - } - .weight = 3; - } -} -.Ed -.Ss The random director -The random director takes one per-director option -.Fa .retries . -This specifies how many tries it will use to find a working backend. -The default is the same as the number of backends defined for the -director. -.Pp -There is also a per-backend option: weight which defines the portion -of traffic to send to the particular backend. -.Ss The round-robin director -The round-robin does not take any options. -.Ss Backend probes -Backends can be probed to see whether they should be considered -healthy or not. The return status can also be checked by using -.Fa req.backend.healthy -. -.Fa .window -is how many of the latest polls we examine, while -.Fa .threshold -is how many of those must have succeeded for us to consider the -backend healthy. -.Fa .initial -is how many of the probes are considered good when Varnish starts - -defaults to the same amount as the threshold. -.Bd -literal -offset 4n -backend www { - .host = "www.example.com"; - .port = "http"; - .probe = { - .url = "/test.jpg"; - .timeout = 0.3 s; - .window = 8; - .threshold = 3; - .initial = 3; - } -} -.Ed -It is also possible to specify the raw HTTP request. -.Bd -literal -offset 4n -backend www { - .host = "www.example.com"; - .port = "http"; - .probe = { - # NB: \er\en automatically inserted after each string! - .request = - "GET / HTTP/1.1" - "Host: www.foo.bar" - "Connection: close"; - } -} -.Ed -.Ss ACLs -An ACL declaration creates and initializes a named access control list -which can later be used to match client addresses: -.Bd -literal -offset 4n -acl local { - "localhost"; /* myself */ - "192.0.2.0"/24; /* and everyone on the local network */ - ! "192.0.2.23"; /* except for the dialin router */ -} -.Ed -.Pp -If an ACL entry specifies a host name which Varnish is unable to -resolve, it will match any address it is compared to. -Consequently, if it is preceded by a negation mark, it will reject any -address it is compared to, which may not be what you intended. -If the entry is enclosed in parentheses, however, it will simply be -ignored. -.Pp -To match an IP address against an ACL, simply use the match operator: -.Bd -literal -offset 4n -if (client.ip ~ local) { - pipe; -} -.Ed -.Ss Grace -If the backend takes a long time to generate an object there is a risk -of a thread pile up. -In order to prevent this you can enable grace. -This allows varnish to serve an expired version of the object while a -fresh object is being generated by the backend. -.Pp -The following vcl code will make Varnish serve expired objects. -All object will be kept up to two minutes past their expiration time -or a fresh object is generated. -.Bd -literal -offset 4n -sub vcl_recv { - set req.grace = 2m; -} -sub vcl_fetch { - set obj.grace = 2m; -} -.Ed -.Ss Functions -The following built-in functions are available: -.Bl -tag -width indent -.It Fn regsub "str" "regex" "sub" -Returns a copy of -.Fa str -with the first occurrence of the regular expression -.Fa regex -replaced with -.Fa sub . -Within -.Fa sub , -.Va \e0 -(which can also be spelled -.Va & ) -is replaced with the entire matched string, and -.Va \en -is replaced with the contents of subgroup -.Ar n -in the matched string. -.It Fn regsuball "str" "regex" "sub" -As -.Fn regsuball -but this replaces all occurrences. -.It Fn purge_url "regex" -Purge all objects in cache whose URLs match -.Fa regex . -.El -.Ss Subroutines -A subroutine is used to group code for legibility or reusability: -.Bd -literal -offset 4n -sub pipe_if_local { - if (client.ip ~ local) { - pipe; - } -} -.Ed -.Pp -Subroutines in VCL do not take arguments, nor do they return values. -.Pp -To call a subroutine, use the -.Cm call -keyword followed by the subroutine's name: -.Bd -literal -offset 4n -call pipe_if_local; -.Ed -.Pp -There are a number of special subroutines which hook into the Varnish -workflow. -These subroutines may inspect and manipulate HTTP headers and various -other aspects of each request, and to a certain extent decide how the -request should be handled. -Each subroutine terminates by calling one of a small number of -keywords which indicates the desired outcome. -.Bl -tag -width indent -.\" vcl_recv -.It Cm vcl_recv -Called at the beginning of a request, after the complete request has -been received and parsed. -Its purpose is to decide whether or not to serve the request, how to -do it, and, if applicable, which backend to use. -.Pp -The -.Cm vcl_recv -subroutine may terminate with one of the following keywords: -.Bl -tag -width indent -.It Cm error Ar code Op Ar reason -Return the specified error code to the client and abandon the -request. -.It Cm pass -Switch to pass mode. -Control will eventually pass to -.Cm vcl_pass . -.It Cm pipe -Switch to pipe mode. -Control will eventually pass to -.Cm vcl_pipe . -.It Cm lookup -Look up the requested object in the cache. -Control will eventually pass to -.Cm vcl_hit -or -.Cm vcl_miss , -depending on whether the object is in the cache. -.El -.\" vcl_pipe -.It Cm vcl_pipe -Called upon entering pipe mode. -In this mode, the request is passed on to the backend, and any further -data from either client or backend is passed on unaltered until either -end closes the connection. -.Pp -The -.Cm vcl_pipe -subroutine may terminate with one of the following keywords: -.Bl -tag -width indent -.It Cm error Ar code Op Ar reason -Return the specified error code to the client and abandon the -request. -.It Cm pipe -Proceed with pipe mode. -.El -.\" vcl_pass -.It Cm vcl_pass -Called upon entering pass mode. -In this mode, the request is passed on to the backend, and the -backend's response is passed on to the client, but is not entered into -the cache. -Subsequent requests submitted over the same client connection are -handled normally. -.Pp -The -.Cm vcl_pass -subroutine may terminate with one of the following keywords: -.Bl -tag -width indent -.It Cm error Ar code Op Ar reason -Return the specified error code to the client and abandon the -request. -.It Cm pass -Proceed with pass mode. -.El -.\" vcl_hash -.It Cm vcl_hash -Use -.Cm req.hash += req.http.Cookie -or similar to include the Cookie HTTP header in the hash string. -The -.Cm vcl_hash -subroutine may terminate with one of the following keywords: -.Bl -tag -width indent -.It Cm hash -Proceed. -.El -.\" vcl_hit -.It Cm vcl_hit -Called after a cache lookup if the requested document was found in the -cache. -.Pp -The -.Cm vcl_hit -subroutine may terminate with one of the following keywords: -.Bl -tag -width indent -.It Cm error Ar code Op Ar reason -Return the specified error code to the client and abandon the -request. -.It Cm pass -Switch to pass mode. -Control will eventually pass to -.Cm vcl_pass . -.It Cm deliver -Deliver the cached object to the client. -Control will eventually pass to -.Cm vcl_deliver . -.El -.\" vcl_miss -.It Cm vcl_miss -Called after a cache lookup if the requested document was not found in -the cache. -Its purpose is to decide whether or not to attempt to retrieve the -document from the backend, and which backend to use. -.Pp -The -.Cm vcl_miss -subroutine may terminate with one of the following keywords: -.Bl -tag -width indent -.It Cm error Ar code Op Ar reason -Return the specified error code to the client and abandon the -request. -.It Cm pass -Switch to pass mode. -Control will eventually pass to -.Cm vcl_pass . -.It Cm fetch -Retrieve the requested object from the backend. -Control will eventually pass to -.Cm vcl_fetch . -.El -.\" vcl_fetch -.It Cm vcl_fetch -Called after a document has been successfully retrieved from the -backend. -.Pp -The -.Cm vcl_fetch -subroutine may terminate with one of the following keywords: -.Bl -tag -width indent -.It Cm error Ar code Op Ar reason -Return the specified error code to the client and abandon the -request. -.It Cm pass -Switch to pass mode. -Control will eventually pass to -.Cm vcl_pass . -.It Cm deliver -Possibly insert the object into the cache, then deliver it to the client. -Control will eventually pass to -.Cm vcl_deliver . -.It Cm esi -ESI-process the document which has just been fetched. -.El -.\" vcl_deliver -.It Cm vcl_deliver -Called before a cached object is delivered to the client. -.Pp -The -.Cm vcl_deliver -subroutine may terminate with one of the following keywords: -.Bl -tag -width indent -.It Cm error Ar code Op Ar reason -Return the specified error code to the client and abandon the -request. -.It Cm deliver -Deliver the object to the client. -.El -.El -.Pp -If one of these subroutines is left undefined or terminates without -reaching a handling decision, control will be handed over to the -builtin default. -See the -.Sx EXAMPLES -section for a listing of the default code. -.Ss Multiple subroutines -If multiple subroutines with the same name are defined, they are -concatenated in the order in which the appear in the source. -.Pp -Example: -.Bd -literal -offset 4n -# in file "main.vcl" -include "backends.vcl"; -include "purge.vcl"; - -# in file "backends.vcl" -sub vcl_recv { - if (req.http.host ~ "example.com") { - set req.backend = foo; - } elsif (req.http.host ~ "example.org") { - set req.backend = bar; - } -} - -# in file "purge.vcl" -sub vcl_recv { - if (client.ip ~ admin_network) { - if (req.http.Cache-Control ~ "no-cache") { - purge_url(req.url); - } - } -} -.Ed -.Pp -The builtin default subroutines are implicitly appended in this way. -.Ss Variables -Although subroutines take no arguments, the necessary information is -made available to the handler subroutines through global variables. -.Pp -The following variables are always available: -.Bl -tag -width 4n -.It Va now -The current time, in seconds since the epoch. -.El -.Pp -The following variables are available in backend declarations: -.Bl -tag -width 4n -.It Va .host -Host name or IP address of a backend. -.It Va .port -Service name or port number of a backend. -.El -.Pp -The following variables are available while processing a request: -.Bl -tag -width 4n -.It Va client.ip -The client's IP address. -.It Va server.hostname -The host name of the server. -.It Va server.identity -The identity of the server, as set by the -.Fl i -parameter. -If the -.Fl i -parameter is not passed to -.Nm varnishd , -.Va server.identity -will be set to the name of the instance, as specified by the -.Fl n -parameter. -.It Va server.ip -The IP address of the socket on which the client connection was -received. -.It Va server.port -The port number of the socket on which the client connection was -received. -.It Va req.request -The request type (e.g. "GET", "HEAD"). -.It Va req.url -The requested URL. -.It Va req.proto -The HTTP protocol version used by the client. -.It Va req.backend -The backend to use to service the request. -.It Va req.backend.healthy -Whether the backend is healthy or not. -.It Va req.http. Ns Ar header -The corresponding HTTP -.Ar header . -.El -.Pp -The following variables are available while preparing a backend -request (either for a cache miss or for pass or pipe mode): -.Bl -tag -width 4n -.It Va bereq.request -The request type (e.g. "GET", "HEAD"). -.It Va bereq.url -The requested URL. -.It Va bereq.proto -The HTTP protocol version used to talk to the server. -.It Va bereq.http. Ns Ar header -The corresponding HTTP -.Ar header . -.It Va bereq.connect_timeout -The time in seconds to wait for a backend connection. -.It Va bereq.first_byte_timeout -The time in seconds to wait for the first byte from the backend. -Not available in pipe mode. -.It Va bereq.between_bytes_timeout -The time in seconds to wait between each received byte from the backend. -Not available in pipe mode. -.El -.Pp -The following variables are available after the requested object has -been retrieved from cache or from the backend: -.Bl -tag -width 4n -.It Va obj.proto -The HTTP protocol version used when the object was retrieved. -.It Va obj.status -The HTTP status code returned by the server. -.It Va obj.response -The HTTP status message returned by the server. -.It Va obj.cacheable -True if the request resulted in a cacheable response. -.\" see cache_center.c and rfc2616.c for details -A response is considered cacheable if it is valid (see above), and the -HTTP status code is 200, 203, 300, 301, 302, 404 or 410. -.It Va obj.ttl -The object's remaining time to live, in seconds. -.It Va obj.lastuse -The approximate time elapsed since the object was last requests, in -seconds. -.It Va obj.hits -The approximate number of times the object has been delivered. A value of 0 -indicates a cache miss. -.El -.Pp -The following variables are available while determining the hash key -of an object: -.Bl -tag -width 4n -.It Va req.hash -The hash key used to refer to an object in the cache. Used when both -reading from and writing to the cache. -.El -.Pp -The following variables are available while preparing a response to -the client: -.Bl -tag -width 4n -.It Va resp.proto -The HTTP protocol version to use for the response. -.It Va resp.status -The HTTP status code that will be returned. -.It Va resp.response -The HTTP status message that will be returned. -.It Va resp.http. Ns Ar header -The corresponding HTTP -.Ar header . -.El -.Pp -Values may be assigned to variables using the -.Cm set -keyword: -.Bd -literal -offset 4n -sub vcl_recv { - # Normalize the Host: header - if (req.http.host ~ "^(www\.)?example\.com$") { - set req.http.host = "www.example.com"; - } -} -.Ed -.Pp -HTTP headers can be removed entirely using the -.Cm remove -keyword: -.Bd -literal -offset 4n -sub vcl_fetch { - # Don't cache cookies - remove obj.http.Set-Cookie; -} -.Ed -.Sh EXAMPLES -The following code is the equivalent of the default configuration with -the backend address set to "backend.example.com" and no backend port -specified. -.\" Keep this in synch with bin/varnishd/mgt_vcc.c and etc/default.vcl -.Bd -literal -offset 4n -backend default { - .host = "backend.example.com"; - .port = "http"; -} - -.so default.vcl -.Ed -.Pp -The following example shows how to support multiple sites running on -separate backends in the same Varnish instance, by selecting backends -based on the request URL. -.Bd -literal -offset 4n -backend www { - .host = "www.example.com"; - .port = "80"; -} - -backend images { - .host = "images.example.com"; - .port = "80"; -} - -sub vcl_recv { - if (req.http.host ~ "^(www\.)?example\.com$") { - set req.http.host = "www.example.com"; - set req.backend = www; - } elsif (req.http.host ~ "^images\.example\.com$") { - set req.backend = images; - } else { - error 404 "Unknown virtual host"; - } -} -.Ed -.Pp -The following snippet demonstrates how to force a minimum TTL for all -documents. -Note that this is not the same as setting the -.Va default_ttl -run-time parameter, as that only affects document for which the -backend did not specify a TTL. -.Bd -literal -offset 4n -sub vcl_fetch { - if (obj.ttl < 120s) { - set obj.ttl = 120s; - } -} -.Ed -.Pp -The following snippet demonstrates how to force Varnish to cache -documents even when cookies are present. -.Bd -literal -offset 4n -sub vcl_recv { - if (req.request == "GET" && req.http.cookie) { - lookup; - } -} - -sub vcl_fetch { - if (obj.http.Set-Cookie) { - deliver; - } -} -.Ed -.Pp -The following code implements the HTTP PURGE method as used by Squid -for object invalidation: -.Bd -literal -offset 4n -acl purge { - "localhost"; - "192.0.2.1"/24; -} - -sub vcl_recv { - if (req.request == "PURGE") { - if (!client.ip ~ purge) { - error 405 "Not allowed."; - } - lookup; - } -} - -sub vcl_hit { - if (req.request == "PURGE") { - set obj.ttl = 0s; - error 200 "Purged."; - } -} - -sub vcl_miss { - if (req.request == "PURGE") { - error 404 "Not in cache."; - } -} -.Ed -.Sh SEE ALSO -.Xr varnishd 1 -.Sh HISTORY -The -.Nm -language was developed by -.An Poul-Henning Kamp Aq phk at phk.freebsd.dk -in cooperation with Verdens Gang AS and Linpro AS. -This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des at des.no . From kristian at varnish-cache.org Mon Jul 5 11:56:09 2010 From: kristian at varnish-cache.org (kristian at varnish-cache.org) Date: Mon, 5 Jul 2010 13:56:09 +0200 Subject: r5010 - in trunk/varnish-cache: . bin/varnishadm bin/varnishd bin/varnishhist bin/varnishlog bin/varnishncsa bin/varnishreplay bin/varnishsizes bin/varnishstat bin/varnishtest bin/varnishtop doc/sphinx/reference Message-ID: Author: kristian Date: 2010-07-05 13:56:09 +0200 (Mon, 05 Jul 2010) New Revision: 5010 Removed: trunk/varnish-cache/bin/varnishadm/varnishadm.1 trunk/varnish-cache/bin/varnishd/varnishd.1 trunk/varnish-cache/bin/varnishhist/varnishhist.1 trunk/varnish-cache/bin/varnishlog/varnishlog.1 trunk/varnish-cache/bin/varnishncsa/varnishncsa.1 trunk/varnish-cache/bin/varnishreplay/varnishreplay.1 trunk/varnish-cache/bin/varnishsizes/varnishsizes.1 trunk/varnish-cache/bin/varnishstat/varnishstat.1 trunk/varnish-cache/bin/varnishtest/varnishtest.1 trunk/varnish-cache/bin/varnishtop/varnishtop.1 Modified: trunk/varnish-cache/bin/varnishadm/Makefile.am trunk/varnish-cache/bin/varnishd/Makefile.am trunk/varnish-cache/bin/varnishhist/Makefile.am trunk/varnish-cache/bin/varnishlog/Makefile.am trunk/varnish-cache/bin/varnishncsa/Makefile.am trunk/varnish-cache/bin/varnishreplay/Makefile.am trunk/varnish-cache/bin/varnishsizes/Makefile.am trunk/varnish-cache/bin/varnishstat/Makefile.am trunk/varnish-cache/bin/varnishtest/Makefile.am trunk/varnish-cache/bin/varnishtop/Makefile.am trunk/varnish-cache/configure.ac trunk/varnish-cache/doc/sphinx/reference/varnishadm.rst trunk/varnish-cache/doc/sphinx/reference/varnishd.rst trunk/varnish-cache/doc/sphinx/reference/varnishhist.rst trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst Log: generate section 1 man pages from rst fix some rst2man rendering issues Modified: trunk/varnish-cache/bin/varnishadm/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishadm/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishadm/Makefile.am 2010-07-05 11:56:09 UTC (rev 5010) @@ -4,7 +4,9 @@ bin_PROGRAMS = varnishadm +if HAVE_RST2MAN dist_man_MANS = varnishadm.1 +endif varnishadm_SOURCES = \ varnishadm.c @@ -14,3 +16,13 @@ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ ${PTHREAD_LIBS} ${NET_LIBS} + +%.1: ../../doc/sphinx/reference/%.rst +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/bin/varnishadm/varnishadm.1 =================================================================== --- trunk/varnish-cache/bin/varnishadm/varnishadm.1 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishadm/varnishadm.1 2010-07-05 11:56:09 UTC (rev 5010) @@ -1,109 +0,0 @@ -.\"- -.\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2009 Linpro AS -.\" All rights reserved. -.\" -.\" Author: Cecilie Fritzvold -.\" -.\" 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$ -.\" -.Dd January 31, 2008 -.Dt VARNISHADM 1 -.Os -.Sh NAME -.Nm varnishadm -.Nd Control a running varnish instance -.Sh SYNOPSIS -.Nm -.Op Fl t Ar timeout -.Op Fl S Ar secret_file -.Fl T Ar address Ns : Ns Ar port -.Op Cm command Op Ar ... -.Sh DESCRIPTION -The -.Nm -utility establishes a CLI connection using the -.Fl T -and -.Fl S -arguments. -.Pp -If a -.Cm command -is given, the command and arguments are sent over the -CLI connection and the result returned on stdout. -.Pp -If no -.Cm command -argument is given -.Nm -will pass commands and replies between the CLI socket and -stdin/stdout. -.Pp -The following options are available: -.Bl -tag -width Fl -.It Fl t Ar timeout -Wait no longer than this many seconds for an operation to finish. -.It Fl S Ar secret_file -Specify the authentication secret file. -.Pp -This should be the same -S argument as was given to -.Nm varnishd . -.Pp -Only processes which can read the contents of this file, will be able -to authenticate the CLI connection. -.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 -If a -.Cm command -is given, -the exit status of the -.Nm -utility is zero if the command succeeded, and non-zero otherwise. -.Sh EXAMPLES -Some ways you can use varnishadm: -.Pp -.Dl varnishadm -T localhost:999 -S /var/db/secret vcl.use foo -.Pp -.Dl echo vcl.use foo | varnishadm -T localhost:999 -S /var/db/secret -.Pp -.Dl echo vcl.use foo | ssh vhost varnishadm -T localhost:999 -S /var/db/secret -.Sh SEE ALSO -.Xr varnishd 1 -.Sh HISTORY -The -.Nm -utility and this manual page were written by -.An Cecilie Fritzvold Aq cecilihf at linpro.no . Modified: trunk/varnish-cache/bin/varnishd/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishd/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishd/Makefile.am 2010-07-05 11:56:09 UTC (rev 5010) @@ -4,7 +4,9 @@ sbin_PROGRAMS = varnishd +if HAVE_RST2MAN dist_man_MANS = varnishd.1 +endif varnishd_SOURCES = \ cache_acceptor.c \ @@ -100,3 +102,13 @@ # Explicitly record dependency mgt_vcc.c: default_vcl.h + +%.1: ../../doc/sphinx/reference/%.rst +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/bin/varnishd/varnishd.1 =================================================================== --- trunk/varnish-cache/bin/varnishd/varnishd.1 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishd/varnishd.1 2010-07-05 11:56:09 UTC (rev 5010) @@ -1,1364 +0,0 @@ -.\"- -.\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2010 Redpill 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: -.\" 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$ -.\" -.Dd February 17, 2008 -.Dt VARNISHD 1 -.Os -.Sh NAME -.Nm varnishd -.Nd HTTP accelerator daemon -.Sh SYNOPSIS -.Nm -.Oo Fl a Ar address Ns -.Op : Ns Ar port -.Oc -.Oo Fl b Ar host Ns -.Op : Ns Ar port -.Oc -.Op Fl d -.Op Fl F -.Op Fl f Ar config -.Op Fl g Ar group -.Oo Fl h Ar type Ns -.Op , Ns Ar options -.Oc -.Op Fl i Ar identity -.Op Fl l Ar shmlogsize -.Op Fl n Ar name -.Op Fl P Ar file -.Op Fl p Ar param Ns = Ns Ar value -.Oo Fl s Ar type Ns -.Op , Ns Ar options -.Oc -.Oo Fl T Ar address Ns -.Op : Ns Ar port -.Oc -.Op Fl t Ar ttl -.Op Fl u Ar user -.Op Fl V -.Oo Fl w Ar min Ns -.Oo , Ns Ar max Ns -.Op , Ns Ar timeout -.Oc Oc -.Sh DESCRIPTION -The -.Nm -daemon accepts HTTP requests from clients, passes them on to a backend -server and caches the returned documents to better satisfy future -requests for the same document. -.Pp -The following options are available: -.Bl -tag -width Fl -.It Fl a Ar address Ns Xo -.Op : Ns Ar port Ns -.Oo , Ns Ar address Ns -.Op : Ns Ar port Ns -.Oc -.Op ... -.Xc -Listen for client requests on the specified -.Ar address -and -.Ar port . -The -.Ar address -can be a host name -.Pq Dq localhost , -an IPv4 dotted-quad -.Pq Dq 127.0.0.1 , -or an IPv6 address enclosed in square brackets -.Pq Dq [::1] . -If -.Ar address -is not specified, -.Nm -will listen on all available IPv4 and IPv6 interfaces. -If -.Ar port -is not specified, the default HTTP port as listed in -.Pa /etc/services -is used. -Multiple listening addresses and ports can be specified as a -whitespace- or comma-separated list. -.It Fl b Ar host Ns Xo -.Op : Ns Ar port -.Xc -Use the specified -.Ar host -as backend server. -If -.Ar port -is not specified, the default is 8080. -.It Fl d -Enables debugging mode: -The parent process runs in the foreground with a CLI connection on -stdin/stdout, and the child process must -be started explicitly with a CLI command. -Terminating the parent process will also terminate the child. -.It Fl F -Run in the foreground. -.It Fl f Ar config -Use the specified VCL configuration file instead of the builtin -default. -See -.Xr vcl 7 -for details on VCL syntax. -.It Fl g Ar group -Specifies the name of an unprivileged group to which the child process -should switch before it starts accepting connections. -This is a shortcut for specifying the -.Va group -run-time parameter. -.It Fl h Ar type Ns Xo -.Op , Ns Ar options -.Xc -Specifies the hash algorithm. -See -.Sx Hash Algorithms -for a list of supported algorithms. -.It Fl i Ar identity -Specify the identity of the varnish server. This can be accessed -using -.Va server.identity -from VCL -.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 Ar name -Specify a name for this instance. -Amonst other things, this name is used to construct the name of the -directory in which -.Nm -keeps temporary files and persistent state. -If the specified name begins with a forward slash, it is interpreted -as the absolute path to the directory which should be used for this -purpose. -.It Fl P Ar file -Write the process's PID to the specified -.Ar file . -.It Fl p Ar param Ns = Ns Ar value -Set the parameter specified by -.Ar param -to the specified -.Ar value . -See -.Sx Run-Time Parameters -for a list of parameters. -.It Fl S Ar file -Path to a file containing a secret used for authorizing access to the -management port. -.It Fl s Ar type Ns Xo -.Op , Ns Ar options -.Xc -Use the specified storage backend. -See -.Sx Storage Types -for a list of supported storage types. -This option can be used multiple times to specify multiple storage -files. -.It Fl T Ar address Ns Xo -.Op : Ns Ar port -.Xc -Offer a management interface on the specified -.Ar address -and -.Ar port . -See -.Sx Management Interface -for a list of management commands. -.It Fl t Ar ttl -Specifies a hard minimum time to live for cached documents. -This is a shortcut for specifying the -.Va default_ttl -run-time parameter. -.It Fl u Ar user -Specifies the name of an unprivileged user to which the child process -should switch before it starts accepting connections. -This is a shortcut for specifying the -.Va user -run-time parameter. -.Pp -If specifying both a user and a group, the user should be specified -first. -.It Fl V -Display the version number and exit. -.It Fl w Ar min Ns Xo -.Oo , Ns Ar max Ns -.Op , Ns Ar timeout -.Oc -.Xc -Start at least -.Ar min -but no more than -.Ar max -worker threads with the specified idle timeout. -This is a shortcut for specifying the -.Va thread_pool_min , -.Va thread_pool_max -and -.Va thread_pool_timeout -run-time parameters. -.Pp -If only one number is specified, -.Va thread_pool_min -and -.Va thread_pool_max -are both set to this number, and -.Va thread_pool_timeout -has no effect. -.El -.Ss Hash Algorithms -The following hash algorithms are available: -.Bl -tag -width 4n -.It Cm simple_list -A simple doubly-linked list. -Not recommended for production use. -.It Cm classic Ns Xo -.Op Ns , Ns Ar buckets -.Xc -A standard hash table. -This is the default. -.Pp -The hash key is the CRC32 of the object's URL modulo the size of the -hash table. -Each table entry points to a list of elements which share the same -hash key. -.Pp -The -.Ar buckets -parameter specifies the number of entries in the hash table. -The default is 16383. -.El -.Ss Storage Types -The following storage types are available: -.Bl -tag -width 4n -.It Cm malloc Ns Xo -.Op Ns , Ns Ar size Ns -.Xc -Storage for each object is allocated with -.Xr malloc 3 . -.Pp -The -.Ar size -parameter specifies the maximum amount of memory varnishd will allocate. -The size is assumed to be in bytes, unless followed by one of the -following suffixes: -.Bl -tag -width indent -.It K, k -The size is expressed in kibibytes. -.It M, m -The size is expressed in mebibytes. -.It G, g -The size is expressed in gibibytes. -.It T, t -The size is expressed in tebibytes. -.El -.Pp -The default size is unlimited. -.It Cm file Ns Xo -.Oo Ns , Ns Ar path Ns -.Oo Ns , Ns Ar size Ns -.Op Ns , Ns Ar granularity -.Oc Oc -.Xc -Storage for each object is allocated from an arena backed by a file. -This is the default. -.Pp -The -.Ar path -parameter specifies either the path to the backing file or the path to -a directory in which -.Nm -will create the backing file. -The default is -.Pa /tmp . -.Pp -The -.Ar size -parameter specifies the size of the backing file. -The size is assumed to be in bytes, unless followed by one of the -following suffixes: -.Bl -tag -width indent -.It K, k -The size is expressed in kibibytes. -.It M, m -The size is expressed in mebibytes. -.It G, g -The size is expressed in gibibytes. -.It T, t -The size is expressed in tebibytes. -.It % -The size is expressed as a percentage of the free space on the file -system where it resides. -.El -.Pp -The default size is 50%. -.Pp -If the backing file already exists, it will be truncated or expanded -to the specified size. -.Pp -Note that if -.Nm -has to create or expand the file, it will not pre-allocate the added -space, leading to fragmentation, which may adversely impact -performance. -Pre-creating the storage file using -.Xr dd 1 -will reduce fragmentation to a minimum. -.Pp -The -.Ar granularity -parameter specifies the granularity of allocation. -All allocations are rounded up to this size. -The size is assumed to be in bytes, unless followed by one of the -suffixes described for -.Ar size -except for %. -.Pp -The default size is the VM page size. -The size should be reduced if you have many small objects. -.El -.Ss Management Interface -If the -.Fl T -option was specified, -.Nm -will offer a command-line management interface on the specified -address and port. -The following commands are available: -.Bl -tag -width 4n -.It Cm help Op Ar command -Display a list of available commands. -.Pp -If the -.Ar command -is specified, display help for this command. -.It Cm param.set Ar param Ar value -Set the parameter specified by -.Ar param -to the specified -.Ar value . -See -.Sx Run-Time Parameters -for a list of parameters. -.It Xo -.Cm param.show -.Op Fl l -.Op Ar param -.Xc -Display a list if run-time parameters and their values. -.Pp -If the -.Fl l -option is specified, the list includes a brief explanation of each -parameter. -.Pp -If a -.Ar param -is specified, display only the value and explanation for this -parameter. -.It Cm ping Op Ns Ar timestamp -Ping the Varnish cache process, keeping the connection alive. -.It Cm purge Ar field Ar operator Ar argument Xo -.Oo && Ar field Ar operator Ar argument Oo ... -.Oc Oc -.Xc -Immediately invalidate all documents matching the purge expression. -See -.Va Purge expressions -for more documentation and examples. -.It Cm purge.list -Display the purge list. -.Pp -All requests for objects from the cache are matched against items on -the purge list. -If an object in the cache is older than a matching purge list item, it -is considered -.Qq purged , -and will be fetched from the backend instead. -.Pp -When a purge expression is older than all the objects in the cache, it -is removed from the list. -.It Cm purge.url Ar regexp -Immediately invalidate all documents whose URL matches the specified -regular expression. -.It Cm quit -Close the connection to the varnish admin port. -.It Cm start -Start the Varnish cache process if it is not already running. -.It Cm stats -Show summary statistics. -.Pp -All the numbers presented are totals since server startup; for a -better idea of the current situation, use the -.Xr varnishstat 1 -utility. -.It Cm status -Check the status of the Varnish cache process. -.It Cm stop -Stop the Varnish cache process. -.It Cm url.purge Ar regexp -Deprecated, see -.Cm purge.url -instead. -.It Cm vcl.discard Ar configname -Discard the configuration specified by -.Ar configname . -This will have no effect if the specified configuration has a non-zero -reference count. -.It Cm vcl.inline Ar configname Ar vcl -Create a new configuration named -.Ar configname -with the VCL code specified by -.Ar vcl , -which must be a quoted string. -.It Cm vcl.list -List available configurations and their respective reference counts. -The active configuration is indicated with an asterisk ("*"). -.It Cm vcl.load Ar configname Ar filename -Create a new configuration named -.Ar configname -with the contents of the specified file. -.It Cm vcl.show Ar configname -Display the source code for the specified configuration. -.It Cm vcl.use Ar configname -Start using the configuration specified by -.Ar configname -for all new requests. -Existing requests will continue using whichever configuration was in -use when they arrived. -.El -.Ss Run-Time Parameters -.Pp -Runtime parameters are marked with shorthand flags to avoid repeating -the same text over and over in the table below. -The meaning of the flags are: -.Bl -tag -width 4n -.It Va experimental -We have no solid information about good/bad/optimal values for this -parameter. -Feedback with experience and observations are most welcome. -.It Va delayed -This parameter can be changed on the fly, but will not take effect -immediately. -.It Va restart -The worker process must be stopped and restarted, before this parameter -takes effect. -.It Va reload -The VCL programs must be reloaded for this parameter to take effect. -.El -.Pp -Here is a list of all parameters, current as of last time we remembered -to update the manual page. -This text is produced from the same text you will find in the CLI -if you use the -.Cm param.show -command, so should there be a new parameter which is not listed here, -you can find the description using the CLI commands. -.Pp -Be aware that on 32 bit systems, certain default values, such as -.Va sess_workspace -(=16k) and -.Va thread_pool_stack -(=64k) are reduced relative to the values listed here, in order to conserve VM space. -.Pp -.\" ---------------------------------------------------------------- -.\" This table is generated by running a -DDIAGNOSTIC version of -.\" varnishd with the secret "-x dumpmdoc" argument -.\" XXX: Much smarter if we could use .so params.mdoc... -.\" ---------------------------------------------------------------- -.Bl -tag -width 4n -.It Va acceptor_sleep_decay -Default: -.Dv 0.900 -.br -Flags: -.Dv "experimental" -.br -.Pp -If we run out of resources, such as file descriptors or worker threads, the acceptor will sleep between accepts. -.br -This parameter (multiplicatively) reduce the sleep duration for each succesfull accept. (ie: 0.9 = reduce by 10%) -.Pp -.It Va acceptor_sleep_incr -Units: -.Dv s -.br -Default: -.Dv 0.001 -.br -Flags: -.Dv "experimental" -.br -.Pp -If we run out of resources, such as file descriptors or worker threads, the acceptor will sleep between accepts. -.br -This parameter control how much longer we sleep, each time we fail to accept a new connection. -.Pp -.It Va acceptor_sleep_max -Units: -.Dv s -.br -Default: -.Dv 0.050 -.br -Flags: -.Dv "experimental" -.br -.Pp -If we run out of resources, such as file descriptors or worker threads, the acceptor will sleep between accepts. -.br -This parameter limits how long it can sleep between attempts to accept new connections. -.Pp -.It Va auto_restart -Units: -.Dv bool -.br -Default: -.Dv on -.br -.Pp -Restart child process automatically if it dies. -.Pp -.It Va ban_lurker_sleep -Units: -.Dv s -.br -Default: -.Dv 0.0 -.br -.Pp -How long time does the ban lurker thread sleeps between successfull attempts to push the last item up the purge list. It always sleeps a second when nothing can be done. -.br -A value of zero disables the ban lurker. -.Pp -.It Va between_bytes_timeout -Units: -.Dv s -.br -Default: -.Dv 60 -.br -.Pp -Default timeout between bytes when receiving data from backend. We only wait for this many seconds between bytes before giving up. A value of 0 means it will never time out. VCL can override this default value for each backend request and backend request. This parameter does not apply to pipe. -.Pp -.It Va cache_vbe_conns -Units: -.Dv bool -.br -Default: -.Dv off -.br -Flags: -.Dv "experimental" -.br -.Pp -Cache vbe_conn's or rely on malloc, that's the question. -.Pp -.It Va cc_command -Default: -.Dv exec cc -fpic -shared -Wl,-x -o %o %s -.br -Flags: -.Dv "must_reload" -.br -.Pp -Command used for compiling the C source code to a dlopen(3) loadable object. Any occurrence of %s in the string will be replaced with the source file name, and %o will be replaced with the output file name. -.Pp -.It Va cli_buffer -Units: -.Dv bytes -.br -Default: -.Dv 8192 -.br -.Pp -Size of buffer for CLI input. -.br -You may need to increase this if you have big VCL files and use the vcl.inline CLI command. -.br -NB: Must be specified with -p to have effect. -.Pp -.It Va cli_timeout -Units: -.Dv seconds -.br -Default: -.Dv 10 -.br -.Pp -Timeout for the childs replies to CLI requests from the master. -.Pp -.It Va clock_skew -Units: -.Dv s -.br -Default: -.Dv 10 -.br -.Pp -How much clockskew we are willing to accept between the backend and our own clock. -.Pp -.It Va connect_timeout -Units: -.Dv s -.br -Default: -.Dv 0.4 -.br -.Pp -Default connection timeout for backend connections. We only try to connect to the backend for this many seconds before giving up. VCL can override this default value for each backend and backend request. -.Pp -.It Va default_grace -Default: -.Dv 10seconds -.br -Flags: -.Dv "delayed" -.br -.Pp -Default grace period. We will deliver an object this long after it has expired, provided another thread is attempting to get a new copy. -.Pp -.It Va default_ttl -Units: -.Dv seconds -.br -Default: -.Dv 120 -.br -.Pp -The TTL assigned to objects if neither the backend nor the VCL code assigns one. -.br -Objects already cached will not be affected by changes made until they are fetched from the backend again. -.br -To force an immediate effect at the expense of a total flush of the cache use "purge.url ." -.Pp -.It Va diag_bitmap -Units: -.Dv bitmap -.br -Default: -.Dv 0 -.br -.Pp -Bitmap controlling diagnostics code: -.br - 0x00000001 - CNT_Session states. -.br - 0x00000002 - workspace debugging. -.br - 0x00000004 - kqueue debugging. -.br - 0x00000008 - mutex logging. -.br - 0x00000010 - mutex contests. -.br - 0x00000020 - waiting list. -.br - 0x00000040 - object workspace. -.br - 0x00001000 - do not core-dump child process. -.br - 0x00002000 - only short panic message. -.br - 0x00004000 - panic to stderr. -.br - 0x00008000 - panic to abort2(). -.br - 0x00010000 - synchronize shmlog. -.br - 0x00020000 - synchronous start of persistence. -.br - 0x80000000 - do edge-detection on digest. -.br -Use 0x notation and do the bitor in your head :-) -.Pp -.It Va err_ttl -Units: -.Dv seconds -.br -Default: -.Dv 0 -.br -.Pp -The TTL assigned to the synthesized error pages -.Pp -.It Va esi_syntax -Units: -.Dv bitmap -.br -Default: -.Dv 0 -.br -.Pp -Bitmap controlling ESI parsing code: -.br - 0x00000001 - Don't check if it looks like XML -.br - 0x00000002 - Ignore non-esi elements -.br - 0x00000004 - Emit parsing debug records -.br -Use 0x notation and do the bitor in your head :-) -.Pp -.It Va fetch_chunksize -Units: -.Dv kilobytes -.br -Default: -.Dv 128 -.br -Flags: -.Dv "experimental" -.br -.Pp -The default chunksize used by fetcher. This should be bigger than the majority of objects with short TTLs. -.br -Internal limits in the storage_file module makes increases above 128kb a dubious idea. -.Pp -.It Va first_byte_timeout -Units: -.Dv s -.br -Default: -.Dv 60 -.br -.Pp -Default timeout for receiving first byte from backend. We only wait for this many seconds for the first byte before giving up. A value of 0 means it will never time out. VCL can override this default value for each backend and backend request. This parameter does not apply to pipe. -.Pp -.It Va group -Default: -.Dv  -.br -Flags: -.Dv "must_restart" -.br -.Pp -The unprivileged group to run as. -.Pp -.It Va http_headers -Units: -.Dv header lines -.br -Default: -.Dv 64 -.br -.Pp -Maximum number of HTTP headers we will deal with. -.br -This space is preallocated in sessions and workthreads only objects allocate only space for the headers they store. -.Pp -.It Va listen_address -Default: -.Dv :80 -.br -Flags: -.Dv "must_restart" -.br -.Pp -Whitespace separated list of network endpoints where Varnish will accept requests. -.br -Possible formats: host, host:port, :port -.Pp -.It Va listen_depth -Units: -.Dv connections -.br -Default: -.Dv 1024 -.br -Flags: -.Dv "must_restart" -.br -.Pp -Listen queue depth. -.Pp -.It Va log_hashstring -Units: -.Dv bool -.br -Default: -.Dv off -.br -.Pp -Log the hash string to shared memory log. -.Pp -.It Va log_local_address -Units: -.Dv bool -.br -Default: -.Dv off -.br -.Pp -Log the local address on the TCP connection in the SessionOpen shared memory record. -.Pp -.It Va lru_interval -Units: -.Dv seconds -.br -Default: -.Dv 2 -.br -Flags: -.Dv "experimental" -.br -.Pp -Grace period before object moves on LRU list. -.br -Objects are only moved to the front of the LRU list if they have not been moved there already inside this timeout period. This reduces the amount of lock operations necessary for LRU list access. -.Pp -.It Va max_esi_includes -Units: -.Dv includes -.br -Default: -.Dv 5 -.br -.Pp -Maximum depth of esi:include processing. -.Pp -.It Va max_restarts -Units: -.Dv restarts -.br -Default: -.Dv 4 -.br -.Pp -Upper limit on how many times a request can restart. -.br -Be aware that restarts are likely to cause a hit against the backend, so don't increase thoughtlessly. -.Pp -.It Va overflow_max -Units: -.Dv % -.br -Default: -.Dv 100 -.br -Flags: -.Dv "experimental" -.br -.Pp -Percentage permitted overflow queue length. -.Pp -This sets the ratio of queued requests to worker threads, above which sessions will be dropped instead of queued. -.Pp -.It Va ping_interval -Units: -.Dv seconds -.br -Default: -.Dv 3 -.br -Flags: -.Dv "must_restart" -.br -.Pp -Interval between pings from parent to child. -.br -Zero will disable pinging entirely, which makes it possible to attach a debugger to the child. -.Pp -.It Va pipe_timeout -Units: -.Dv seconds -.br -Default: -.Dv 60 -.br -.Pp -Idle timeout for PIPE sessions. If nothing have been received in either direction for this many seconds, the session is closed. -.Pp -.It Va prefer_ipv6 -Units: -.Dv bool -.br -Default: -.Dv off -.br -.Pp -Prefer IPv6 address when connecting to backends which have both IPv4 and IPv6 addresses. -.Pp -.It Va purge_dups -Units: -.Dv bool -.br -Default: -.Dv on -.br -.Pp -Detect and eliminate duplicate purges. -.Pp -.It Va rush_exponent -Units: -.Dv requests per request -.br -Default: -.Dv 3 -.br -Flags: -.Dv "experimental" -.br -.Pp -How many parked request we start for each completed request on the object. -.br -NB: Even with the implict delay of delivery, this parameter controls an exponential increase in number of worker threads. -.Pp -.It Va saintmode_threshold -Units: -.Dv objects -.br -Default: -.Dv 10 -.br -Flags: -.Dv "experimental" -.br -.Pp -The maximum number of objects held off by saint mode before no further will be made to the backend until one times out. A value of 0 disables saintmode. -.Pp -.It Va send_timeout -Units: -.Dv seconds -.br -Default: -.Dv 600 -.br -Flags: -.Dv "delayed" -.br -.Pp -Send timeout for client connections. If no data has been sent to the client in this many seconds, the session is closed. -.br -See setsockopt(2) under SO_SNDTIMEO for more information. -.Pp -.It Va sendfile_threshold -Units: -.Dv bytes -.br -Default: -.Dv -1 -.br -Flags: -.Dv "experimental" -.br -.Pp -The minimum size of objects transmitted with sendfile. -.Pp -.It Va sess_timeout -Units: -.Dv seconds -.br -Default: -.Dv 5 -.br -.Pp -Idle timeout for persistent sessions. If a HTTP request has not been received in this many seconds, the session is closed. -.Pp -.It Va sess_workspace -Units: -.Dv bytes -.br -Default: -.Dv 65536 -.br -Flags: -.Dv "delayed" -.br -.Pp -Bytes of HTTP protocol workspace allocated for sessions. This space must be big enough for the entire HTTP protocol header and any edits done to it in the VCL code. -.br -Minimum is 1024 bytes. -.Pp -.It Va session_linger -Units: -.Dv ms -.br -Default: -.Dv 50 -.br -Flags: -.Dv "experimental" -.br -.Pp -How long time the workerthread lingers on the session to see if a new request appears right away. -.br -If sessions are reused, as much as half of all reuses happen within the first 100 msec of the previous request completing. -.br -Setting this too high results in worker threads not doing anything for their keep, setting it too low just means that more sessions take a detour around the waiter. -.Pp -.It Va session_max -Units: -.Dv sessions -.br -Default: -.Dv 100000 -.br -.Pp -Maximum number of sessions we will allocate before just dropping connections. -.br -This is mostly an anti-DoS measure, and setting it plenty high should not hurt, as long as you have the memory for it. -.Pp -.It Va shm_reclen -Units: -.Dv bytes -.br -Default: -.Dv 255 -.br -.Pp -Maximum number of bytes in SHM log record. -.br -Maximum is 65535 bytes. -.Pp -.It Va shm_workspace -Units: -.Dv bytes -.br -Default: -.Dv 8192 -.br -Flags: -.Dv "delayed" -.br -.Pp -Bytes of shmlog workspace allocated for worker threads. If too big, it wastes some ram, if too small it causes needless flushes of the SHM workspace. -.br -These flushes show up in stats as "SHM flushes due to overflow". -.br -Minimum is 4096 bytes. -.Pp -.It Va syslog_cli_traffic -Units: -.Dv bool -.br -Default: -.Dv on -.br -.Pp -Log all CLI traffic to syslog(LOG_INFO). -.Pp -.It Va thread_pool_add_delay -Units: -.Dv milliseconds -.br -Default: -.Dv 20 -.br -Flags: -.Dv "experimental" -.br -.Pp -Wait at least this long between creating threads. -.Pp -Setting this too long results in insuffient worker threads. -.Pp -Setting this too short increases the risk of worker thread pile-up. -.Pp -.It Va thread_pool_add_threshold -Units: -.Dv requests -.br -Default: -.Dv 2 -.br -Flags: -.Dv "experimental" -.br -.Pp -Overflow threshold for worker thread creation. -.Pp -Setting this too low, will result in excess worker threads, which is generally a bad idea. -.Pp -Setting it too high results in insuffient worker threads. -.Pp -.It Va thread_pool_fail_delay -Units: -.Dv milliseconds -.br -Default: -.Dv 200 -.br -Flags: -.Dv "experimental" -.br -.Pp -Wait at least this long after a failed thread creation before trying to create another thread. -.Pp -Failure to create a worker thread is often a sign that the end is near, because the process is running out of RAM resources for thread stacks. -.br -This delay tries to not rush it on needlessly. -.Pp -If thread creation failures are a problem, check that thread_pool_max is not too high. -.Pp -It may also help to increase thread_pool_timeout and thread_pool_min, to reduce the rate at which treads are destroyed and later recreated. -.Pp -.It Va thread_pool_max -Units: -.Dv threads -.br -Default: -.Dv 500 -.br -Flags: -.Dv "delayed, experimental" -.br -.Pp -The maximum number of worker threads in all pools combined. -.Pp -Do not set this higher than you have to, since excess worker threads soak up RAM and CPU and generally just get in the way of getting work done. -.Pp -.It Va thread_pool_min -Units: -.Dv threads -.br -Default: -.Dv 5 -.br -Flags: -.Dv "delayed, experimental" -.br -.Pp -The minimum number of threads in each worker pool. -.Pp -Increasing this may help ramp up faster from low load situations where threads have expired. -.Pp -Minimum is 2 threads. -.Pp -.It Va thread_pool_purge_delay -Units: -.Dv milliseconds -.br -Default: -.Dv 1000 -.br -Flags: -.Dv "delayed, experimental" -.br -.Pp -Wait this long between purging threads. -.Pp -This controls the decay of thread pools when idle(-ish). -.Pp -Minimum is 100 milliseconds. -.Pp -.It Va thread_pool_stack -Units: -.Dv bytes -.br -Default: -.Dv -1 -.br -Flags: -.Dv "experimental" -.br -.Pp -Worker thread stack size. In particular on 32bit systems you may need to tweak this down to fit many threads into the limited address space. -.Pp -.It Va thread_pool_timeout -Units: -.Dv seconds -.br -Default: -.Dv 300 -.br -Flags: -.Dv "delayed, experimental" -.br -.Pp -Thread idle threshold. -.Pp -Threads in excess of thread_pool_min, which have been idle for at least this long are candidates for purging. -.Pp -Minimum is 1 second. -.Pp -.It Va thread_pools -Units: -.Dv pools -.br -Default: -.Dv 2 -.br -Flags: -.Dv "delayed, experimental" -.br -.Pp -Number of worker thread pools. -.Pp -Increasing number of worker pools decreases lock contention. -.Pp -Too many pools waste CPU and RAM resources, and more than one pool for each CPU is probably detrimal to performance. -.Pp -Can be increased on the fly, but decreases require a restart to take effect. -.Pp -.It Va thread_stats_rate -Units: -.Dv requests -.br -Default: -.Dv 10 -.br -Flags: -.Dv "experimental" -.br -.Pp -Worker threads accumulate statistics, and dump these into the global stats counters if the lock is free when they finish a request. -.br -This parameters defines the maximum number of requests a worker thread may handle, before it is forced to dump its accumulated stats into the global counters. -.Pp -.It Va user -Default: -.Dv  -.br -Flags: -.Dv "must_restart" -.br -.Pp -The unprivileged user to run as. Setting this will also set "group" to the specified user's primary group. -.Pp -.It Va vcl_trace -Units: -.Dv bool -.br -Default: -.Dv off -.br -.Pp -Trace VCL execution in the shmlog. -.br -Enabling this will allow you to see the path each request has taken through the VCL program. -.br -This generates a lot of logrecords so it is off by default. -.Pp -.It Va waiter -Default: -.Dv default -.br -Flags: -.Dv "must_restart, experimental" -.br -.Pp -Select the waiter kernel interface. -.Pp -.El -.\" ---------------------------------------------------------------- -.\" End of machine generated table -.\" ---------------------------------------------------------------- -.Ss Purge expressions -A purge expression consists of one or more conditions. -A condition consists of a field, an operator, and an argument. -Conditions can be ANDed together with -.Qq && . -.Pp -A field can be any of the variables from VCL, for instance -.Va req.url , -.Va req.http.host -or -.Va obj.set-cookie . -.Pp -Operators are -.Qq == -for direct comparision, -.Qq ~ -for a regular expression match, and -.Qq > -or -.Qq < -for size comparisons. -Prepending an operator with -.Qq \&! -negates the expression. -.Pp -The argument could be a quoted string, a regexp, or an integer. -Integers can have -.Qq KB , -.Qq MB , -.Qq GB -or -.Qq TB -appended for size related fields. -.Pp -Simple example: All requests where -.Va req.url -exactly matches the string -.Va /news -are purged from the cache. -.Bd -literal -offset 4n -req.url == "/news" -.Ed -.Pp -Example: Purge all documents where the name does not end with -.Qq .ogg , -and where the size of the object is greater than 10 megabytes. -.Bd -literal -offset 4n -req.url !~ "\\.ogg$" && obj.size > 10MB -.Ed -.Pp -Example: Purge all documents where the serving host is -.Qq example.com -or -.Qq www.example.com , -and where the Set-Cookie header received from the backend contains -.Qq USERID=1663 . -.Bd -literal -offset 4n -req.http.host ~ "^(www\\.)example.com$" && obj.set-cookie ~ "USERID=1663" -.Ed -.Sh SEE ALSO -.Xr varnishlog 1 , -.Xr varnishhist 1 , -.Xr varnishncsa 1 , -.Xr varnishstat 1 , -.Xr varnishtop 1 , -.Xr vcl 7 -.\" .Sh STANDARDS -.\" .Rs -.\" .%A R. Fielding -.\" .%A J. Gettys -.\" .%A J. Mogul -.\" .%A H. Frystyk -.\" .%A L. Masinter -.\" .%A P. Leach -.\" .%A T. Berners-Lee -.\" .%D January 1999 -.\" .%B Hypertext Transfer Protocol -- HTTP/1.1 -.\" .%O RFC2616 -.Sh HISTORY -The -.Nm -daemon was developed by -.An Poul-Henning Kamp Aq phk at phk.freebsd.dk -in cooperation with Verdens Gang AS and Linpro AS. -This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des at des.no -with updates by -.An Stig Sandbeck Mathisen Aq ssm at debian.org Modified: trunk/varnish-cache/bin/varnishhist/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishhist/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishhist/Makefile.am 2010-07-05 11:56:09 UTC (rev 5010) @@ -4,7 +4,9 @@ bin_PROGRAMS = varnishhist +if HAVE_RST2MAN dist_man_MANS = varnishhist.1 +endif varnishhist_SOURCES = varnishhist.c @@ -13,3 +15,13 @@ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ -lm \ ${CURSES_LIBS} ${PTHREAD_LIBS} + +%.1: ../../doc/sphinx/reference/%.rst +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/bin/varnishhist/varnishhist.1 =================================================================== --- trunk/varnish-cache/bin/varnishhist/varnishhist.1 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishhist/varnishhist.1 2010-07-05 11:56:09 UTC (rev 5010) @@ -1,151 +0,0 @@ -.\"- -.\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2009 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: -.\" 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$ -.\" -.Dd June 28, 2007 -.Dt VARNISHHIST 1 -.Os -.Sh NAME -.Nm varnishhist -.Nd Varnish request histogram -.Sh SYNOPSIS -.Nm -.Op Fl b -.Op Fl C -.Op Fl c -.Op Fl d -.Op Fl I Ar regex -.Op Fl i Ar tag -.Op Fl n Ar varnish_name -.Op Fl r Ar file -.Op Fl V -.Op Fl w Ar delay -.Op Fl X Ar regex -.Op Fl x Ar tag -.Sh DESCRIPTION -The -.Nm -utility reads -.Xr varnishd 1 -shared memory logs and presents a continuously updated histogram -showing the distribution of the last -.Va N -requests by their processing. -The value of -.Va N -and the vertical scale are displayed in the top left corner. -The horizontal scale is logarithmic. -Hits are marked with a pipe character ("|"), and misses are marked -with a hash character ("#"). -.Pp -The following options are available: -.Bl -tag -width Fl -.It Fl b -Include log entries which result from communication with a backend -server. -If neither -.Fl b -nor -.Fl c -is specified, -.Nm -acts as if they both were. -.It Fl C -Ignore case when matching regular expressions. -.It Fl c -Include log entries which result from communication with a client. -If neither -.Fl b -nor -.Fl c -is specified, -.Nm -acts as if they both were. -.It Fl d -Process old log entries on startup. -Normally, -.Nm -will only process entries which are written to the log after it -starts. -.It Fl I Ar regex -Include log entries which match the specified regular expression. -If neither -.Fl I -nor -.Fl i -is specified, all log entries are included. -.It Fl i Ar tag -Include log entries with the specified tag. -If neither -.Fl I -nor -.Fl i -is specified, all log entries are included. -.It Fl n -Specifies the name of the -.Nm varnishd -instance to get logs from. -If -.Fl n -is not specified, the host name is used. -.It Fl r Ar file -Read log entries from -.Ar file -instead of shared memory. -.It Fl V -Display the version number and exit. -.It Fl w Ar delay -Wait at least -.Ar delay -seconds between each update. -The default is 1. -.Ar file -instead of displaying them. -The file will be overwritten unless the -.Fl a -option was specified. -.It Fl X Ar regex -Exclude log entries which match the specified regular expression. -.It Fl x Ar tag -Exclude log entries with the specified tag. -.El -.Sh SEE ALSO -.Xr varnishd 1 , -.Xr varnishlog 1 , -.Xr varnishncsa 1 , -.Xr varnishstat 1 , -.Xr varnishtop 1 -.Sh HISTORY -The -.Nm -utility was developed by -.An Poul-Henning Kamp Aq phk at phk.freebsd.dk -in cooperation with Verdens Gang AS and Linpro AS. -This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des at des.no . Modified: trunk/varnish-cache/bin/varnishlog/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishlog/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishlog/Makefile.am 2010-07-05 11:56:09 UTC (rev 5010) @@ -4,7 +4,9 @@ bin_PROGRAMS = varnishlog +if HAVE_RST2MAN dist_man_MANS = varnishlog.1 +endif varnishlog_SOURCES = varnishlog.c @@ -13,3 +15,13 @@ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${PTHREAD_LIBS} + +%.1: ../../doc/sphinx/reference/%.rst +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/bin/varnishlog/varnishlog.1 =================================================================== --- trunk/varnish-cache/bin/varnishlog/varnishlog.1 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishlog/varnishlog.1 2010-07-05 11:56:09 UTC (rev 5010) @@ -1,256 +0,0 @@ -.\"- -.\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2009 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: -.\" 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$ -.\" -.Dd March 9, 2008 -.Dt VARNISHLOG 1 -.Os -.Sh NAME -.Nm varnishlog -.Nd Display Varnish logs -.Sh SYNOPSIS -.Nm -.Op Fl a -.Op Fl b -.Op Fl C -.Op Fl c -.Op Fl D -.Op Fl d -.Op Fl I Ar regex -.Op Fl i Ar tag -.Op Fl k Ar keep -.Op Fl n Ar varnish_name -.Op Fl o -.Op Fl P Ar file -.Op Fl r Ar file -.Op Fl s Ar num -.Op Fl u -.Op Fl V -.Op Fl w Ar file -.Op Fl X Ar regex -.Op Fl x Ar tag -.Op Ar tag Ar regex -.Sh DESCRIPTION -The -.Nm -utility reads and presents -.Xr varnishd 1 -shared memory logs. -.Pp -The following options are available: -.Bl -tag -width Fl -.It Fl a -When writing to a file, append to it rather than overwrite it. -.It Fl b -Include log entries which result from communication with a backend -server. -If neither -.Fl b -nor -.Fl c -is specified, -.Nm -acts as if they both were. -.It Fl C -Ignore case when matching regular expressions. -.It Fl c -Include log entries which result from communication with a client. -If neither -.Fl b -nor -.Fl c -is specified, -.Nm -acts as if they both were. -.It Fl D -Daemonize. -.It Fl d -Process old log entries on startup. -Normally, -.Nm -will only process entries which are written to the log after it -starts. -.It Fl I Ar regex -Include log entries which match the specified regular expression. -If neither -.Fl I -nor -.Fl i -is specified, all log entries are included. -.It Fl i Ar tag -Include log entries with the specified tag. -If neither -.Fl I -nor -.Fl i -is specified, all log entries are included. -.It Fl k Ar num -Only show the first -.Nm num -log records. -.It Fl n -Specifies the name of the -.Nm varnishd -instance to get logs from. -If -.Fl n -is not specified, the host name is used. -.It Fl o -Group log entries by request ID. -This has no effect when writing to a file using the -.Fl w -option. -.It Fl P Ar file -Write the process's PID to the specified -.Ar file . -.It Fl r Ar file -Read log entries from -.Ar file -instead of shared memory. -.It Fl s Ar num -Skip the first -.Ar num -log records. -.It Fl u -Unbuffered output. -.It Fl V -Display the version number and exit. -.It Fl w Ar file -Write log entries to -.Ar file -instead of displaying them. -The file will be overwritten unless the -.Fl a -option was specified. -.Pp -If -.Nm -receives a -.Dv SIGHUP -while writing to a file, it will reopen the file, allowing the old one -to be rotated away. -.It Fl X Ar regex -Exclude log entries which match the specified regular expression. -.It Fl x Ar tag -Exclude log entries with the specified tag. -.El -.Pp -If the -.Fl o -option was specified, an additional -.Ar tag -and -.Ar regex -may be specified to select only requests which generated a log entry -with the given -.Ar tag -whose contents match the given -.Ar regex . -.Sh TAGS -The following log entry tags are currently defined: -.\" keep in sync with include/shmlog_tags.h -.\" XXX add descriptions -.Bl -tag -width 16 -.It Dv Backend -.It Dv BackendClose -.It Dv BackendOpen -.It Dv BackendReuse -.It Dv BackendXID -.It Dv CLI -.It Dv ClientAddr -.It Dv Debug -.It Dv Error -.It Dv ExpBan -.It Dv ExpKill -.It Dv ExpPick -.It Dv Hit -.It Dv HitPass -.It Dv HttpError -.It Dv HttpGarbage -.It Dv Length -.It Dv ObjHeader -.It Dv ObjLostHeader -.It Dv ObjProtocol -.It Dv ObjRequest -.It Dv ObjResponse -.It Dv ObjStatus -.It Dv ObjURL -.It Dv ReqEnd -.It Dv ReqStart -.It Dv RxHeader -.It Dv RxLostHeader -.It Dv RxProtocol -.It Dv RxRequest -.It Dv RxResponse -.It Dv RxStatus -.It Dv RxURL -.It Dv SessionClose -.It Dv SessionOpen -.It Dv StatAddr -.It Dv StatSess -.It Dv TTL -.It Dv TxHeader -.It Dv TxLostHeader -.It Dv TxProtocol -.It Dv TxRequest -.It Dv TxResponse -.It Dv TxStatus -.It Dv TxURL -.It Dv VCL_acl -.It Dv VCL_call -.It Dv VCL_return -.It Dv VCL_trace -.It Dv WorkThread -.El -.Sh EXAMPLES -The following command line simply copies all log entries to a log -file: -.Bd -literal -offset 4n -$ varnishlog \-w /var/log/varnish.log -.Ed -.Pp -The following command line reads that same log file and displays -requests for the front page: -.Bd -literal -offset 4n -$ varnishlog \-r /var/log/varnish.log \-c \-o RxURL '^/$' -.Ed -.Sh SEE ALSO -.Xr varnishd 1 , -.Xr varnishhist 1 , -.Xr varnishncsa 1 , -.Xr varnishstat 1 , -.Xr varnishtop 1 -.Sh HISTORY -The -.Nm -utility was developed by -.An Poul-Henning Kamp Aq phk at phk.freebsd.dk -in cooperation with Verdens Gang AS and Linpro AS. -This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des at des.no . Modified: trunk/varnish-cache/bin/varnishncsa/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishncsa/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishncsa/Makefile.am 2010-07-05 11:56:09 UTC (rev 5010) @@ -4,7 +4,9 @@ bin_PROGRAMS = varnishncsa +if HAVE_RST2MAN dist_man_MANS = varnishncsa.1 +endif varnishncsa_SOURCES = varnishncsa.c @@ -13,3 +15,13 @@ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${PTHREAD_LIBS} + +%.1: ../../doc/sphinx/reference/%.rst +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/bin/varnishncsa/varnishncsa.1 =================================================================== --- trunk/varnish-cache/bin/varnishncsa/varnishncsa.1 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishncsa/varnishncsa.1 2010-07-05 11:56:09 UTC (rev 5010) @@ -1,164 +0,0 @@ -.\"- -.\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2009 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: -.\" 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$ -.\" -.Dd November 8, 2007 -.Dt VARNISHNCSA 1 -.Os -.Sh NAME -.Nm varnishncsa -.Nd Display Varnish logs in Apache / NCSA combined log format -.Sh SYNOPSIS -.Nm -.Op Fl a -.Op Fl b -.Op Fl C -.Op Fl c -.Op Fl D -.Op Fl d -.Op Fl f -.Op Fl I Ar regex -.Op Fl i Ar tag -.Op Fl n Ar varnish_name -.Op Fl P Ar file -.Op Fl r Ar file -.Op Fl V -.Op Fl w Ar file -.Op Fl X Ar regex -.Op Fl x Ar tag -.Sh DESCRIPTION -The -.Nm -utility reads -.Xr varnishd 1 -shared memory logs and presents them in the Apache / NCSA -"combined" log format. -.Pp -The following options are available: -.Bl -tag -width Fl -.It Fl a -When writing to a file, append to it rather than overwrite it. -.It Fl b -Include log entries which result from communication with a backend -server. -If neither -.Fl b -nor -.Fl c -is specified, -.Nm -acts as if they both were. -.It Fl C -Ignore case when matching regular expressions. -.It Fl c -Include log entries which result from communication with a client. -If neither -.Fl b -nor -.Fl c -is specified, -.Nm -acts as if they both were. -.It Fl D -Daemonize. -.It Fl d -Process old log entries on startup. -Normally, -.Nm -will only process entries which are written to the log after it -starts. -.It Fl f -Prefer the -.Va X-Forwarded-For -HTTP header over -.Va client.ip -in the log output. -.It Fl I Ar regex -Include log entries which match the specified regular expression. -If neither -.Fl I -nor -.Fl i -is specified, all log entries are included. -.It Fl i Ar tag -Include log entries with the specified tag. -If neither -.Fl I -nor -.Fl i -is specified, all log entries are included. -.It Fl n -Specifies the name of the -.Nm varnishd -instance to get logs from. -If -.Fl n -is not specified, the host name is used. -.It Fl P Ar file -Write the process's PID to the specified -.Ar file . -.It Fl r Ar file -Read log entries from -.Ar file -instead of shared memory. -.It Fl V -Display the version number and exit. -.It Fl w Ar file -Write log entries to -.Ar file -instead of displaying them. -The file will be overwritten unless the -.Fl a -option was specified. -.Pp -If -.Nm -receives a -.Dv SIGHUP -while writing to a file, it will reopen the file, allowing the old one -to be rotated away. -.It Fl X Ar regex -Exclude log entries which match the specified regular expression. -.It Fl x Ar tag -Exclude log entries with the specified tag. -.El -.Sh SEE ALSO -.Xr varnishd 1 , -.Xr varnishhist 1 , -.Xr varnishlog 1 , -.Xr varnishstat 1 , -.Xr varnishtop 1 , -.Sh HISTORY -The -.Nm -utility was developed by -.An Poul-Henning Kamp Aq phk at phk.freebsd.dk -in cooperation with Verdens Gang AS and Linpro AS. -This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des at des.no . Modified: trunk/varnish-cache/bin/varnishreplay/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishreplay/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishreplay/Makefile.am 2010-07-05 11:56:09 UTC (rev 5010) @@ -4,7 +4,9 @@ bin_PROGRAMS = varnishreplay +if HAVE_RST2MAN dist_man_MANS = varnishreplay.1 +endif varnishreplay_SOURCES = \ varnishreplay.c @@ -14,3 +16,13 @@ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${PTHREAD_LIBS} ${NET_LIBS} + +%.1: ../../doc/sphinx/reference/%.rst +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/bin/varnishreplay/varnishreplay.1 =================================================================== --- trunk/varnish-cache/bin/varnishreplay/varnishreplay.1 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishreplay/varnishreplay.1 2010-07-05 11:56:09 UTC (rev 5010) @@ -1,64 +0,0 @@ -.\"- -.\" Copyright (c) 2007-2009 Linpro AS -.\" All rights reserved. -.\" -.\" Author: Cecilie Fritzvold -.\" -.\" 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$ -.\" -.Dd September 12, 2007 -.Dt VARNISHREPLAY 1 -.Os -.Sh NAME -.Nm varnishreplay -.Nd HTTP traffic replay tool -.Sh SYNOPSIS -.Nm -.Op Fl D -.Fl a Ar address Ns : Ns Ar port -.Fl r Ar file -.Sh DESCRIPTION -The -.Nm -utility parses varnish logs and attempts to reproduce the traffic. -.Pp -The following options are available: -.Bl -tag -width Fl -.It Fl a Ar address Ns : Ns Ar port -Send the traffic over tcp to this address and port. -This option is mandatory. -.It Fl D -Turn on debugging mode. -.It Fl r Ar file -Parse logs from this file. -This option is mandatory. -.El -.Sh SEE ALSO -.Xr varnishd 1 , -.Xr varnishlog 1 -.Sh HISTORY -The -.Nm -utility and this manual page were written by -.An Cecilie Fritzvold Aq cecilihf at linpro.no . Modified: trunk/varnish-cache/bin/varnishsizes/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishsizes/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishsizes/Makefile.am 2010-07-05 11:56:09 UTC (rev 5010) @@ -4,7 +4,9 @@ bin_PROGRAMS = varnishsizes +if HAVE_RST2MAN dist_man_MANS = varnishsizes.1 +endif varnishsizes_SOURCES = varnishsizes.c @@ -13,3 +15,13 @@ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ -lm \ ${CURSES_LIBS} ${PTHREAD_LIBS} + +%.1: ../../doc/sphinx/reference/%.rst +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/bin/varnishsizes/varnishsizes.1 =================================================================== --- trunk/varnish-cache/bin/varnishsizes/varnishsizes.1 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishsizes/varnishsizes.1 2010-07-05 11:56:09 UTC (rev 5010) @@ -1,151 +0,0 @@ -.\"- -.\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2009 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: -.\" 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$ -.\" -.Dd June 28, 2007 -.Dt VARNISHSIZES 1 -.Os -.Sh NAME -.Nm varnishsizes -.Nd Varnish request histogram -.Sh SYNOPSIS -.Nm -.Op Fl b -.Op Fl C -.Op Fl c -.Op Fl d -.Op Fl I Ar regex -.Op Fl i Ar tag -.Op Fl n Ar varnish_name -.Op Fl r Ar file -.Op Fl V -.Op Fl w Ar delay -.Op Fl X Ar regex -.Op Fl x Ar tag -.Sh DESCRIPTION -The -.Nm -utility reads -.Xr varnishd 1 -shared memory logs and presents a continuously updated histogram -showing the distribution of the last -.Va N -requests by their processing. -The value of -.Va N -and the vertical scale are displayed in the top left corner. -The horizontal scale is logarithmic. -Hits are marked with a pipe character ("|"), and misses are marked -with a hash character ("#"). -.Pp -The following options are available: -.Bl -tag -width Fl -.It Fl b -Include log entries which result from communication with a backend -server. -If neither -.Fl b -nor -.Fl c -is specified, -.Nm -acts as if they both were. -.It Fl C -Ignore case when matching regular expressions. -.It Fl c -Include log entries which result from communication with a client. -If neither -.Fl b -nor -.Fl c -is specified, -.Nm -acts as if they both were. -.It Fl d -Process old log entries on startup. -Normally, -.Nm -will only process entries which are written to the log after it -starts. -.It Fl I Ar regex -Include log entries which match the specified regular expression. -If neither -.Fl I -nor -.Fl i -is specified, all log entries are included. -.It Fl i Ar tag -Include log entries with the specified tag. -If neither -.Fl I -nor -.Fl i -is specified, all log entries are included. -.It Fl n -Specifies the name of the -.Nm varnishd -instance to get logs from. -If -.Fl n -is not specified, the host name is used. -.It Fl r Ar file -Read log entries from -.Ar file -instead of shared memory. -.It Fl V -Display the version number and exit. -.It Fl w Ar delay -Wait at least -.Ar delay -seconds between each update. -The default is 1. -.Ar file -instead of displaying them. -The file will be overwritten unless the -.Fl a -option was specified. -.It Fl X Ar regex -Exclude log entries which match the specified regular expression. -.It Fl x Ar tag -Exclude log entries with the specified tag. -.El -.Sh SEE ALSO -.Xr varnishd 1 , -.Xr varnishlog 1 , -.Xr varnishncsa 1 , -.Xr varnishstat 1 , -.Xr varnishtop 1 -.Sh SIZESORY -The -.Nm -utility was developed by -.An Poul-Henning Kamp Aq phk at phk.freebsd.dk -in cooperation with Verdens Gang AS and Linpro AS. -This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des at des.no . Modified: trunk/varnish-cache/bin/varnishstat/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishstat/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishstat/Makefile.am 2010-07-05 11:56:09 UTC (rev 5010) @@ -4,7 +4,9 @@ bin_PROGRAMS = varnishstat +if HAVE_RST2MAN dist_man_MANS = varnishstat.1 +endif varnishstat_SOURCES = \ varnishstat.h \ @@ -16,3 +18,13 @@ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${CURSES_LIBS} ${RT_LIBS} ${PTHREAD_LIBS} + +%.1: ../../doc/sphinx/reference/%.rst +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/bin/varnishstat/varnishstat.1 =================================================================== --- trunk/varnish-cache/bin/varnishstat/varnishstat.1 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishstat/varnishstat.1 2010-07-05 11:56:09 UTC (rev 5010) @@ -1,124 +0,0 @@ -.\"- -.\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2009 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: -.\" 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$ -.\" -.Dd June 28, 2007 -.Dt VARNISHSTAT 1 -.Os -.Sh NAME -.Nm varnishstat -.Nd HTTP accelerator statistics -.Sh SYNOPSIS -.Nm -.Op Fl 1 -.Op Fl f Ar field_list -.Op Fl l -.Op Fl n Ar varnish_name -.Op Fl V -.Op Fl w Ar delay -.Sh DESCRIPTION -The -.Nm -utility displays statistics from a running -.Xr varnishd 1 -instance. -.Pp -The following options are available: -.Bl -tag -width Fl -.It Fl 1 -Instead of presenting of a continuously updated display, print the -statistics once and exit. -.It Fl f -A comma separated list of the fields to display. -If it starts with '^' it is used as an exclusion list. -.It Fl l -Lists the available fields to use with the -.Fl f -option. -.It Fl n -Specifies the name of the -.Nm varnishd -instance to get logs from. -If -.Fl n -is not specified, the host name is used. -.It Fl V -Display the version number and exit. -.It Fl w Ar delay -Wait -.Ar delay -seconds between updates. -The default is 1. -.El -.Pp -The columns in the main display are, from left to right: -.Bl -enum -.It -Value -.It -Per-second average in the period since last update, or a period if the -value can not be averaged -.It -Per-second average over process lifetime, or a period if the value can -not be averaged -.It -Descriptive text -.El -.Pp -When using the -.Fl 1 -option, the columns in the output are, from left to right: -.Bl -enum -.It -Symbolic entry name -.It -Value -.It -Per-second average over process lifetime, or a period if the value can -not be averaged -.It -Descriptive text -.El -.Sh SEE ALSO -.Xr varnishd 1 , -.Xr varnishhist 1 , -.Xr varnishlog 1 , -.Xr varnishncsa 1 , -.Xr varnishtop 1 , -.Xr curses 3 -.Sh HISTORY -The -.Nm -utility was originally developed by -.An Poul-Henning Kamp Aq phk at phk.freebsd.dk -in cooperation with Verdens Gang AS and Linpro AS, and later -substantially rewritten by -.An Dag-Erling Sm\(/orgrav Aq des at des.no . -This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des at des.no . Modified: trunk/varnish-cache/bin/varnishtest/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishtest/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishtest/Makefile.am 2010-07-05 11:56:09 UTC (rev 5010) @@ -9,7 +9,9 @@ bin_PROGRAMS = varnishtest +if HAVE_RST2MAN dist_man_MANS = varnishtest.1 +endif varnishtest_SOURCES = \ vtc.c \ @@ -29,3 +31,13 @@ EXTRA_DIST = $(top_srcdir)/bin/varnishtest/tests/*.vtc \ $(top_srcdir)/bin/varnishtest/tests/README + +%.1: ../../doc/sphinx/reference/%.rst +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/bin/varnishtest/varnishtest.1 =================================================================== --- trunk/varnish-cache/bin/varnishtest/varnishtest.1 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishtest/varnishtest.1 2010-07-05 11:56:09 UTC (rev 5010) @@ -1,219 +0,0 @@ -.\"- -.\" Copyright (c) 2008-2009 Linpro AS -.\" All rights reserved. -.\" -.\" Author: Stig Sandbeck Mathisen -.\" -.\" 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$ -.\" -.Dd February 13, 2009 -.Dt VARNISHTEST 1 -.Os -.Sh NAME -.Nm varnishtest -.Nd Test program for Varnish -.Sh SYNOPSIS -.Nm -.Op Fl n Ar iter -.Op Fl q -.Op Fl v -.Ar file -.Op Ar file ... -.Sh DESCRIPTION -The -.Nm -program is a script driven program used to test the varnish HTTP -accelerator. -.Pp -The -.Nm -program, when started and given one or more script files, can create a -number of threads representing backends, some threads representing -clients, and a varnishd process. -.Pp -The following options are available: -.Bl -tag -width Fl -.It Fl n Ar iter -Run -.Ar iter -number of iterations. -.It Fl q -Be quiet. -.It Fl v -Be verbose. -.It Ar file -File to use as a script -.El -.Sh SCRIPTS -.Ss Example script -.Bd -literal -offset 4n -# Start a varnish instance called "v1" -varnish v1 \-arg "\-b localhost:9080" \-start - -# Create a server thread called "s1" -server s1 { - # Receive a request - rxreq - # Send a standard response - txresp \-hdr "Connection: close" \-body "012345\\n" -} - -# Start the server thread -server s1 \-start - -# Create a client thread called "c1" -client c1 { - # Send a request - txreq \-url "/" - # Wait for a response - rxresp - # Insist that it be a success - expect resp.status == 200 -} - -# Run the client -client c1 \-run - -# Wait for the server to die -server s1 \-wait - -# (Forcefully) Stop the varnish instance. -varnish v1 \-stop -.Ed -.Ss Example script output -The output, running this script looks as follows. -.Pp -The "bargraph" at the beginning of the line is an indication of the -level of detail in the line. -.Pp -The second field where the message comes from -.Pp -The rest of the line is anyones guess :-) -.Bd -literal -offset 4n -# TEST tests/b00000.vtc starting -### v1 CMD: cd ../varnishd && ./varnishd \-d \-d \-n v1 \-a :9081 \-T :9001 \-b localhost:9080 -### v1 opening CLI connection -#### v1 debug| NB: Storage size limited to 2GB on 32 bit architecture,\\n -#### v1 debug| NB: otherwise we could run out of address space.\\n -#### v1 debug| storage_file: filename: ./varnish.Shkoq5 (unlinked) size 2047 MB.\\n -### v1 CLI connection fd = 3 -#### v1 CLI TX| start -#### v1 debug| Using old SHMFILE\\n -#### v1 debug| Notice: locking SHMFILE in core failed: Operation not permitted\\n -#### v1 debug| bind(): Address already in use\\n -#### v1 debug| rolling(1)... -#### v1 debug| \\n -#### v1 debug| rolling(2)...\\n -#### v1 debug| Debugging mode, enter "start" to start child\\n -### v1 CLI 200 -## s1 Starting server -### s1 listen on :9080 (fd 6) -## c1 Starting client -## c1 Waiting for client -## s1 started on :9080 -## c1 started -### c1 connect to :9081 -### c1 connected to :9081 fd is 8 -#### c1 | GET / HTTP/1.1\\r\\n -#### c1 | \\r\\n -### c1 rxresp -#### s1 Accepted socket 7 -### s1 rxreq -#### s1 | GET / HTTP/1.1\\r\\n -#### s1 | X-Varnish: 422080121\\r\\n -#### s1 | X-Forwarded-For: 127.0.0.1\\r\\n -#### s1 | Host: localhost\\r\\n -#### s1 | \\r\\n -#### s1 http[ 0] | GET -#### s1 http[ 1] | / -#### s1 http[ 2] | HTTP/1.1 -#### s1 http[ 3] | X-Varnish: 422080121 -#### s1 http[ 4] | X-Forwarded-For: 127.0.0.1 -#### s1 http[ 5] | Host: localhost -#### s1 | HTTP/1.1 200 Ok\\r\\n -#### s1 | Connection: close\\r\\n -#### s1 | \\r\\n -#### s1 | 012345\\n -#### s1 | \\r\\n -## s1 ending -#### c1 | HTTP/1.1 200 Ok\\r\\n -#### c1 | Content-Length: 9\\r\\n -#### c1 | Date: Mon, 16 Jun 2008 22:16:55 GMT\\r\\n -#### c1 | X-Varnish: 422080121\\r\\n -#### c1 | Age: 0\\r\\n -#### c1 | Via: 1.1 varnish\\r\\n -#### c1 | Connection: keep-alive\\r\\n -#### c1 | \\r\\n -#### c1 http[ 0] | HTTP/1.1 -#### c1 http[ 1] | 200 -#### c1 http[ 2] | Ok -#### c1 http[ 3] | Content-Length: 9 -#### c1 http[ 4] | Date: Mon, 16 Jun 2008 22:16:55 GMT -#### c1 http[ 5] | X-Varnish: 422080121 -#### c1 http[ 6] | Age: 0 -#### c1 http[ 7] | Via: 1.1 varnish -#### c1 http[ 8] | Connection: keep-alive -#### c1 EXPECT resp.status (200) == 200 (200) match -## c1 ending -## s1 Waiting for server -#### v1 CLI TX| stop -### v1 CLI 200 -# TEST tests/b00000.vtc completed -.Ed -.Pp -If instead of 200 we had expected 201 with the line: -.Bd -literal -offset 4n -expect resp.status == 201 -.Ed -.Pp -The output would have ended with: -.Bd -literal -offset 4n -#### c1 http[ 0] | HTTP/1.1 -#### c1 http[ 1] | 200 -#### c1 http[ 2] | Ok -#### c1 http[ 3] | Content-Length: 9 -#### c1 http[ 4] | Date: Mon, 16 Jun 2008 22:26:35 GMT -#### c1 http[ 5] | X-Varnish: 648043653 648043652 -#### c1 http[ 6] | Age: 6 -#### c1 http[ 7] | Via: 1.1 varnish -#### c1 http[ 8] | Connection: keep-alive ----- c1 EXPECT resp.status (200) == 201 (201) failed -.Ed -.Sh SEE ALSO -.Xr varnishhist 1 , -.Xr varnishlog 1 , -.Xr varnishncsa 1 , -.Xr varnishstat 1 , -.Xr varnishtop 1 , -.Xr vcl 7 -.Sh HISTORY -The -.Nm -program was developed by -.An Poul-Henning Kamp Aq phk at phk.freebsd.dk -in cooperation with Linpro AS. -This manual page was written by -.An Stig Sandbeck Mathisen Aq ssm at linpro.no -using examples by -.An Poul-Henning Kamp Aq phk at phk.freebsd.dk . Modified: trunk/varnish-cache/bin/varnishtop/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishtop/Makefile.am 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishtop/Makefile.am 2010-07-05 11:56:09 UTC (rev 5010) @@ -4,7 +4,9 @@ bin_PROGRAMS = varnishtop +if HAVE_RST2MAN dist_man_MANS = varnishtop.1 +endif varnishtop_SOURCES = varnishtop.c @@ -12,3 +14,13 @@ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${CURSES_LIBS} ${PTHREAD_LIBS} + +%.1: ../../doc/sphinx/reference/%.rst +if HAVE_RST2MAN + ${RST2MAN} $< >$@ +else + @echo "========================================" + @echo "You need rst2man installed to make dist" + @echo "========================================" + @false +endif Deleted: trunk/varnish-cache/bin/varnishtop/varnishtop.1 =================================================================== --- trunk/varnish-cache/bin/varnishtop/varnishtop.1 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/bin/varnishtop/varnishtop.1 2010-07-05 11:56:09 UTC (rev 5010) @@ -1,167 +0,0 @@ -.\"- -.\" Copyright (c) 2006 Verdens Gang AS -.\" Copyright (c) 2006-2009 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: -.\" 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$ -.\" -.Dd June 28, 2007 -.Dt VARNISHTOP 1 -.Os -.Sh NAME -.Nm varnishtop -.Nd Varnish log entry ranking -.Sh SYNOPSIS -.Nm -.Op Fl 1 -.Op Fl b -.Op Fl C -.Op Fl c -.Op Fl d -.Op Fl f -.Op Fl I Ar regex -.Op Fl i Ar tag -.Op Fl n Ar varnish_name -.Op Fl r Ar file -.Op Fl V -.Op Fl X Ar regex -.Op Fl x Ar tag -.Sh DESCRIPTION -The -.Nm -utility reads -.Xr varnishd 1 -shared memory logs and presents a continuously updated list of the -most commonly occurring log entries. -With suitable filtering using the -.Fl I , -.Fl i , -.Fl X -and -.Fl x -options, it can be used to display a ranking of requested documents, -clients, user agents, or any other information which is recorded in -the log. -.Pp -The following options are available: -.Bl -tag -width Fl -.It Fl 1 -Instead of presenting of a continuously updated display, print the -statistics once and exit. -Implies -.Fl d . -.It Fl b -Include log entries which result from communication with a backend -server. -If neither -.Fl b -nor -.Fl c -is specified, -.Nm -acts as if they both were. -.It Fl C -Ignore case when matching regular expressions. -.It Fl c -Include log entries which result from communication with a client. -If neither -.Fl b -nor -.Fl c -is specified, -.Nm -acts as if they both were. -.It Fl d -Process old log entries on startup. -Normally, -.Nm -will only process entries which are written to the log after it -starts. -.It Fl f -Sort and group only on the first field of each log entry. -This is useful when displaying e.g. -.Dv stataddr -entries, where the first field is the client IP address. -.It Fl I Ar regex -Include log entries which match the specified regular expression. -If neither -.Fl I -nor -.Fl i -is specified, all log entries are included. -.It Fl i Ar tag -Include log entries with the specified tag. -If neither -.Fl I -nor -.Fl i -is specified, all log entries are included. -.It Fl n -Specifies the name of the -.Nm varnishd -instance to get logs from. -If -.Fl n -is not specified, the host name is used. -.It Fl r Ar file -Read log entries from -.Ar file -instead of shared memory. -.It Fl V -Display the version number and exit. -.It Fl X Ar regex -Exclude log entries which match the specified regular expression. -.It Fl x Ar tag -Exclude log entries with the specified tag. -.El -.Sh EXAMPLES -The following example displays a continuously updated list of the most -frequently requested URLs: -.Bd -literal -varnishtop \-i RxURL -.Ed -.Pp -The following example displays a continuously updated list of the most -commonly used user agents: -.Bd -literal -varnishtop \-i RxHeader \-C \-I \\^User-Agent -.Ed -.Sh SEE ALSO -.Xr varnishd 1 , -.Xr varnishhist 1 , -.Xr varnishlog 1 , -.Xr varnishncsa 1 , -.Xr varnishstat 1 -.Sh HISTORY -The -.Nm -utility was originally developed by -.An Poul-Henning Kamp Aq phk at phk.freebsd.dk -in cooperation with Verdens Gang AS and Linpro AS, and later -substantially rewritten by -.An Dag-Erling Sm\(/orgrav Aq des at des.no . -This manual page was written by -.An Dag-Erling Sm\(/orgrav Aq des at des.no . Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/configure.ac 2010-07-05 11:56:09 UTC (rev 5010) @@ -29,6 +29,11 @@ AC_MSG_WARN([xsltproc not found ? not building documentation]) fi AM_CONDITIONAL(HAVE_XSLTPROC,[test "x$XSLTPROC" != "xno"]) +AC_CHECK_PROGS(RST2MAN, [rst2man], "no") +if test "x$RST2MAN" = "xno"; then + AC_MSG_WARN([rst2man not found ? not building man pages]) +fi +AM_CONDITIONAL(HAVE_RST2MAN,[test "x$RST2MAN" != "xno"]) # Checks for libraries. save_LIBS="${LIBS}" Modified: trunk/varnish-cache/doc/sphinx/reference/varnishadm.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/reference/varnishadm.rst 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/doc/sphinx/reference/varnishadm.rst 2010-07-05 11:56:09 UTC (rev 5010) @@ -31,13 +31,16 @@ OPTIONS ======= --t timeout Wait no longer than this many seconds for an operation to finish. +-t timeout + Wait no longer than this many seconds for an operation to finish. --S secret_file Specify the authentication secret file. This should be the same -S - argument as was given to varnishd. Only processes which can read - the contents of this file, will be able to authenticate the CLI connection. +-S secret_file + Specify the authentication secret file. This should be the same -S + argument as was given to varnishd. Only processes which can read + the contents of this file, will be able to authenticate the CLI connection. --T address:port Connect to the management interface at the specified address and port. +-T address:port + Connect to the management interface at the specified address and port. Available commands and parameters are documented in the varnishd(1) Modified: trunk/varnish-cache/doc/sphinx/reference/varnishd.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/reference/varnishd.rst 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/doc/sphinx/reference/varnishd.rst 2010-07-05 11:56:09 UTC (rev 5010) @@ -233,7 +233,8 @@ purge.url regexp Immediately invalidate all documents whose URL matches the specified regular expression. -quit Close the connection to the varnish admin port. +quit + Close the connection to the varnish admin port. start Start the Varnish cache process if it is not already running. @@ -247,7 +248,8 @@ status Check the status of the Varnish cache process. -stop Stop the Varnish cache process. +stop + Stop the Varnish cache process. url.purge regexp Deprecated, see purge.url instead. Modified: trunk/varnish-cache/doc/sphinx/reference/varnishhist.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/reference/varnishhist.rst 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/doc/sphinx/reference/varnishhist.rst 2010-07-05 11:56:09 UTC (rev 5010) @@ -2,16 +2,16 @@ varnishhist =========== +------------------------- +Varnish request histogram +------------------------- + :Author: Dag-Erling Sm?rgrav :Date: 2010-05-31 :Version: 1.0 :Manual section: 1 -------------------------- -Varnish request histogram -------------------------- - SYNOPSIS ======== Modified: trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst 2010-07-05 11:56:03 UTC (rev 5009) +++ trunk/varnish-cache/doc/sphinx/reference/varnishncsa.rst 2010-07-05 11:56:09 UTC (rev 5010) @@ -2,16 +2,16 @@ varnishncsa =========== +--------------------------------------------------------- +Display Varnish logs in Apache / NCSA combined log format +--------------------------------------------------------- + :Author: Dag-Erling Sm?rgrav :Date: 2010-05-31 :Version: 1.0 :Manual section: 1 ---------------------------------------------------------- -Display Varnish logs in Apache / NCSA combined log format ---------------------------------------------------------- - SYNOPSIS ======== From phk at varnish-cache.org Mon Jul 5 20:14:48 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 5 Jul 2010 22:14:48 +0200 Subject: r5011 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-05 22:14:48 +0200 (Mon, 05 Jul 2010) New Revision: 5011 Modified: trunk/varnish-cache/lib/libvcl/generate.py trunk/varnish-cache/lib/libvcl/vcc_action.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_obj.c trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_string.c trunk/varnish-cache/lib/libvcl/vcc_var.c Log: Move the variable set from being an argument to FindVar to being a property of the VCC instance. Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-07-05 11:56:09 UTC (rev 5010) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-07-05 20:14:48 UTC (rev 5011) @@ -732,7 +732,7 @@ #include #include "vcc_compile.h" -struct var vcc_vars[] = { +const struct var vcc_vars[] = { """) for i in sp_variables: Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-05 11:56:09 UTC (rev 5010) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-05 20:14:48 UTC (rev 5011) @@ -65,11 +65,11 @@ static void parse_error(struct vcc *tl) { - struct var *vp; + const struct var *vp; vcc_NextToken(tl); if (tl->t->tok == ID) { - vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "cannot be read"); + vp = vcc_FindVar(tl, tl->t, 0, "cannot be read"); ERRCHK(tl); assert(vp != NULL); if (vp->fmt == INT) { @@ -114,13 +114,13 @@ static void parse_set(struct vcc *tl) { - struct var *vp; + const struct var *vp; struct token *at, *vt; vcc_NextToken(tl); ExpectErr(tl, ID); vt = tl->t; - vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "cannot be set"); + vp = vcc_FindVar(tl, tl->t, 1, "cannot be set"); ERRCHK(tl); assert(vp != NULL); Fb(tl, 1, "%s", vp->lname); @@ -237,11 +237,11 @@ static void parse_unset(struct vcc *tl) { - struct var *vp; + const struct var *vp; vcc_NextToken(tl); ExpectErr(tl, ID); - vp = vcc_FindVar(tl, tl->t, vcc_vars, 1, "cannot be unset"); + vp = vcc_FindVar(tl, tl->t, 1, "cannot be unset"); ERRCHK(tl); assert(vp != NULL); if (vp->fmt != STRING || vp->hdr == NULL) { Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-05 11:56:09 UTC (rev 5010) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-05 20:14:48 UTC (rev 5011) @@ -461,6 +461,7 @@ if (tl0 != NULL) { REPLACE(tl->default_vcl, tl0->default_vcl); REPLACE(tl->vcl_dir, tl0->vcl_dir); + tl->vars = tl0->vars; } VTAILQ_INIT(&tl->hosts); VTAILQ_INIT(&tl->membits); @@ -684,6 +685,7 @@ struct vcc *tl; tl = vcc_NewVcc(NULL); + tl->vars = vcc_vars; return (tl); } Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-05 11:56:09 UTC (rev 5010) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-05 20:14:48 UTC (rev 5011) @@ -73,6 +73,8 @@ char *vcl_dir; char *vmod_dir; + const struct var *vars; + /* Instance section */ struct tokenhead tokens; VTAILQ_HEAD(, source) sources; @@ -208,7 +210,7 @@ parsedirector_f vcc_ParseRoundRobinDirector; /* vcc_obj.c */ -extern struct var vcc_vars[]; +extern const struct var vcc_vars[]; /* vcc_parse.c */ void vcc_Parse(struct vcc *tl); @@ -240,8 +242,8 @@ const char *e); /* vcc_var.c */ -struct var *vcc_FindVar(struct vcc *tl, const struct token *t, - struct var *vl, int wr_access, const char *use); +const struct var *vcc_FindVar(struct vcc *tl, const struct token *t, + int wr_access, const char *use); void vcc_VarVal(struct vcc *tl, const struct var *vp, const struct token *vt); Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-05 11:56:09 UTC (rev 5010) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-05 20:14:48 UTC (rev 5011) @@ -160,10 +160,11 @@ /* ../../include/vcl.h */ - vsb_cat(sb, "\n/*\n * $Id$\n *\n * NB: This file is machine " - "generated, DO NOT EDIT!\n *\n * Edit and run generate.py instead" - "\n */\n\nstruct sess;\nstruct cli;\n\ntypedef void vcl_init_f(st" - "ruct cli *);\ntypedef void vcl_fini_f(struct cli *);\n" + vsb_cat(sb, "\n/*\n * $Id: vcl.h 5007 2010-07-05 09:37:53Z " + "phk $\n *\n * NB: This file is machine generated, DO NOT " + "EDIT!\n *\n * Edit and run generate.py instead\n */\n" + "\nstruct sess;\nstruct cli;\n\ntypedef void vcl_init_f(struct " + "cli *);\ntypedef void vcl_fini_f(struct cli *);\n" "typedef int vcl_func_f(struct sess *sp);\n\n/* VCL Methods " "*/\n#define VCL_MET_RECV\t\t(1U << 0)\n#define VCL_MET_PIPE\t" "\t(1U << 1)\n#define VCL_MET_PASS\t\t(1U << 2)\n#define VCL_MET_" Modified: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2010-07-05 11:56:09 UTC (rev 5010) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2010-07-05 20:14:48 UTC (rev 5011) @@ -11,7 +11,7 @@ #include #include "vcc_compile.h" -struct var vcc_vars[] = { +const struct var vcc_vars[] = { { "client.ip", IP, 9, "VRT_r_client_ip(sp)", VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-05 11:56:09 UTC (rev 5010) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-05 20:14:48 UTC (rev 5011) @@ -326,7 +326,7 @@ static void vcc_Cond_2(struct vcc *tl) { - struct var *vp; + const struct var *vp; C(tl, ","); if (tl->t->tok == '!') { @@ -340,7 +340,7 @@ vcc_Cond_0(tl); SkipToken(tl, ')'); } else if (tl->t->tok == ID) { - vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "cannot be read"); + vp = vcc_FindVar(tl, tl->t, 0, "cannot be read"); ERRCHK(tl); assert(vp != NULL); vcc_NextToken(tl); Modified: trunk/varnish-cache/lib/libvcl/vcc_string.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-05 11:56:09 UTC (rev 5010) +++ trunk/varnish-cache/lib/libvcl/vcc_string.c 2010-07-05 20:14:48 UTC (rev 5011) @@ -142,7 +142,7 @@ int vcc_StringVal(struct vcc *tl) { - struct var *vp; + const struct var *vp; if (tl->t->tok == CSTR) { EncToken(tl->fb, tl->t); @@ -159,7 +159,7 @@ return 1; } if (tl->t->tok == ID) { - vp = vcc_FindVar(tl, tl->t, vcc_vars, 0, "cannot be read"); + vp = vcc_FindVar(tl, tl->t, 0, "cannot be read"); if (tl->err) return (0); assert(vp != NULL); Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-05 11:56:09 UTC (rev 5010) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-05 20:14:48 UTC (rev 5011) @@ -86,13 +86,14 @@ /*--------------------------------------------------------------------*/ -struct var * -vcc_FindVar(struct vcc *tl, const struct token *t, struct var *vl, - int wr_access, const char *use) +const struct var * +vcc_FindVar(struct vcc *tl, const struct token *t, int wr_access, + const char *use) { - struct var *v; + const struct var *v; - for (v = vl; v->name != NULL; v++) { + AN(tl->vars); + for (v = tl->vars; v->name != NULL; v++) { if (v->fmt == HEADER && (t->e - t->b) <= v->len) continue; if (v->fmt != HEADER && t->e - t->b != v->len) From phk at varnish-cache.org Mon Jul 5 20:56:30 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 5 Jul 2010 22:56:30 +0200 Subject: r5012 - trunk/varnish-cache/lib/libvarnish Message-ID: Author: phk Date: 2010-07-05 22:56:30 +0200 (Mon, 05 Jul 2010) New Revision: 5012 Modified: trunk/varnish-cache/lib/libvarnish/subproc.c Log: Add missing final newline. Modified: trunk/varnish-cache/lib/libvarnish/subproc.c =================================================================== --- trunk/varnish-cache/lib/libvarnish/subproc.c 2010-07-05 20:14:48 UTC (rev 5011) +++ trunk/varnish-cache/lib/libvarnish/subproc.c 2010-07-05 20:56:30 UTC (rev 5012) @@ -116,7 +116,7 @@ do { rv = waitpid(pid, &status, 0); if (rv < 0 && errno != EINTR) { - vsb_printf(sb, "Running %s: waitpid() failed: %s", + vsb_printf(sb, "Running %s: waitpid() failed: %s\n", name, strerror(errno)); return (-1); } @@ -129,6 +129,7 @@ vsb_printf(sb, ", signal %d", WTERMSIG(status)); if (WCOREDUMP(status)) vsb_printf(sb, ", core dumped"); + vsb_printf(sb, "\n"); return (-1); } return (0); From phk at varnish-cache.org Mon Jul 5 21:01:42 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 5 Jul 2010 23:01:42 +0200 Subject: r5013 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-05 23:01:42 +0200 (Mon, 05 Jul 2010) New Revision: 5013 Added: trunk/varnish-cache/lib/libvcl/vcc_symb.c Modified: trunk/varnish-cache/lib/libvcl/Makefile.am trunk/varnish-cache/lib/libvcl/vcc_compile.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_var.c Log: Add a very rudimentary symbol table, and use it to find our variables. Modified: trunk/varnish-cache/lib/libvcl/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvcl/Makefile.am 2010-07-05 20:56:30 UTC (rev 5012) +++ trunk/varnish-cache/lib/libvcl/Makefile.am 2010-07-05 21:01:42 UTC (rev 5013) @@ -22,6 +22,7 @@ vcc_fixed_token.c \ vcc_obj.c \ vcc_string.c \ + vcc_symb.c \ vcc_token.c \ vcc_var.c \ vcc_xref.c Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-05 20:56:30 UTC (rev 5012) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-05 21:01:42 UTC (rev 5013) @@ -463,6 +463,7 @@ REPLACE(tl->vcl_dir, tl0->vcl_dir); tl->vars = tl0->vars; } + VTAILQ_INIT(&tl->symbols); VTAILQ_INIT(&tl->hosts); VTAILQ_INIT(&tl->membits); VTAILQ_INIT(&tl->tokens); @@ -504,6 +505,7 @@ { struct membit *mb; struct source *sp; + struct symbol *sym; int i; while (!VTAILQ_EMPTY(&tl->membits)) { @@ -518,6 +520,12 @@ vcc_destroy_source(sp); } + while (!VTAILQ_EMPTY(&tl->symbols)) { + sym = VTAILQ_FIRST(&tl->symbols); + VTAILQ_REMOVE(&tl->symbols, sym, list); + FREE_OBJ(sym); + } + vsb_delete(tl->fh); vsb_delete(tl->fc); vsb_delete(tl->fi); @@ -537,12 +545,21 @@ vcc_CompileSource(const struct vcc *tl0, struct vsb *sb, struct source *sp) { struct vcc *tl; + struct symbol *sym; + const struct var *v; char *of; int i; tl = vcc_NewVcc(tl0); tl->sb = sb; + for (v = tl->vars; v->name != NULL; v++) { + sym = VCC_AddSymbol(tl, v->name); + sym->var = v; + if (v->fmt == HEADER) + sym->wildcard = 1; + } + vcl_output_lang_h(tl->fh); Fh(tl, 0, "\n/* ---===### VCC generated below here ###===---*/\n"); Fh(tl, 0, "\nextern const struct VCL_conf VCL_conf;\n"); @@ -685,7 +702,9 @@ struct vcc *tl; tl = vcc_NewVcc(NULL); + tl->vars = vcc_vars; + return (tl); } Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-05 20:56:30 UTC (rev 5012) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-05 21:01:42 UTC (rev 5013) @@ -62,6 +62,16 @@ char *dec; }; +struct symbol { + unsigned magic; +#define SYMBOL_MAGIC 0x3368c9fb + VTAILQ_ENTRY(symbol) list; + char *name; + unsigned nlen; + unsigned wildcard; + const struct var *var; +}; + VTAILQ_HEAD(tokenhead, token); struct vcc { @@ -74,6 +84,7 @@ char *vmod_dir; const struct var *vars; + VTAILQ_HEAD(, symbol) symbols; /* Instance section */ struct tokenhead tokens; @@ -225,6 +236,11 @@ int vcc_StringVal(struct vcc *tl); void vcc_ExpectedStringval(struct vcc *tl); +/* vcc_symbol */ +struct symbol *VCC_AddSymbol(struct vcc *tl, const char *name); +const struct symbol *VCC_FindSymbol(const struct vcc *tl, + const struct token *t); + /* vcc_token.c */ void vcc_Coord(const struct vcc *tl, struct vsb *vsb, const struct token *t); Copied: trunk/varnish-cache/lib/libvcl/vcc_symb.c (from rev 5011, trunk/varnish-cache/lib/libvcl/vcc_var.c) =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_symb.c (rev 0) +++ trunk/varnish-cache/lib/libvcl/vcc_symb.c 2010-07-05 21:01:42 UTC (rev 5013) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2010 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. + */ + +#include "config.h" + +#include "svnid.h" +SVNID("$Id$") + +#include +#include +#include + +#include "vsb.h" + +#include "vcc_priv.h" +#include "vcc_compile.h" +#include "libvarnish.h" + +/*--------------------------------------------------------------------*/ + + +struct symbol * +VCC_AddSymbol(struct vcc *tl, const char *name) +{ + struct symbol *sym; + + VTAILQ_FOREACH(sym, &tl->symbols, list) { + if (strcmp(name, sym->name)) + continue; + printf("%s <> %s\n", name, sym->name); + WRONG("name collision"); + } + ALLOC_OBJ(sym, SYMBOL_MAGIC); + REPLACE(sym->name, name); + sym->nlen = strlen(name); + VTAILQ_INSERT_TAIL(&tl->symbols, sym, list); + return (sym); +} + +const struct symbol * +VCC_FindSymbol(const struct vcc *tl, const struct token *t) +{ + struct symbol *sym; + + assert(t->tok == ID); + VTAILQ_FOREACH(sym, &tl->symbols, list) { + if (!sym->wildcard) { + if (vcc_IdIs(t, sym->name)) + return (sym); + continue; + } + if (t->e - t->b <= sym->nlen) + continue; + if (!memcmp(sym->name, t->b, sym->nlen)) + return (sym); + } + return (NULL); +} Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-05 20:56:30 UTC (rev 5012) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-05 21:01:42 UTC (rev 5013) @@ -91,15 +91,14 @@ const char *use) { const struct var *v; + const struct symbol *sym; AN(tl->vars); - for (v = tl->vars; v->name != NULL; v++) { - if (v->fmt == HEADER && (t->e - t->b) <= v->len) - continue; - if (v->fmt != HEADER && t->e - t->b != v->len) - continue; - if (memcmp(t->b, v->name, v->len)) - continue; + sym = VCC_FindSymbol(tl, t); + if (sym != NULL) { + v = sym->var; + AN(v); + if (wr_access && v->l_methods == 0) { vsb_printf(tl->sb, "Variable "); vcc_ErrToken(tl, t); From phk at varnish-cache.org Mon Jul 5 21:51:42 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Mon, 5 Jul 2010 23:51:42 +0200 Subject: r5014 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-05 23:51:42 +0200 (Mon, 05 Jul 2010) New Revision: 5014 Added: trunk/varnish-cache/lib/libvcl/vcc_types.h Modified: trunk/varnish-cache/lib/libvcl/Makefile.am trunk/varnish-cache/lib/libvcl/vcc_compile.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_var.c Log: Start massaging the conditional parsing to handle non-variable left sides. Modified: trunk/varnish-cache/lib/libvcl/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvcl/Makefile.am 2010-07-05 21:01:42 UTC (rev 5013) +++ trunk/varnish-cache/lib/libvcl/Makefile.am 2010-07-05 21:51:42 UTC (rev 5014) @@ -10,6 +10,7 @@ vcc_priv.h \ vcc_compile.h \ vcc_token_defs.h \ + vcc_types.h \ \ vcc_acl.c \ vcc_action.c \ Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-05 21:01:42 UTC (rev 5013) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-05 21:51:42 UTC (rev 5014) @@ -556,6 +556,8 @@ for (v = tl->vars; v->name != NULL; v++) { sym = VCC_AddSymbol(tl, v->name); sym->var = v; + sym->fmt = v->fmt; + sym->r_methods = v->r_methods; if (v->fmt == HEADER) sym->wildcard = 1; } Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-05 21:01:42 UTC (rev 5013) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-05 21:51:42 UTC (rev 5014) @@ -38,6 +38,12 @@ struct acl_e; +enum var_type { +#define VCC_TYPE(foo) foo, +#include "vcc_types.h" +#undef VCC_TYPE +}; + struct membit { VTAILQ_ENTRY(membit) list; void *ptr; @@ -70,6 +76,8 @@ unsigned nlen; unsigned wildcard; const struct var *var; + enum var_type fmt; + unsigned r_methods; }; VTAILQ_HEAD(tokenhead, token); @@ -129,19 +137,6 @@ unsigned nsockaddr; }; -enum var_type { - BACKEND, - BOOL, - INT, - // SIZE, - // FLOAT, - TIME, - DURATION, - STRING, - IP, - HEADER -}; - enum ref_type { R_SUB, R_ACL, @@ -164,7 +159,7 @@ const char *rname; unsigned r_methods; const char *lname; - unsigned l_methods; + unsigned w_methods; const char *hdr; }; @@ -227,7 +222,7 @@ void vcc_Parse(struct vcc *tl); void vcc_RTimeVal(struct vcc *tl, double *); void vcc_TimeVal(struct vcc *tl, double *); -void vcc_SizeVal(struct vcc *tl, double *); +// void vcc_SizeVal(struct vcc *tl, double *); unsigned vcc_UintVal(struct vcc *tl); double vcc_DoubleVal(struct vcc *tl); Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-05 21:01:42 UTC (rev 5013) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-05 21:51:42 UTC (rev 5014) @@ -323,11 +323,93 @@ vcc_NextToken(tl); } +const char *typenm[] = { +#define VCC_TYPE(foo) [foo] = #foo, +#include "vcc_types.h" +#undef VCC_TYPE +}; + +static int +vcc_Relation(struct vcc *tl, enum var_type fmt) +{ + + switch(tl->t->tok) { + case T_EQ: + case T_NEQ: + if (fmt != BOOL) + return (tl->t->tok); + break; + case '>': + case T_GEQ: + case '<': + case T_LEQ: + if (fmt == INT || fmt == TIME || fmt == DURATION) + return (tl->t->tok); + break; + case '~': + case T_NOMATCH: + if (fmt == IP || fmt == STRING || fmt == HEADER) + return (tl->t->tok); + break; + default: + if (fmt == STRING || fmt == HEADER || fmt == BOOL) + return (-1); + break; + } + vsb_printf(tl->sb, "Invalid comparison/match operator "); + vsb_printf(tl->sb, " for type %s.\n", typenm[fmt]); + vcc_ErrToken(tl, tl->t); + vcc_ErrWhere(tl, tl->t); + return (-1); +} + static void -vcc_Cond_2(struct vcc *tl) +vcc_Cond_3(struct vcc *tl) { const struct var *vp; + const struct symbol *sym; + sym = VCC_FindSymbol(tl, tl->t); + if (sym == NULL) { + vsb_printf(tl->sb, + "Syntax error in condition.\n" + "Expected '(', '!' or variable name.\n" + "Found "); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, "\n"); + vcc_ErrWhere(tl, tl->t); + return; + } + vcc_AddUses(tl, tl->t, sym->r_methods, "Not available"); + AN(sym->var); + vp = vcc_FindVar(tl, tl->t, 0, "cannot be read"); + ERRCHK(tl); + assert(vp != NULL); + vcc_NextToken(tl); + vcc_Relation(tl, sym->fmt); + switch (vp->fmt) { + case INT: L(tl, vcc_Cond_Int(vp, tl)); break; + // case SIZE: L(tl, vcc_Cond_Int(vp, tl)); break; + case BOOL: L(tl, vcc_Cond_Bool(vp, tl)); break; + case IP: L(tl, vcc_Cond_Ip(vp, tl)); break; + case STRING: L(tl, vcc_Cond_String(vp, tl)); break; + case TIME: L(tl, vcc_Cond_Int(vp, tl)); break; + case DURATION: L(tl, vcc_Cond_Int(vp, tl)); break; + case BACKEND: L(tl, vcc_Cond_Backend(vp, tl)); break; + default: + vsb_printf(tl->sb, + "Variable '%s'" + " has no conditions that can be checked\n", + vp->name); + vcc_ErrWhere(tl, tl->t); + return; + } +} + +static void +vcc_Cond_2(struct vcc *tl) +{ + C(tl, ","); if (tl->t->tok == '!') { Fb(tl, 1, "!(\n"); @@ -339,38 +421,22 @@ vcc_NextToken(tl); vcc_Cond_0(tl); SkipToken(tl, ')'); - } else if (tl->t->tok == ID) { - vp = vcc_FindVar(tl, tl->t, 0, "cannot be read"); - ERRCHK(tl); - assert(vp != NULL); - vcc_NextToken(tl); - switch (vp->fmt) { - case INT: L(tl, vcc_Cond_Int(vp, tl)); break; - // case SIZE: L(tl, vcc_Cond_Int(vp, tl)); break; - case BOOL: L(tl, vcc_Cond_Bool(vp, tl)); break; - case IP: L(tl, vcc_Cond_Ip(vp, tl)); break; - case STRING: L(tl, vcc_Cond_String(vp, tl)); break; - case TIME: L(tl, vcc_Cond_Int(vp, tl)); break; - case DURATION: L(tl, vcc_Cond_Int(vp, tl)); break; - case BACKEND: L(tl, vcc_Cond_Backend(vp, tl)); break; - default: - vsb_printf(tl->sb, - "Variable '%s'" - " has no conditions that can be checked\n", - vp->name); - vcc_ErrWhere(tl, tl->t); - return; - } - } else { - vsb_printf(tl->sb, - "Syntax error in condition, expected '(', '!' or" - " variable name, found "); - vcc_ErrToken(tl, tl->t); - vsb_printf(tl->sb, "\n"); - vcc_ErrWhere(tl, tl->t); + Fb(tl, 1, ")\n"); return; } - Fb(tl, 1, ")\n"); + if (tl->t->tok == ID) { + vcc_Cond_3(tl); + Fb(tl, 1, ")\n"); + return; + } + vsb_printf(tl->sb, + "Syntax error in condition.\n" + "Expected '(', '!' or variable name.\n" + "Found "); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, "\n"); + vcc_ErrWhere(tl, tl->t); + return; } static void Added: trunk/varnish-cache/lib/libvcl/vcc_types.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_types.h (rev 0) +++ trunk/varnish-cache/lib/libvcl/vcc_types.h 2010-07-05 21:51:42 UTC (rev 5014) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2010 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$ + */ + +VCC_TYPE(BACKEND) +VCC_TYPE(BOOL) +VCC_TYPE(INT) +VCC_TYPE(TIME) +VCC_TYPE(DURATION) +VCC_TYPE(STRING) +VCC_TYPE(IP) +VCC_TYPE(HEADER) Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-05 21:01:42 UTC (rev 5013) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-05 21:51:42 UTC (rev 5014) @@ -62,7 +62,7 @@ p[i] = '\0'; v->name = p; v->r_methods = vh->r_methods; - v->l_methods = vh->l_methods; + v->w_methods = vh->w_methods; v->fmt = STRING; v->hdr = vh->hdr; l = strlen(v->name + vh->len) + 1; @@ -99,7 +99,7 @@ v = sym->var; AN(v); - if (wr_access && v->l_methods == 0) { + if (wr_access && v->w_methods == 0) { vsb_printf(tl->sb, "Variable "); vcc_ErrToken(tl, t); vsb_printf(tl->sb, " is read only."); @@ -107,7 +107,7 @@ vcc_ErrWhere(tl, t); return (NULL); } else if (wr_access) { - vcc_AddUses(tl, t, v->l_methods, use); + vcc_AddUses(tl, t, v->w_methods, use); } else if (v->r_methods == 0) { vsb_printf(tl->sb, "Variable "); vcc_ErrToken(tl, t); From tfheen at varnish-cache.org Tue Jul 6 07:25:51 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 09:25:51 +0200 Subject: r5015 - trunk/varnish-cache/doc/sphinx/phk Message-ID: Author: tfheen Date: 2010-07-06 09:25:51 +0200 (Tue, 06 Jul 2010) New Revision: 5015 Modified: trunk/varnish-cache/doc/sphinx/phk/barriers.rst Log: Fix some typos Modified: trunk/varnish-cache/doc/sphinx/phk/barriers.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/phk/barriers.rst 2010-07-05 21:51:42 UTC (rev 5014) +++ trunk/varnish-cache/doc/sphinx/phk/barriers.rst 2010-07-06 07:25:51 UTC (rev 5015) @@ -49,7 +49,7 @@ ============================ The central actor in Varnish is the Manager process, "MGR", which is the -proces the administrator "(ADMIN)" starts to get web-cache service. +process the administrator "(ADMIN)" starts to get web-cache service. Having been there myself, I do not subscribe to the "I feel cool and important when I get woken up at 3AM to restart a dead process" school of thought, in @@ -104,7 +104,7 @@ can decide under which circumstances that authority will be shared. Needless to say, if the system on which Varnish runs is not properly -secured, the Administators monopoly of control will be compromised. +secured, the Administator's monopoly of control will be compromised. All the other barriers ====================== From tfheen at varnish-cache.org Tue Jul 6 07:28:04 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 09:28:04 +0200 Subject: r5016 - in trunk/varnish-cache: bin/varnishd bin/varnishtest/tests include lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 09:28:04 +0200 (Tue, 06 Jul 2010) New Revision: 5016 Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c trunk/varnish-cache/bin/varnishtest/tests/v00018.vtc trunk/varnish-cache/include/vsl_tags.h trunk/varnish-cache/lib/libvcl/vcc_action.c Log: Add "log" command to VCL This allows logging to varnishlog with the VCL_Log tag. Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-07-06 07:25:51 UTC (rev 5015) +++ trunk/varnish-cache/bin/varnishd/cache_vrt.c 2010-07-06 07:28:04 UTC (rev 5016) @@ -948,6 +948,20 @@ /*--------------------------------------------------------------------*/ void +VRT_log(struct sess *sp, const char *str, ...) +{ + va_list ap; + char *b; + + va_start(ap, str); + b = vrt_assemble_string(sp->http, NULL, str, ap); + va_end(ap); + WSP(sp, SLT_VCL_Log, "%s", b); +} + +/*--------------------------------------------------------------------*/ + +void VRT_ban(struct sess *sp, char *cmds, ...) { char *a1, *a2, *a3; Modified: trunk/varnish-cache/bin/varnishtest/tests/v00018.vtc =================================================================== --- trunk/varnish-cache/bin/varnishtest/tests/v00018.vtc 2010-07-06 07:25:51 UTC (rev 5015) +++ trunk/varnish-cache/bin/varnishtest/tests/v00018.vtc 2010-07-06 07:28:04 UTC (rev 5016) @@ -117,3 +117,7 @@ sub vcl_error { synthetic if "foo"; } } +varnish v1 -vcl { + backend b { .host = "127.0.0.1"; } + sub vcl_recv { log "FOO"; } +} Modified: trunk/varnish-cache/include/vsl_tags.h =================================================================== --- trunk/varnish-cache/include/vsl_tags.h 2010-07-06 07:25:51 UTC (rev 5015) +++ trunk/varnish-cache/include/vsl_tags.h 2010-07-06 07:28:04 UTC (rev 5016) @@ -96,3 +96,4 @@ SLTM(Hash) SLTM(Backend_health) +SLTM(VCL_Log) Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-06 07:25:51 UTC (rev 5015) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-06 07:28:04 UTC (rev 5016) @@ -487,7 +487,24 @@ } /*--------------------------------------------------------------------*/ +static void +parse_log(struct tokenlist *tl) +{ + vcc_NextToken(tl); + Fb(tl, 1, "VRT_log(sp, "); + if (!vcc_StringVal(tl)) { + vcc_ExpectedStringval(tl); + return; + } + do + Fb(tl, 0, ", "); + while (vcc_StringVal(tl)); + Fb(tl, 0, " vrt_magic_string_end);\n"); +} + +/*--------------------------------------------------------------------*/ + typedef void action_f(struct vcc *tl); static struct action_table { @@ -515,6 +532,7 @@ { "set", parse_set }, { "synthetic", parse_synthetic }, { "unset", parse_unset }, + { "log", parse_log }, { NULL, NULL } }; From tfheen at varnish-cache.org Tue Jul 6 07:50:30 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 09:50:30 +0200 Subject: r5017 - in trunk/varnish-cache: include lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 09:50:30 +0200 (Tue, 06 Jul 2010) New Revision: 5017 Modified: trunk/varnish-cache/include/vrt.h trunk/varnish-cache/lib/libvcl/vcc_action.c Log: Add function prototype, update to new world order Unbreak the build Modified: trunk/varnish-cache/include/vrt.h =================================================================== --- trunk/varnish-cache/include/vrt.h 2010-07-06 07:28:04 UTC (rev 5016) +++ trunk/varnish-cache/include/vrt.h 2010-07-06 07:50:30 UTC (rev 5017) @@ -138,6 +138,7 @@ void VRT_ban(struct sess *sp, char *, ...); void VRT_ban_string(struct sess *sp, const char *, ...); void VRT_purge(struct sess *sp, double ttl, double grace); +void VRT_log(struct sess *, const char *msg, ...); void VRT_count(const struct sess *, unsigned); int VRT_rewrite(const char *, const char *); Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-06 07:28:04 UTC (rev 5016) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-06 07:50:30 UTC (rev 5017) @@ -488,7 +488,7 @@ /*--------------------------------------------------------------------*/ static void -parse_log(struct tokenlist *tl) +parse_log(struct vcc *tl) { vcc_NextToken(tl); From tfheen at varnish-cache.org Tue Jul 6 07:50:45 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 09:50:45 +0200 Subject: r5018 - trunk/varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 09:50:45 +0200 (Tue, 06 Jul 2010) New Revision: 5018 Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c Log: Update auto-generated file Modified: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-06 07:50:30 UTC (rev 5017) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-06 07:50:45 UTC (rev 5018) @@ -160,11 +160,10 @@ /* ../../include/vcl.h */ - vsb_cat(sb, "\n/*\n * $Id: vcl.h 5007 2010-07-05 09:37:53Z " - "phk $\n *\n * NB: This file is machine generated, DO NOT " - "EDIT!\n *\n * Edit and run generate.py instead\n */\n" - "\nstruct sess;\nstruct cli;\n\ntypedef void vcl_init_f(struct " - "cli *);\ntypedef void vcl_fini_f(struct cli *);\n" + vsb_cat(sb, "\n/*\n * $Id$\n *\n * NB: This file is machine " + "generated, DO NOT EDIT!\n *\n * Edit and run generate.py instead" + "\n */\n\nstruct sess;\nstruct cli;\n\ntypedef void vcl_init_f(st" + "ruct cli *);\ntypedef void vcl_fini_f(struct cli *);\n" "typedef int vcl_func_f(struct sess *sp);\n\n/* VCL Methods " "*/\n#define VCL_MET_RECV\t\t(1U << 0)\n#define VCL_MET_PIPE\t" "\t(1U << 1)\n#define VCL_MET_PASS\t\t(1U << 2)\n#define VCL_MET_" @@ -288,22 +287,23 @@ "\nvoid VRT_panic(struct sess *sp, const char *, ...);\n" "void VRT_ban(struct sess *sp, char *, ...);\nvoid VRT_ban_string" "(struct sess *sp, const char *, ...);\nvoid VRT_purge(struct " - "sess *sp, double ttl, double grace);\n\nvoid VRT_count(const " - "struct sess *, unsigned);\nint VRT_rewrite(const char *, const " - "char *);\nvoid VRT_error(struct sess *, unsigned, const char " - "*);\nint VRT_switch_config(const char *);\n\nenum gethdr_e " - "{ HDR_REQ, HDR_RESP, HDR_OBJ, HDR_BEREQ, HDR_BERESP };\n" - "char *VRT_GetHdr(const struct sess *, enum gethdr_e where, " - "const char *);\nvoid VRT_SetHdr(const struct sess *, enum " - "gethdr_e where, const char *,\n const char *, ...);\n" - "void VRT_handling(struct sess *sp, unsigned hand);\n" - "\nvoid VRT_hashdata(struct sess *sp, const char *str, ...);\n" - "\n/* Simple stuff */\nint VRT_strcmp(const char *s1, const " - "char *s2);\nvoid VRT_memmove(void *dst, const void *src, unsigne" - "d len);\n\nvoid VRT_ESI(struct sess *sp);\nvoid VRT_Rollback(str" - "uct sess *sp);\n\n/* Synthetic pages */\nvoid VRT_synth_page(str" - "uct sess *sp, unsigned flags, const char *, ...);\n" - "\n/* Backend related */\nvoid VRT_init_dir(struct cli *, struct " + "sess *sp, double ttl, double grace);\nvoid VRT_log(struct " + "sess *, const char *msg, ...);\n\nvoid VRT_count(const struct " + "sess *, unsigned);\nint VRT_rewrite(const char *, const char " + "*);\nvoid VRT_error(struct sess *, unsigned, const char *);\n" + "int VRT_switch_config(const char *);\n\nenum gethdr_e { HDR_REQ," + " HDR_RESP, HDR_OBJ, HDR_BEREQ, HDR_BERESP };\nchar *VRT_GetHdr(c" + "onst struct sess *, enum gethdr_e where, const char *);\n" + "void VRT_SetHdr(const struct sess *, enum gethdr_e where, " + "const char *,\n const char *, ...);\nvoid VRT_handling(struct" + " sess *sp, unsigned hand);\n\nvoid VRT_hashdata(struct sess " + "*sp, const char *str, ...);\n\n/* Simple stuff */\n" + "int VRT_strcmp(const char *s1, const char *s2);\n" + "void VRT_memmove(void *dst, const void *src, unsigned len);\n" + "\nvoid VRT_ESI(struct sess *sp);\nvoid VRT_Rollback(struct " + "sess *sp);\n\n/* Synthetic pages */\nvoid VRT_synth_page(struct " + "sess *sp, unsigned flags, const char *, ...);\n\n" + "/* Backend related */\nvoid VRT_init_dir(struct cli *, struct " "director **, const char *name,\n int idx, const void *priv);\n" "void VRT_fini_dir(struct cli *, struct director *);\n" "\nchar *VRT_IP_string(const struct sess *sp, const struct " From tfheen at varnish-cache.org Tue Jul 6 09:58:57 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 11:58:57 +0200 Subject: r5019 - in trunk/varnish-cache: . bin/varnishd include lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 11:58:56 +0200 (Tue, 06 Jul 2010) New Revision: 5019 Removed: 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_fixed_token.c trunk/varnish-cache/lib/libvcl/vcc_obj.c trunk/varnish-cache/lib/libvcl/vcc_token_defs.h Modified: trunk/varnish-cache/bin/varnishd/Makefile.am trunk/varnish-cache/configure.ac trunk/varnish-cache/include/Makefile.am trunk/varnish-cache/lib/libvcl/Makefile.am trunk/varnish-cache/lib/libvcl/generate.py Log: Get rid of autogenerated files from SVN We now require python to build and we always regenerate the generated files. Modified: trunk/varnish-cache/bin/varnishd/Makefile.am =================================================================== --- trunk/varnish-cache/bin/varnishd/Makefile.am 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/bin/varnishd/Makefile.am 2010-07-06 09:58:56 UTC (rev 5019) @@ -1,6 +1,6 @@ # $Id$ -INCLUDES = -I$(top_srcdir)/include +INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include sbin_PROGRAMS = varnishd Modified: trunk/varnish-cache/configure.ac =================================================================== --- trunk/varnish-cache/configure.ac 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/configure.ac 2010-07-06 09:58:56 UTC (rev 5019) @@ -296,10 +296,7 @@ fi AM_MISSING_HAS_RUN -AC_CHECK_PROGS(PYTHON, [python python2 python2.5 python2.6 python3 python3.1 python3.2], :) -if test "$PYTHON" = :; then - PYTHON="${am_missing_run}python" -fi +AC_CHECK_PROGS(PYTHON, [python python2 python2.5 python2.6 python3 python3.1 python3.2], [AC_MSG_ERROR([Python is needed to build Varnish, please install python.])]) # Solaris defines SO_{RCV,SND}TIMEO, but does not implement them. # Varnish will build and run without these, but connections will not Modified: trunk/varnish-cache/include/Makefile.am =================================================================== --- trunk/varnish-cache/include/Makefile.am 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/include/Makefile.am 2010-07-06 09:58:56 UTC (rev 5019) @@ -49,3 +49,10 @@ vrt.h \ vrt_obj.h \ vss.h + +vcl_returns.h vcl.h vrt_obj.h: $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir)/include/vmod.h $(top_srcdir)/include/vrt.h + @PYTHON@ $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir) $(top_builddir) + +CLEANFILES = vcl_returns.h \ + vcl.h \ + vrt_obj.h Deleted: trunk/varnish-cache/include/vcl.h =================================================================== --- trunk/varnish-cache/include/vcl.h 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/include/vcl.h 2010-07-06 09:58:56 UTC (rev 5019) @@ -1,71 +0,0 @@ - -/* - * $Id$ - * - * NB: This file is machine generated, DO NOT EDIT! - * - * Edit and run generate.py instead - */ - -struct sess; -struct cli; - -typedef void vcl_init_f(struct cli *); -typedef void vcl_fini_f(struct cli *); -typedef int vcl_func_f(struct sess *sp); - -/* VCL Methods */ -#define VCL_MET_RECV (1U << 0) -#define VCL_MET_PIPE (1U << 1) -#define VCL_MET_PASS (1U << 2) -#define VCL_MET_HASH (1U << 3) -#define VCL_MET_MISS (1U << 4) -#define VCL_MET_HIT (1U << 5) -#define VCL_MET_FETCH (1U << 6) -#define VCL_MET_DELIVER (1U << 7) -#define VCL_MET_ERROR (1U << 8) - -#define VCL_MET_MAX 9 - -#define VCL_MET_MASK 0x1ff - -/* VCL Returns */ -#define VCL_RET_DELIVER 0 -#define VCL_RET_ERROR 1 -#define VCL_RET_FETCH 2 -#define VCL_RET_HASH 3 -#define VCL_RET_LOOKUP 4 -#define VCL_RET_PASS 5 -#define VCL_RET_PIPE 6 -#define VCL_RET_RESTART 7 - -#define VCL_RET_MAX 8 - -struct VCL_conf { - unsigned magic; -#define VCL_CONF_MAGIC 0x7406c509 /* from /dev/random */ - - struct director **director; - unsigned ndirector; - struct vrt_ref *ref; - unsigned nref; - unsigned busy; - unsigned discard; - - unsigned nsrc; - const char **srcname; - const char **srcbody; - - vcl_init_f *init_func; - vcl_fini_f *fini_func; - - vcl_func_f *recv_func; - vcl_func_f *pipe_func; - vcl_func_f *pass_func; - vcl_func_f *hash_func; - vcl_func_f *miss_func; - vcl_func_f *hit_func; - vcl_func_f *fetch_func; - vcl_func_f *deliver_func; - vcl_func_f *error_func; -}; Deleted: trunk/varnish-cache/include/vcl_returns.h =================================================================== --- trunk/varnish-cache/include/vcl_returns.h 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/include/vcl_returns.h 2010-07-06 09:58:56 UTC (rev 5019) @@ -1,66 +0,0 @@ - -/* - * $Id$ - * - * NB: This file is machine generated, DO NOT EDIT! - * - * Edit and run generate.py instead - */ - -#ifdef VCL_RET_MAC -VCL_RET_MAC(deliver, DELIVER, VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER | VCL_MET_ERROR) -VCL_RET_MAC(error, ERROR, VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH) -VCL_RET_MAC(fetch, FETCH, VCL_MET_MISS) -VCL_RET_MAC(hash, HASH, VCL_MET_HASH) -VCL_RET_MAC(lookup, LOOKUP, VCL_MET_RECV) -VCL_RET_MAC(pass, PASS, VCL_MET_RECV | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH) -VCL_RET_MAC(pipe, PIPE, VCL_MET_RECV | VCL_MET_PIPE) -VCL_RET_MAC(restart, RESTART, VCL_MET_PASS | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER | VCL_MET_ERROR) -#endif - -#ifdef VCL_MET_MAC -VCL_MET_MAC(recv,RECV, - ((1U << VCL_RET_ERROR) - | (1U << VCL_RET_PASS) - | (1U << VCL_RET_PIPE) - | (1U << VCL_RET_LOOKUP) -)) -VCL_MET_MAC(pipe,PIPE, - ((1U << VCL_RET_ERROR) - | (1U << VCL_RET_PIPE) -)) -VCL_MET_MAC(pass,PASS, - ((1U << VCL_RET_ERROR) - | (1U << VCL_RET_RESTART) - | (1U << VCL_RET_PASS) -)) -VCL_MET_MAC(hash,HASH, - ((1U << VCL_RET_HASH) -)) -VCL_MET_MAC(miss,MISS, - ((1U << VCL_RET_ERROR) - | (1U << VCL_RET_RESTART) - | (1U << VCL_RET_PASS) - | (1U << VCL_RET_FETCH) -)) -VCL_MET_MAC(hit,HIT, - ((1U << VCL_RET_ERROR) - | (1U << VCL_RET_RESTART) - | (1U << VCL_RET_PASS) - | (1U << VCL_RET_DELIVER) -)) -VCL_MET_MAC(fetch,FETCH, - ((1U << VCL_RET_ERROR) - | (1U << VCL_RET_RESTART) - | (1U << VCL_RET_PASS) - | (1U << VCL_RET_DELIVER) -)) -VCL_MET_MAC(deliver,DELIVER, - ((1U << VCL_RET_RESTART) - | (1U << VCL_RET_DELIVER) -)) -VCL_MET_MAC(error,ERROR, - ((1U << VCL_RET_RESTART) - | (1U << VCL_RET_DELIVER) -)) -#endif Deleted: trunk/varnish-cache/include/vrt_obj.h =================================================================== --- trunk/varnish-cache/include/vrt_obj.h 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/include/vrt_obj.h 2010-07-06 09:58:56 UTC (rev 5019) @@ -1,74 +0,0 @@ - -/* - * $Id$ - * - * NB: This file is machine generated, DO NOT EDIT! - * - * Edit and run generate.py instead - */ -struct sockaddr * VRT_r_client_ip(const struct sess *); -struct sockaddr * VRT_r_server_ip(struct sess *); -const char * VRT_r_server_hostname(struct sess *); -const char * VRT_r_server_identity(struct sess *); -int VRT_r_server_port(struct sess *); -const char * VRT_r_req_request(const struct sess *); -void VRT_l_req_request(const struct sess *, const char *, ...); -const char * VRT_r_req_url(const struct sess *); -void VRT_l_req_url(const struct sess *, const char *, ...); -const char * VRT_r_req_proto(const struct sess *); -void VRT_l_req_proto(const struct sess *, const char *, ...); -struct director * VRT_r_req_backend(struct sess *); -void VRT_l_req_backend(struct sess *, struct director *); -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_req_xid(struct sess *); -unsigned VRT_r_req_esi(struct sess *); -void VRT_l_req_esi(struct sess *, unsigned); -unsigned VRT_r_req_backend_healthy(const struct sess *); -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 *); -void VRT_l_bereq_url(const struct sess *, const char *, ...); -const char * VRT_r_bereq_proto(const struct sess *); -void VRT_l_bereq_proto(const struct sess *, const char *, ...); -double VRT_r_bereq_connect_timeout(struct sess *); -void VRT_l_bereq_connect_timeout(struct sess *, double); -double VRT_r_bereq_first_byte_timeout(struct sess *); -void VRT_l_bereq_first_byte_timeout(struct sess *, double); -double VRT_r_bereq_between_bytes_timeout(struct sess *); -void VRT_l_bereq_between_bytes_timeout(struct sess *, double); -const char * VRT_r_beresp_proto(const struct sess *); -void VRT_l_beresp_proto(const struct sess *, const char *, ...); -void VRT_l_beresp_saintmode(const struct sess *, double); -int VRT_r_beresp_status(const struct sess *); -void VRT_l_beresp_status(const struct sess *, int); -const char * VRT_r_beresp_response(const struct sess *); -void VRT_l_beresp_response(const struct sess *, const char *, ...); -unsigned VRT_r_beresp_cacheable(const struct sess *); -void VRT_l_beresp_cacheable(const struct sess *, unsigned); -double VRT_r_beresp_ttl(const struct sess *); -void VRT_l_beresp_ttl(const struct sess *, double); -double VRT_r_beresp_grace(const struct sess *); -void VRT_l_beresp_grace(const struct sess *, double); -const char * VRT_r_obj_proto(const struct sess *); -void VRT_l_obj_proto(const struct sess *, const char *, ...); -int VRT_r_obj_status(const struct sess *); -void VRT_l_obj_status(const struct sess *, int); -const char * VRT_r_obj_response(const struct sess *); -void VRT_l_obj_response(const struct sess *, const char *, ...); -int VRT_r_obj_hits(const struct sess *); -unsigned VRT_r_obj_cacheable(const struct sess *); -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_lastuse(const struct sess *); -const char * VRT_r_resp_proto(const struct sess *); -void VRT_l_resp_proto(const struct sess *, const char *, ...); -int VRT_r_resp_status(const struct sess *); -void VRT_l_resp_status(const struct sess *, int); -const char * VRT_r_resp_response(const struct sess *); -void VRT_l_resp_response(const struct sess *, const char *, ...); -double VRT_r_now(const struct sess *); Modified: trunk/varnish-cache/lib/libvcl/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvcl/Makefile.am 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/lib/libvcl/Makefile.am 2010-07-06 09:58:56 UTC (rev 5019) @@ -1,6 +1,6 @@ # $Id$ -INCLUDES = -I$(top_srcdir)/include +INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include lib_LTLIBRARIES = libvcl.la @@ -20,7 +20,7 @@ vcc_dir_random.c \ vcc_dir_round_robin.c \ vcc_parse.c \ - vcc_fixed_token.c \ + $(builddir)/vcc_fixed_token.c \ vcc_obj.c \ vcc_string.c \ vcc_symb.c \ @@ -31,11 +31,9 @@ EXTRA_DIST = \ generate.py -$(srcdir)/vcc_obj.c: $(srcdir)/generate.py - cd $(srcdir) && @PYTHON@ generate.py || true +$(builddir)/vcc_obj.c $(builddir)/vcc_fixed_token.c $(builddir)/vcc_token_defs.h: $(srcdir)/generate.py $(top_srcdir)/include/vmod.h $(top_srcdir)/include/vrt.h + @PYTHON@ $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir) $(top_builddir) -$(srcdir)/vcc_fixed_token.c: $(srcdir)/generate.py $(top_srcdir)/include/vcl.h $(top_srcdir)/include/vrt.h $(top_srcdir)/include/vrt_obj.h - cd $(srcdir) && @PYTHON@ generate.py || true - -$(srcdir)/vcc_token_defs.h: $(srcdir)/generate.py $(top_srcdir)/include/vcl.h $(top_srcdir)/include/vrt.h $(top_srcdir)/include/vrt_obj.h - cd $(srcdir) && @PYTHON@ generate.py || true +CLEANFILES = $(builddir)/vcc_token_defs.h \ + $(builddir)/vcc_fixed_token.c \ + $(builddir)/vcc_obj.c Modified: trunk/varnish-cache/lib/libvcl/generate.py =================================================================== --- trunk/varnish-cache/lib/libvcl/generate.py 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/lib/libvcl/generate.py 2010-07-06 09:58:56 UTC (rev 5019) @@ -40,6 +40,13 @@ # which hopefully makes for better error messages. # XXX: does it actually do that ? +import sys +srcroot = "../.." +buildroot = "../.." +if len(sys.argv) == 3: + srcroot = sys.argv[1] + buildroot = sys.argv[2] + tokens = { "T_INC": "++", "T_DEC": "--", @@ -535,44 +542,10 @@ ####################################################################### -fo = open("vcc_fixed_token.c", "w") - -file_header(fo) -fo.write(""" - -#include "config.h" -#include -#include -#include "config.h" -#include "vcc_priv.h" -#include "vsb.h" -""") - polish_tokens(tokens) -emit_vcl_fixed_token(fo, tokens) -emit_vcl_tnames(fo, tokens) -fo.write(""" -void -vcl_output_lang_h(struct vsb *sb) -{ -""") +fo = open(buildroot + "/lib/libvcl/vcc_token_defs.h", "w") -emit_file(fo, "../../include/vcl.h") -emit_file(fo, "../../include/vmod.h") -emit_file(fo, "../../include/vrt.h") -emit_file(fo, "../../include/vrt_obj.h") - -fo.write(""" -} -""") - -fo.close() - -####################################################################### - -fo = open("vcc_token_defs.h", "w") - file_header(fo) j = 128 @@ -596,10 +569,9 @@ for j in i[1]: rets[j] = True - ####################################################################### -fo = open("../../include/vcl_returns.h", "w") +fo = open(buildroot + "/include/vcl_returns.h", "w") file_header(fo) @@ -629,7 +601,7 @@ ####################################################################### -fo = open("../../include/vcl.h", "w") +fo = open(buildroot + "/include/vcl.h", "w") file_header(fo) @@ -721,10 +693,10 @@ ####################################################################### -fh=open("../../include/vrt_obj.h", "w") +fh = open(buildroot + "/include/vrt_obj.h", "w") file_header(fh) -fo=open("vcc_obj.c", "w") +fo = open(buildroot + "/lib/libvcl/vcc_obj.c", "w") file_header(fo) fo.write(""" @@ -775,3 +747,39 @@ fo.close() fh.close() + +####################################################################### + +fo = open(buildroot + "/lib/libvcl/vcc_fixed_token.c", "w") + +file_header(fo) +fo.write(""" + +#include "config.h" +#include +#include +#include "config.h" +#include "vcc_priv.h" +#include "vsb.h" +""") + +emit_vcl_fixed_token(fo, tokens) +emit_vcl_tnames(fo, tokens) + +fo.write(""" +void +vcl_output_lang_h(struct vsb *sb) +{ +""") + +emit_file(fo, buildroot + "/include/vcl.h") +emit_file(fo, srcroot + "/include/vmod.h") +emit_file(fo, srcroot + "/include/vrt.h") +emit_file(fo, buildroot + "/include/vrt_obj.h") + +fo.write(""" +} +""") + +fo.close() + Deleted: trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-06 09:58:56 UTC (rev 5019) @@ -1,384 +0,0 @@ - -/* - * $Id$ - * - * NB: This file is machine generated, DO NOT EDIT! - * - * Edit and run generate.py instead - */ - - -#include "config.h" -#include -#include -#include "config.h" -#include "vcc_priv.h" -#include "vsb.h" - -#define M1() do {*q = p + 1; return (p[0]); } while (0) -#define M2(c,t) do {if (p[1] == (c)) { *q = p + 2; return (t); }} while (0) - -unsigned -vcl_fixed_token(const char *p, const char **q) -{ - - switch (p[0]) { - case '!': - M2('=', T_NEQ); - M2('~', T_NOMATCH); - M1(); - case '%': - M1(); - case '&': - M2('&', T_CAND); - M1(); - case '(': - M1(); - case ')': - M1(); - case '*': - M2('=', T_MUL); - M1(); - case '+': - M2('+', T_INC); - M2('=', T_INCR); - M1(); - case ',': - M1(); - case '-': - M2('-', T_DEC); - M2('=', T_DECR); - M1(); - case '.': - M1(); - case '/': - M2('=', T_DIV); - M1(); - case ';': - M1(); - case '<': - M2('<', T_SHL); - M2('=', T_LEQ); - M1(); - case '=': - M2('=', T_EQ); - M1(); - case '>': - M2('=', T_GEQ); - M2('>', T_SHR); - M1(); - case 'e': - if (p[1] == 'l' && p[2] == 's' && p[3] == 'e' && - p[4] == 'i' && p[5] == 'f' && !isvar(p[6])) { - *q = p + 6; - return (T_ELSEIF); - } - if (p[1] == 'l' && p[2] == 's' && p[3] == 'i' && - p[4] == 'f' && !isvar(p[5])) { - *q = p + 5; - return (T_ELSIF); - } - if (p[1] == 'l' && p[2] == 's' && p[3] == 'e' && - !isvar(p[4])) { - *q = p + 4; - return (T_ELSE); - } - return (0); - case 'i': - if (p[1] == 'n' && p[2] == 'c' && p[3] == 'l' && - p[4] == 'u' && p[5] == 'd' && p[6] == 'e' && - !isvar(p[7])) { - *q = p + 7; - return (T_INCLUDE); - } - M2('f', T_IF); - return (0); - case '{': - M1(); - case '|': - M2('|', T_COR); - M1(); - case '}': - M1(); - case '~': - M1(); - default: - return (0); - } -} - -const char * const vcl_tnames[256] = { - ['!'] = "'!'", - ['%'] = "'%'", - ['&'] = "'&'", - ['('] = "'('", - [')'] = "')'", - ['*'] = "'*'", - ['+'] = "'+'", - [','] = "','", - ['-'] = "'-'", - ['.'] = "'.'", - ['/'] = "'/'", - [';'] = "';'", - ['<'] = "'<'", - ['='] = "'='", - ['>'] = "'>'", - ['{'] = "'{'", - ['|'] = "'|'", - ['}'] = "'}'", - ['~'] = "'~'", - [CNUM] = "CNUM", - [CSRC] = "CSRC", - [CSTR] = "CSTR", - [EOI] = "EOI", - [ID] = "ID", - [T_CAND] = "&&", - [T_COR] = "||", - [T_DEC] = "--", - [T_DECR] = "-=", - [T_DIV] = "/=", - [T_ELSE] = "else", - [T_ELSEIF] = "elseif", - [T_ELSIF] = "elsif", - [T_EQ] = "==", - [T_GEQ] = ">=", - [T_IF] = "if", - [T_INC] = "++", - [T_INCLUDE] = "include", - [T_INCR] = "+=", - [T_LEQ] = "<=", - [T_MUL] = "*=", - [T_NEQ] = "!=", - [T_NOMATCH] = "!~", - [T_SHL] = "<<", - [T_SHR] = ">>", -}; - -void -vcl_output_lang_h(struct vsb *sb) -{ - - /* ../../include/vcl.h */ - - vsb_cat(sb, "\n/*\n * $Id$\n *\n * NB: This file is machine " - "generated, DO NOT EDIT!\n *\n * Edit and run generate.py instead" - "\n */\n\nstruct sess;\nstruct cli;\n\ntypedef void vcl_init_f(st" - "ruct cli *);\ntypedef void vcl_fini_f(struct cli *);\n" - "typedef int vcl_func_f(struct sess *sp);\n\n/* VCL Methods " - "*/\n#define VCL_MET_RECV\t\t(1U << 0)\n#define VCL_MET_PIPE\t" - "\t(1U << 1)\n#define VCL_MET_PASS\t\t(1U << 2)\n#define VCL_MET_" - "HASH\t\t(1U << 3)\n#define VCL_MET_MISS\t\t(1U << 4)\n" - "#define VCL_MET_HIT\t\t(1U << 5)\n#define VCL_MET_FETCH\t\t" - "(1U << 6)\n#define VCL_MET_DELIVER\t\t(1U << 7)\n" - "#define VCL_MET_ERROR\t\t(1U << 8)\n\n#define VCL_MET_MAX\t" - "\t9\n\n#define VCL_MET_MASK\t\t0x1ff\n\n/* VCL Returns */\n" - "#define VCL_RET_DELIVER\t\t0\n#define VCL_RET_ERROR\t\t1\n" - "#define VCL_RET_FETCH\t\t2\n#define VCL_RET_HASH\t\t3\n" - "#define VCL_RET_LOOKUP\t\t4\n#define VCL_RET_PASS\t\t5\n" - "#define VCL_RET_PIPE\t\t6\n#define VCL_RET_RESTART\t\t7\n" - "\n#define VCL_RET_MAX\t\t8\n\nstruct VCL_conf {\n" - "\tunsigned\tmagic;\n#define VCL_CONF_MAGIC\t0x7406c509\t/* " - "from /dev/random */\n\n\tstruct director\t**director;\n" - "\tunsigned\tndirector;\n\tstruct vrt_ref\t*ref;\n" - "\tunsigned\tnref;\n\tunsigned\tbusy;\n\tunsigned\tdiscard;\n" - "\n\tunsigned\tnsrc;\n\tconst char\t**srcname;\n\tconst char\t" - "**srcbody;\n\n\tvcl_init_f\t*init_func;\n\tvcl_fini_f\t*fini_fun" - "c;\n\n\tvcl_func_f\t*recv_func;\n\tvcl_func_f\t*pipe_func;\n" - "\tvcl_func_f\t*pass_func;\n\tvcl_func_f\t*hash_func;\n" - "\tvcl_func_f\t*miss_func;\n\tvcl_func_f\t*hit_func;\n" - "\tvcl_func_f\t*fetch_func;\n\tvcl_func_f\t*deliver_func;\n" - "\tvcl_func_f\t*error_func;\n};\n"); - - /* ../../include/vmod.h */ - - vsb_cat(sb, "/*-\n * Copyright (c) 2010 Linpro AS\n" - " * All rights reserved.\n *\n * Author: Poul-Henning Kamp " - "\n *\n * Redistribution and use in source " - "and binary forms, with or without\n * modification, are permitte" - "d provided that the following conditions\n * are met:\n" - " * 1. Redistributions of source code must retain the above " - "copyright\n * notice, this list of conditions and the followi" - "ng disclaimer.\n * 2. Redistributions in binary form must " - "reproduce the above copyright\n * notice, this list of " - "conditions and the following disclaimer in the\n * documentat" - "ion and/or other materials provided with the distribution.\n" - " *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS " - "``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, " - "BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILIT" - "Y AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. " - " IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE\n" - " * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, " - "OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, " - "PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, " - "DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED " - "AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n" - " * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) " - "ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN " - "IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n" - " *\n * $Id$\n *\n * VCL modules\n *\n * XXX: When this file " - "is changed, lib/libvcl/generate.py *MUST* be rerun.\n" - " */\n\nstruct vmod_conf {\n\tunsigned\t\tmagic;\n" - "#define VMOD_CONF_MAGIC\t\t0x3f017730\n};\n"); - - /* ../../include/vrt.h */ - - vsb_cat(sb, "/*-\n * Copyright (c) 2006 Verdens Gang AS\n" - " * Copyright (c) 2006-2009 Linpro AS\n * All rights reserved.\n" - " *\n * Author: Poul-Henning Kamp \n" - " *\n * Redistribution and use in source and binary forms, " - "with or without\n * modification, are permitted provided that " - "the following conditions\n * are met:\n * 1. Redistributions " - "of source code must retain the above copyright\n * notice, " - "this list of conditions and the following disclaimer.\n" - " * 2. Redistributions in binary form must reproduce the above " - "copyright\n * notice, this list of conditions and the followi" - "ng disclaimer in the\n * documentation and/or other materials" - " provided with the distribution.\n *\n * THIS SOFTWARE IS " - "PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n" - " * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED" - " TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS " - "FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT " - "SHALL AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, " - "INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n" - " * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF " - "SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS;" - " OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY " - "OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR " - "TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n" - " * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE " - "POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * $Id: vrt.h 5001 2010-07-" - "04 14:40:33Z phk $\n *\n * Runtime support for compiled VCL " - "programs.\n *\n * XXX: When this file is changed, lib/libvcl/gen" - "erate.py *MUST* be rerun.\n */\n\nstruct sess;\nstruct vsb;\n" - "struct cli;\nstruct director;\nstruct VCL_conf;\n" - "struct sockaddr;\n\n/*\n * A backend probe specification\n" - " */\n\nextern const void * const vrt_magic_string_end;\n" - "\nstruct vrt_backend_probe {\n\tconst char\t*url;\n" - "\tconst char\t*request;\n\tdouble\t\ttimeout;\n\tdouble\t\t" - "interval;\n\tunsigned\texp_status;\n\tunsigned\twindow;\n" - "\tunsigned\tthreshold;\n\tunsigned\tinitial;\n};\n" - "\n/*\n * A backend is a host+port somewhere on the network\n" - " */\nstruct vrt_backend {\n\tconst char\t\t\t*vcl_name;\n" - "\tconst char\t\t\t*ident;\n\n\tconst char\t\t\t*hosthdr;\n" - "\n\tconst unsigned char\t\t*ipv4_sockaddr;\n\tconst unsigned " - "char\t\t*ipv6_sockaddr;\n\n\tdouble\t\t\t\tconnect_timeout;\n" - "\tdouble\t\t\t\tfirst_byte_timeout;\n\tdouble\t\t\t\tbetween_byt" - "es_timeout;\n\tunsigned\t\t\tmax_connections;\n\tunsigned\t" - "\t\tsaintmode_threshold;\n\tconst struct vrt_backend_probe\t" - "*probe;\n};\n\n/*\n * A director with an unpredictable reply\n" - " */\n\nstruct vrt_dir_random_entry {\n\tint\t\t\t\t\thost;\n" - "\tdouble\t\t\t\t\tweight;\n};\n\nstruct vrt_dir_random {\n" - "\tconst char\t\t\t\t*name;\n\tunsigned\t\t\t\tretries;\n" - "\tunsigned\t\t\t\tnmember;\n\tconst struct vrt_dir_random_entry\t" - "*members;\n};\n\n/*\n * A director with round robin selection\n" - " */\n\nstruct vrt_dir_round_robin_entry {\n\tint\t\t\t\t\thost;\n" - "};\n\nstruct vrt_dir_round_robin {\n\tconst char\t\t\t\t*name;\n" - "\tunsigned\t\t\t\tnmember;\n\tconst struct vrt_dir_round_robin_e" - "ntry\t*members;\n};\n\n\n/*\n * other stuff.\n * XXX: document " - "when bored\n */\n\nstruct vrt_ref {\n\tunsigned\tsource;\n" - "\tunsigned\toffset;\n\tunsigned\tline;\n\tunsigned\tpos;\n" - "\tunsigned\tcount;\n\tconst char\t*token;\n};\n\n" - "/* ACL related */\n#define VRT_ACL_MAXADDR\t\t16\t/* max(IPv4, " - "IPv6) */\n\nvoid VRT_acl_log(const struct sess *, const char " - "*msg);\n\n/* Regexp related */\nvoid VRT_re_init(void **, " - "const char *);\nvoid VRT_re_fini(void *);\nint VRT_re_match(cons" - "t char *, void *re);\nconst char *VRT_regsub(const struct " - "sess *sp, int all, const char *,\n void *, const char *);\n" - "\nvoid VRT_panic(struct sess *sp, const char *, ...);\n" - "void VRT_ban(struct sess *sp, char *, ...);\nvoid VRT_ban_string" - "(struct sess *sp, const char *, ...);\nvoid VRT_purge(struct " - "sess *sp, double ttl, double grace);\nvoid VRT_log(struct " - "sess *, const char *msg, ...);\n\nvoid VRT_count(const struct " - "sess *, unsigned);\nint VRT_rewrite(const char *, const char " - "*);\nvoid VRT_error(struct sess *, unsigned, const char *);\n" - "int VRT_switch_config(const char *);\n\nenum gethdr_e { HDR_REQ," - " HDR_RESP, HDR_OBJ, HDR_BEREQ, HDR_BERESP };\nchar *VRT_GetHdr(c" - "onst struct sess *, enum gethdr_e where, const char *);\n" - "void VRT_SetHdr(const struct sess *, enum gethdr_e where, " - "const char *,\n const char *, ...);\nvoid VRT_handling(struct" - " sess *sp, unsigned hand);\n\nvoid VRT_hashdata(struct sess " - "*sp, const char *str, ...);\n\n/* Simple stuff */\n" - "int VRT_strcmp(const char *s1, const char *s2);\n" - "void VRT_memmove(void *dst, const void *src, unsigned len);\n" - "\nvoid VRT_ESI(struct sess *sp);\nvoid VRT_Rollback(struct " - "sess *sp);\n\n/* Synthetic pages */\nvoid VRT_synth_page(struct " - "sess *sp, unsigned flags, const char *, ...);\n\n" - "/* Backend related */\nvoid VRT_init_dir(struct cli *, struct " - "director **, const char *name,\n int idx, const void *priv);\n" - "void VRT_fini_dir(struct cli *, struct director *);\n" - "\nchar *VRT_IP_string(const struct sess *sp, const struct " - "sockaddr *sa);\nchar *VRT_int_string(const struct sess *sp, " - "int);\nchar *VRT_double_string(const struct sess *sp, double);\n" - "char *VRT_time_string(const struct sess *sp, double);\n" - "const char *VRT_backend_string(struct sess *sp);\n" - "\n#define VRT_done(sp, hand)\t\t\t\\\n\tdo {\t\t\t\t\t\\\n" - "\t\tVRT_handling(sp, hand);\t\t\\\n\t\treturn (1);\t\t\t\\\n" - "\t} while (0)\n"); - - /* ../../include/vrt_obj.h */ - - vsb_cat(sb, "\n/*\n * $Id$\n *\n * NB: This file is machine " - "generated, DO NOT EDIT!\n *\n * Edit and run generate.py instead" - "\n */\nstruct sockaddr * VRT_r_client_ip(const struct sess " - "*);\nstruct sockaddr * VRT_r_server_ip(struct sess *);\n" - "const char * VRT_r_server_hostname(struct sess *);\n" - "const char * VRT_r_server_identity(struct sess *);\n" - "int VRT_r_server_port(struct sess *);\nconst char * VRT_r_req_re" - "quest(const struct sess *);\nvoid VRT_l_req_request(const " - "struct sess *, const char *, ...);\nconst char * VRT_r_req_url(c" - "onst struct sess *);\nvoid VRT_l_req_url(const struct sess " - "*, const char *, ...);\nconst char * VRT_r_req_proto(const " - "struct sess *);\nvoid VRT_l_req_proto(const struct sess *, " - "const char *, ...);\nstruct director * VRT_r_req_backend(struct " - "sess *);\nvoid VRT_l_req_backend(struct sess *, struct director " - "*);\nint VRT_r_req_restarts(const struct sess *);\n" - "double VRT_r_req_grace(struct sess *);\nvoid VRT_l_req_grace(str" - "uct sess *, double);\nconst char * VRT_r_req_xid(struct sess " - "*);\nunsigned VRT_r_req_esi(struct sess *);\nvoid VRT_l_req_esi(" - "struct sess *, unsigned);\nunsigned VRT_r_req_backend_healthy(co" - "nst struct sess *);\nconst char * VRT_r_bereq_request(const " - "struct sess *);\nvoid VRT_l_bereq_request(const struct sess " - "*, const char *, ...);\nconst char * VRT_r_bereq_url(const " - "struct sess *);\nvoid VRT_l_bereq_url(const struct sess *, " - "const char *, ...);\nconst char * VRT_r_bereq_proto(const " - "struct sess *);\nvoid VRT_l_bereq_proto(const struct sess " - "*, const char *, ...);\ndouble VRT_r_bereq_connect_timeout(struc" - "t sess *);\nvoid VRT_l_bereq_connect_timeout(struct sess *, " - "double);\ndouble VRT_r_bereq_first_byte_timeout(struct sess " - "*);\nvoid VRT_l_bereq_first_byte_timeout(struct sess *, double);" - "\ndouble VRT_r_bereq_between_bytes_timeout(struct sess *);\n" - "void VRT_l_bereq_between_bytes_timeout(struct sess *, double);\n" - "const char * VRT_r_beresp_proto(const struct sess *);\n" - "void VRT_l_beresp_proto(const struct sess *, const char *, " - "...);\nvoid VRT_l_beresp_saintmode(const struct sess *, double);" - "\nint VRT_r_beresp_status(const struct sess *);\n" - "void VRT_l_beresp_status(const struct sess *, int);\n" - "const char * VRT_r_beresp_response(const struct sess *);\n" - "void VRT_l_beresp_response(const struct sess *, const char " - "*, ...);\nunsigned VRT_r_beresp_cacheable(const struct sess " - "*);\nvoid VRT_l_beresp_cacheable(const struct sess *, unsigned);" - "\ndouble VRT_r_beresp_ttl(const struct sess *);\n" - "void VRT_l_beresp_ttl(const struct sess *, double);\n" - "double VRT_r_beresp_grace(const struct sess *);\n" - "void VRT_l_beresp_grace(const struct sess *, double);\n" - "const char * VRT_r_obj_proto(const struct sess *);\n" - "void VRT_l_obj_proto(const struct sess *, const char *, ...);\n" - "int VRT_r_obj_status(const struct sess *);\nvoid VRT_l_obj_statu" - "s(const struct sess *, int);\nconst char * VRT_r_obj_response(co" - "nst struct sess *);\nvoid VRT_l_obj_response(const struct " - "sess *, const char *, ...);\nint VRT_r_obj_hits(const struct " - "sess *);\nunsigned VRT_r_obj_cacheable(const struct sess *);\n" - "void VRT_l_obj_cacheable(const struct sess *, unsigned);\n" - "double VRT_r_obj_ttl(const struct sess *);\nvoid VRT_l_obj_ttl(c" - "onst struct sess *, double);\ndouble VRT_r_obj_grace(const " - "struct sess *);\nvoid VRT_l_obj_grace(const struct sess *, " - "double);\ndouble VRT_r_obj_lastuse(const struct sess *);\n" - "const char * VRT_r_resp_proto(const struct sess *);\n" - "void VRT_l_resp_proto(const struct sess *, const char *, ...);\n" - "int VRT_r_resp_status(const struct sess *);\nvoid VRT_l_resp_sta" - "tus(const struct sess *, int);\nconst char * VRT_r_resp_response" - "(const struct sess *);\nvoid VRT_l_resp_response(const struct " - "sess *, const char *, ...);\ndouble VRT_r_now(const struct " - "sess *);\n"); - -} Deleted: trunk/varnish-cache/lib/libvcl/vcc_obj.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_obj.c 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/lib/libvcl/vcc_obj.c 2010-07-06 09:58:56 UTC (rev 5019) @@ -1,366 +0,0 @@ - -/* - * $Id$ - * - * NB: This file is machine generated, DO NOT EDIT! - * - * Edit and run generate.py instead - */ - -#include "config.h" -#include -#include "vcc_compile.h" - -const struct var vcc_vars[] = { - { "client.ip", IP, 9, - "VRT_r_client_ip(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - NULL, /* No writes allowed */ - 0, - 0, - }, - { "server.ip", IP, 9, - "VRT_r_server_ip(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - NULL, /* No writes allowed */ - 0, - 0, - }, - { "server.hostname", STRING, 15, - "VRT_r_server_hostname(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - NULL, /* No writes allowed */ - 0, - 0, - }, - { "server.identity", STRING, 15, - "VRT_r_server_identity(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - NULL, /* No writes allowed */ - 0, - 0, - }, - { "server.port", INT, 11, - "VRT_r_server_port(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - NULL, /* No writes allowed */ - 0, - 0, - }, - { "req.request", STRING, 11, - "VRT_r_req_request(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - "VRT_l_req_request(sp, ", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - 0, - }, - { "req.url", STRING, 7, - "VRT_r_req_url(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - "VRT_l_req_url(sp, ", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - 0, - }, - { "req.proto", STRING, 9, - "VRT_r_req_proto(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - "VRT_l_req_proto(sp, ", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - 0, - }, - { "req.http.", HEADER, 9, - "VRT_r_req_http_(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - "VRT_l_req_http_(sp, ", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - "HDR_REQ", - }, - { "req.backend", BACKEND, 11, - "VRT_r_req_backend(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - "VRT_l_req_backend(sp, ", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - 0, - }, - { "req.restarts", INT, 12, - "VRT_r_req_restarts(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - NULL, /* No writes allowed */ - 0, - 0, - }, - { "req.grace", DURATION, 9, - "VRT_r_req_grace(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - "VRT_l_req_grace(sp, ", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - 0, - }, - { "req.xid", STRING, 7, - "VRT_r_req_xid(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - NULL, /* No writes allowed */ - 0, - 0, - }, - { "req.esi", BOOL, 7, - "VRT_r_req_esi(sp)", - VCL_MET_RECV | VCL_MET_FETCH | VCL_MET_DELIVER | VCL_MET_ERROR, - "VRT_l_req_esi(sp, ", - VCL_MET_RECV | VCL_MET_FETCH | VCL_MET_DELIVER | VCL_MET_ERROR, - 0, - }, - { "req.backend.healthy", BOOL, 19, - "VRT_r_req_backend_healthy(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - NULL, /* No writes allowed */ - 0, - 0, - }, - { "bereq.request", STRING, 13, - "VRT_r_bereq_request(sp)", - VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH, - "VRT_l_bereq_request(sp, ", - VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH, - 0, - }, - { "bereq.url", STRING, 9, - "VRT_r_bereq_url(sp)", - VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH, - "VRT_l_bereq_url(sp, ", - VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH, - 0, - }, - { "bereq.proto", STRING, 11, - "VRT_r_bereq_proto(sp)", - VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH, - "VRT_l_bereq_proto(sp, ", - VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH, - 0, - }, - { "bereq.http.", HEADER, 11, - "VRT_r_bereq_http_(sp)", - VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH, - "VRT_l_bereq_http_(sp, ", - VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS | VCL_MET_FETCH, - "HDR_BEREQ", - }, - { "bereq.connect_timeout", DURATION, 21, - "VRT_r_bereq_connect_timeout(sp)", - VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS, - "VRT_l_bereq_connect_timeout(sp, ", - VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_MISS, - 0, - }, - { "bereq.first_byte_timeout", DURATION, 24, - "VRT_r_bereq_first_byte_timeout(sp)", - VCL_MET_PASS | VCL_MET_MISS, - "VRT_l_bereq_first_byte_timeout(sp, ", - VCL_MET_PASS | VCL_MET_MISS, - 0, - }, - { "bereq.between_bytes_timeout", DURATION, 27, - "VRT_r_bereq_between_bytes_timeout(sp)", - VCL_MET_PASS | VCL_MET_MISS, - "VRT_l_bereq_between_bytes_timeout(sp, ", - VCL_MET_PASS | VCL_MET_MISS, - 0, - }, - { "beresp.proto", STRING, 12, - "VRT_r_beresp_proto(sp)", - VCL_MET_FETCH, - "VRT_l_beresp_proto(sp, ", - VCL_MET_FETCH, - 0, - }, - { "beresp.saintmode", DURATION, 16, - NULL, /* No reads allowed */ - 0, - "VRT_l_beresp_saintmode(sp, ", - VCL_MET_FETCH, - 0, - }, - { "beresp.status", INT, 13, - "VRT_r_beresp_status(sp)", - VCL_MET_FETCH, - "VRT_l_beresp_status(sp, ", - VCL_MET_FETCH, - 0, - }, - { "beresp.response", STRING, 15, - "VRT_r_beresp_response(sp)", - VCL_MET_FETCH, - "VRT_l_beresp_response(sp, ", - VCL_MET_FETCH, - 0, - }, - { "beresp.http.", HEADER, 12, - "VRT_r_beresp_http_(sp)", - VCL_MET_FETCH, - "VRT_l_beresp_http_(sp, ", - VCL_MET_FETCH, - "HDR_BERESP", - }, - { "beresp.cacheable", BOOL, 16, - "VRT_r_beresp_cacheable(sp)", - VCL_MET_FETCH, - "VRT_l_beresp_cacheable(sp, ", - VCL_MET_FETCH, - 0, - }, - { "beresp.ttl", DURATION, 10, - "VRT_r_beresp_ttl(sp)", - VCL_MET_FETCH, - "VRT_l_beresp_ttl(sp, ", - VCL_MET_FETCH, - 0, - }, - { "beresp.grace", DURATION, 12, - "VRT_r_beresp_grace(sp)", - VCL_MET_FETCH, - "VRT_l_beresp_grace(sp, ", - VCL_MET_FETCH, - 0, - }, - { "obj.proto", STRING, 9, - "VRT_r_obj_proto(sp)", - VCL_MET_HIT | VCL_MET_ERROR, - "VRT_l_obj_proto(sp, ", - VCL_MET_HIT | VCL_MET_ERROR, - 0, - }, - { "obj.status", INT, 10, - "VRT_r_obj_status(sp)", - VCL_MET_ERROR, - "VRT_l_obj_status(sp, ", - VCL_MET_ERROR, - 0, - }, - { "obj.response", STRING, 12, - "VRT_r_obj_response(sp)", - VCL_MET_ERROR, - "VRT_l_obj_response(sp, ", - VCL_MET_ERROR, - 0, - }, - { "obj.hits", INT, 8, - "VRT_r_obj_hits(sp)", - VCL_MET_HIT | VCL_MET_DELIVER, - NULL, /* No writes allowed */ - 0, - 0, - }, - { "obj.http.", HEADER, 9, - "VRT_r_obj_http_(sp)", - VCL_MET_HIT | VCL_MET_ERROR, - "VRT_l_obj_http_(sp, ", - VCL_MET_ERROR, - "HDR_OBJ", - }, - { "obj.cacheable", BOOL, 13, - "VRT_r_obj_cacheable(sp)", - VCL_MET_HIT, - "VRT_l_obj_cacheable(sp, ", - VCL_MET_HIT, - 0, - }, - { "obj.ttl", DURATION, 7, - "VRT_r_obj_ttl(sp)", - VCL_MET_HIT | VCL_MET_ERROR, - "VRT_l_obj_ttl(sp, ", - VCL_MET_HIT | VCL_MET_ERROR, - 0, - }, - { "obj.grace", DURATION, 9, - "VRT_r_obj_grace(sp)", - VCL_MET_HIT | VCL_MET_ERROR, - "VRT_l_obj_grace(sp, ", - VCL_MET_HIT | VCL_MET_ERROR, - 0, - }, - { "obj.lastuse", DURATION, 11, - "VRT_r_obj_lastuse(sp)", - VCL_MET_HIT | VCL_MET_DELIVER | VCL_MET_ERROR, - NULL, /* No writes allowed */ - 0, - 0, - }, - { "resp.proto", STRING, 10, - "VRT_r_resp_proto(sp)", - VCL_MET_DELIVER, - "VRT_l_resp_proto(sp, ", - VCL_MET_DELIVER, - 0, - }, - { "resp.status", INT, 11, - "VRT_r_resp_status(sp)", - VCL_MET_DELIVER, - "VRT_l_resp_status(sp, ", - VCL_MET_DELIVER, - 0, - }, - { "resp.response", STRING, 13, - "VRT_r_resp_response(sp)", - VCL_MET_DELIVER, - "VRT_l_resp_response(sp, ", - VCL_MET_DELIVER, - 0, - }, - { "resp.http.", HEADER, 10, - "VRT_r_resp_http_(sp)", - VCL_MET_DELIVER, - "VRT_l_resp_http_(sp, ", - VCL_MET_DELIVER, - "HDR_RESP", - }, - { "now", TIME, 3, - "VRT_r_now(sp)", - VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH - | VCL_MET_MISS | VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DELIVER - | VCL_MET_ERROR, - NULL, /* No writes allowed */ - 0, - 0, - }, - { NULL } -}; Deleted: trunk/varnish-cache/lib/libvcl/vcc_token_defs.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_token_defs.h 2010-07-06 07:50:45 UTC (rev 5018) +++ trunk/varnish-cache/lib/libvcl/vcc_token_defs.h 2010-07-06 09:58:56 UTC (rev 5019) @@ -1,33 +0,0 @@ - -/* - * $Id$ - * - * NB: This file is machine generated, DO NOT EDIT! - * - * Edit and run generate.py instead - */ -#define CNUM 128 -#define CSRC 129 -#define CSTR 130 -#define EOI 131 -#define ID 132 -#define T_CAND 133 -#define T_COR 134 -#define T_DEC 135 -#define T_DECR 136 -#define T_DIV 137 -#define T_ELSE 138 -#define T_ELSEIF 139 -#define T_ELSIF 140 -#define T_EQ 141 -#define T_GEQ 142 -#define T_IF 143 -#define T_INC 144 -#define T_INCLUDE 145 -#define T_INCR 146 -#define T_LEQ 147 -#define T_MUL 148 -#define T_NEQ 149 -#define T_NOMATCH 150 -#define T_SHL 151 -#define T_SHR 152 From tfheen at varnish-cache.org Tue Jul 6 10:14:47 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 12:14:47 +0200 Subject: r5020 - trunk/varnish-cache/include Message-ID: Author: tfheen Date: 2010-07-06 12:14:47 +0200 (Tue, 06 Jul 2010) New Revision: 5020 Modified: trunk/varnish-cache/include/Makefile.am Log: Make sure vmod.h is distributed as well Modified: trunk/varnish-cache/include/Makefile.am =================================================================== --- trunk/varnish-cache/include/Makefile.am 2010-07-06 09:58:56 UTC (rev 5019) +++ trunk/varnish-cache/include/Makefile.am 2010-07-06 10:14:47 UTC (rev 5020) @@ -45,6 +45,7 @@ vlu.h \ vbm.h \ vmb.h \ + vmod.h \ vre.h \ vrt.h \ vrt_obj.h \ From tfheen at varnish-cache.org Tue Jul 6 11:21:22 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 13:21:22 +0200 Subject: r5021 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 13:21:21 +0200 (Tue, 06 Jul 2010) New Revision: 5021 Added: branches/2.1/varnish-cache/include/vmb.h branches/2.1/varnish-cache/lib/libvarnish/vmb.c Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/Makefile.am branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4818: Face the music and do memory barriers sensibly. This really belongs in POSIX pthreads :-( Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Copied: branches/2.1/varnish-cache/include/vmb.h (from rev 4818, trunk/varnish-cache/include/vmb.h) =================================================================== --- branches/2.1/varnish-cache/include/vmb.h (rev 0) +++ branches/2.1/varnish-cache/include/vmb.h 2010-07-06 11:21:21 UTC (rev 5021) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2010 Redpill 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$ + * + * Memory barriers + * + */ + +#ifndef VMB_H_INCLUDED +#define VMB_H_INCLUDED + +void vmb_pthread(void); + +#if defined(__FreeBSD__) +#include +#include +#define VMB() mb() +#define VWMB() wmb() +#define VRMB() rmb() +#else +#define VMB() vmb_pthread() +#define VWMB() vmb_pthread() +#define VRMB() vmb_pthread() +#endif + +#endif /* VMB_H_INCLUDED */ Modified: branches/2.1/varnish-cache/lib/libvarnish/Makefile.am =================================================================== --- branches/2.1/varnish-cache/lib/libvarnish/Makefile.am 2010-07-06 10:14:47 UTC (rev 5020) +++ branches/2.1/varnish-cache/lib/libvarnish/Makefile.am 2010-07-06 11:21:21 UTC (rev 5021) @@ -23,6 +23,7 @@ version.c \ vev.c \ vlu.c \ + vmb.c \ vpf.c \ vre.c \ vsb.c \ Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 Copied: branches/2.1/varnish-cache/lib/libvarnish/vmb.c (from rev 4818, trunk/varnish-cache/lib/libvarnish/vmb.c) =================================================================== --- branches/2.1/varnish-cache/lib/libvarnish/vmb.c (rev 0) +++ branches/2.1/varnish-cache/lib/libvarnish/vmb.c 2010-07-06 11:21:21 UTC (rev 5021) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2010 Redpill 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. + */ + +#include +#include "libvarnish.h" +#include "vmb.h" + +static pthread_mutex_t mb_mtx; +static pthread_once_t mb_mtx_once = PTHREAD_ONCE_INIT; + +static void +vmb_init(void) +{ + + AZ(pthread_mutex_init(&mb_mtx, NULL)); +} + + +void +vmb_pthread(void) +{ + + AZ(pthread_once(&mb_mtx_once, vmb_init)); + + AZ(pthread_mutex_lock(&mb_mtx)); + AZ(pthread_mutex_unlock(&mb_mtx)); +} Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 From tfheen at varnish-cache.org Tue Jul 6 11:28:01 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 13:28:01 +0200 Subject: r5022 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 13:28:01 +0200 (Tue, 06 Jul 2010) New Revision: 5022 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/include/vmb.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4977: Check __FreeBSD_version for memory barrier definition Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Modified: branches/2.1/varnish-cache/include/vmb.h =================================================================== --- branches/2.1/varnish-cache/include/vmb.h 2010-07-06 11:21:21 UTC (rev 5021) +++ branches/2.1/varnish-cache/include/vmb.h 2010-07-06 11:28:01 UTC (rev 5022) @@ -36,7 +36,7 @@ void vmb_pthread(void); -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) && __FreeBSD_version >= 800058 #include #include #define VMB() mb() Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 From tfheen at varnish-cache.org Tue Jul 6 11:35:24 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 13:35:24 +0200 Subject: r5023 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 13:35:23 +0200 (Tue, 06 Jul 2010) New Revision: 5023 Added: branches/2.1/varnish-cache/bin/varnishtest/tests/r00700.vtc Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_http.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4829: Allow TAB in the 3rd field of the first line of HTTP requests and responses. Fixes: #700 Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_http.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_http.c 2010-07-06 11:28:01 UTC (rev 5022) +++ branches/2.1/varnish-cache/bin/varnishd/cache_http.c 2010-07-06 11:35:23 UTC (rev 5023) @@ -474,7 +474,7 @@ q = p; if (!vct_iscrlf(*p)) { for (; !vct_iscrlf(*p); p++) - if (vct_isctl(*p)) + if (!vct_issep(*p) && vct_isctl(*p)) return (-1); } hp->hd[h3].b = q; Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Copied: branches/2.1/varnish-cache/bin/varnishtest/tests/r00700.vtc (from rev 4829, trunk/varnish-cache/bin/varnishtest/tests/r00700.vtc) =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/r00700.vtc (rev 0) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/r00700.vtc 2010-07-06 11:35:23 UTC (rev 5023) @@ -0,0 +1,16 @@ +# $Id$ + +test "check TAB in 3 header field" + +server s1 { + rxreq + send "HTTP/1.1 666 foo\tbar\n\nFOO" +} -start + +varnish v1 -vcl+backend {} -start + +client c1 { + txreq + rxresp + expect resp.status == 666 +} -run Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4977 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 From tfheen at varnish-cache.org Tue Jul 6 11:44:38 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 13:44:38 +0200 Subject: r5024 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 13:44:38 +0200 (Tue, 06 Jul 2010) New Revision: 5024 Added: branches/2.1/varnish-cache/bin/varnishtest/tests/r00702.vtc Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_response.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4865: Fix an off-by-one bug, when requested range exceeds available data. Submitted by: Luc Saillard Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_response.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_response.c 2010-07-06 11:35:23 UTC (rev 5023) +++ branches/2.1/varnish-cache/bin/varnishd/cache_response.c 2010-07-06 11:44:38 UTC (rev 5024) @@ -169,7 +169,7 @@ return; if (high >= sp->obj->len) - high = sp->obj->len; + high = sp->obj->len - 1; if (low > high) return; Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Copied: branches/2.1/varnish-cache/bin/varnishtest/tests/r00702.vtc (from rev 4865, trunk/varnish-cache/bin/varnishtest/tests/r00702.vtc) =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/r00702.vtc (rev 0) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/r00702.vtc 2010-07-06 11:44:38 UTC (rev 5024) @@ -0,0 +1,22 @@ +# $Id$ + +test "Range bug" + +server s1 { + rxreq + txresp -bodylen 100 +} -start + +varnish v1 -vcl+backend { +} -start + +varnish v1 -cliok "param.set http_range_support on" + + +client c1 { + txreq -hdr "Range: bytes=50-200" + rxresp + expect resp.status == 206 + expect resp.bodylen == 50 +} -run + Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4977 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 From tfheen at varnish-cache.org Tue Jul 6 11:58:22 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 13:58:22 +0200 Subject: r5025 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 13:58:22 +0200 (Tue, 06 Jul 2010) New Revision: 5025 Added: branches/2.1/varnish-cache/bin/varnishtest/tests/r00704.vtc Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_response.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/c00034.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4866: Make bytes=-100 work I have no idea how I overlooked that a "bytes=-100" range was from the end of the object, but I did. Fixes #704. Reported by: Luc Saillard Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_response.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_response.c 2010-07-06 11:44:38 UTC (rev 5024) +++ branches/2.1/varnish-cache/bin/varnishd/cache_response.c 2010-07-06 11:58:22 UTC (rev 5025) @@ -131,7 +131,7 @@ static void res_dorange(struct sess *sp, const char *r, unsigned *plow, unsigned *phigh) { - unsigned low, high; + unsigned low, high, has_low; (void)sp; if (strncmp(r, "bytes=", 6)) @@ -139,10 +139,11 @@ r += 6; /* The low end of range */ - low = 0; + has_low = low = 0; if (!vct_isdigit(*r) && *r != '-') return; while (vct_isdigit(*r)) { + has_low = 1; low *= 10; low += *r - '0'; r++; @@ -163,6 +164,10 @@ high += *r - '0'; r++; } + if (!has_low) { + low = sp->obj->len - high; + high = sp->obj->len - 1; + } } else high = sp->obj->len - 1; if (*r != '\0') Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Modified: branches/2.1/varnish-cache/bin/varnishtest/tests/c00034.vtc =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/c00034.vtc 2010-07-06 11:44:38 UTC (rev 5024) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/c00034.vtc 2010-07-06 11:58:22 UTC (rev 5025) @@ -59,7 +59,7 @@ txreq -hdr "Range: bytes=-9" rxresp expect resp.status == 206 - expect resp.bodylen == 10 + expect resp.bodylen == 9 txreq -hdr "Range: bytes=-" rxresp Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Copied: branches/2.1/varnish-cache/bin/varnishtest/tests/r00704.vtc (from rev 4866, trunk/varnish-cache/bin/varnishtest/tests/r00704.vtc) =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/r00704.vtc (rev 0) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/r00704.vtc 2010-07-06 11:58:22 UTC (rev 5025) @@ -0,0 +1,22 @@ +# $Id$ + +test "Range bug" + +server s1 { + rxreq + txresp -bodylen 100 +} -start + +varnish v1 -vcl+backend { +} -start + +varnish v1 -cliok "param.set http_range_support on" + + +client c1 { + txreq -hdr "Range: bytes=-20" + rxresp + expect resp.status == 206 + expect resp.bodylen == 20 +} -run + Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865,4977 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 From tfheen at varnish-cache.org Tue Jul 6 12:06:04 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 14:06:04 +0200 Subject: r5026 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 14:06:03 +0200 (Tue, 06 Jul 2010) New Revision: 5026 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/default.vcl branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4867: Don't bog our webserver down when somebodys backend croaks. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Modified: branches/2.1/varnish-cache/bin/varnishd/default.vcl =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/default.vcl 2010-07-06 11:58:22 UTC (rev 5025) +++ branches/2.1/varnish-cache/bin/varnishd/default.vcl 2010-07-06 12:06:03 UTC (rev 5026) @@ -132,9 +132,7 @@

Guru Meditation:

XID: "} req.xid {"


-
- Varnish cache server -
+

Varnish cache server

"}; Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4866,4977 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 From tfheen at varnish-cache.org Tue Jul 6 12:22:12 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 14:22:12 +0200 Subject: r5027 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvarnishapi varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 14:22:12 +0200 (Tue, 06 Jul 2010) New Revision: 5027 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvarnishapi/shmlog.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4981: Typo in -X matching in varnishapi Fixes: #681 Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 Modified: branches/2.1/varnish-cache/lib/libvarnishapi/shmlog.c =================================================================== --- branches/2.1/varnish-cache/lib/libvarnishapi/shmlog.c 2010-07-06 12:06:03 UTC (rev 5026) +++ branches/2.1/varnish-cache/lib/libvarnishapi/shmlog.c 2010-07-06 12:22:12 UTC (rev 5027) @@ -347,7 +347,7 @@ continue; } if (vd->regexcl != NULL) { - i = VRE_exec(vd->regincl, + i = VRE_exec(vd->regexcl, (char *)p + SHMLOG_DATA, SHMLOG_LEN(p) - SHMLOG_DATA, /* Length */ 0, 0, NULL, 0); Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 From tfheen at varnish-cache.org Tue Jul 6 12:44:38 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 14:44:38 +0200 Subject: r5028 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 14:44:37 +0200 (Tue, 06 Jul 2010) New Revision: 5028 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_center.c branches/2.1/varnish-cache/bin/varnishd/cache_response.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4980: Emit Length for client side right before ReqEnd, to summarize ESI transactions correctly. Only emit Length and ReqEnd if we have an XID. Fixes: #709 Fixes: #720 Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_center.c 2010-07-06 12:22:12 UTC (rev 5027) +++ branches/2.1/varnish-cache/bin/varnishd/cache_center.c 2010-07-06 12:44:37 UTC (rev 5028) @@ -246,12 +246,14 @@ if (sp->xid == 0) { sp->t_req = sp->t_end; sp->t_resp = sp->t_end; + } else { + dp = sp->t_resp - sp->t_req; + da = sp->t_end - sp->t_resp; + dh = sp->t_req - sp->t_open; + WSP(sp, SLT_Length, "%u", sp->acct_req.bodybytes); + WSL(sp->wrk, SLT_ReqEnd, sp->id, "%u %.9f %.9f %.9f %.9f %.9f", + sp->xid, sp->t_req, sp->t_end, dh, dp, da); } - dp = sp->t_resp - sp->t_req; - da = sp->t_end - sp->t_resp; - dh = sp->t_req - sp->t_open; - WSL(sp->wrk, SLT_ReqEnd, sp->id, "%u %.9f %.9f %.9f %.9f %.9f", - sp->xid, sp->t_req, sp->t_end, dh, dp, da); sp->xid = 0; sp->t_open = sp->t_end; Modified: branches/2.1/varnish-cache/bin/varnishd/cache_response.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_response.c 2010-07-06 12:22:12 UTC (rev 5027) +++ branches/2.1/varnish-cache/bin/varnishd/cache_response.c 2010-07-06 12:44:37 UTC (rev 5028) @@ -50,8 +50,6 @@ char lm[64]; char *p; - WSP(sp, SLT_Length, "%u", 0); - http_ClrHeader(sp->wrk->resp); sp->wrk->resp->logtag = HTTP_Tx; http_SetResp(sp->wrk->resp, "HTTP/1.1", "304", "Not Modified"); @@ -203,8 +201,6 @@ if (sp->obj->response == 200 && sp->http->conds && res_do_conds(sp)) return; - WSP(sp, SLT_Length, "%u", sp->obj->len); - http_ClrHeader(sp->wrk->resp); sp->wrk->resp->logtag = HTTP_Tx; http_CopyResp(sp->wrk->resp, sp->obj->http); Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4981 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 From tfheen at varnish-cache.org Tue Jul 6 12:51:04 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 14:51:04 +0200 Subject: r5029 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 14:51:04 +0200 (Tue, 06 Jul 2010) New Revision: 5029 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache.h branches/2.1/varnish-cache/bin/varnishd/cache_acceptor.c branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_center.c branches/2.1/varnish-cache/bin/varnishd/cache_esi.c branches/2.1/varnish-cache/bin/varnishd/cache_response.c branches/2.1/varnish-cache/bin/varnishd/cache_session.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4989: Fix a problem with accounting of ESI transactions In particular make the Length header match the actual composite object sent to the client. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishd/cache.h =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache.h 2010-07-06 12:44:37 UTC (rev 5028) +++ branches/2.1/varnish-cache/bin/varnishd/cache.h 2010-07-06 12:51:04 UTC (rev 5029) @@ -430,8 +430,9 @@ struct sessmem *mem; struct workreq workreq; - struct acct acct; + struct acct acct_tmp; struct acct acct_req; + struct acct acct_ses; #if defined(HAVE_EPOLL_CTL) struct epoll_event ev; Modified: branches/2.1/varnish-cache/bin/varnishd/cache_acceptor.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_acceptor.c 2010-07-06 12:44:37 UTC (rev 5028) +++ branches/2.1/varnish-cache/bin/varnishd/cache_acceptor.c 2010-07-06 12:51:04 UTC (rev 5029) @@ -177,7 +177,7 @@ VSL(SLT_SessionOpen, sp->fd, "%s %s %s", sp->addr, sp->port, sp->mylsock->name); } - sp->acct.first = sp->t_open; + sp->acct_ses.first = sp->t_open; if (need_test) sock_test(sp->fd); if (need_linger) Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_center.c 2010-07-06 12:44:37 UTC (rev 5028) +++ branches/2.1/varnish-cache/bin/varnishd/cache_center.c 2010-07-06 12:51:04 UTC (rev 5029) @@ -241,31 +241,33 @@ sp->vcl = NULL; } + SES_Charge(sp); + sp->t_end = TIM_real(); sp->wrk->lastused = sp->t_end; if (sp->xid == 0) { sp->t_req = sp->t_end; sp->t_resp = sp->t_end; - } else { + } else if (sp->esis == 0) { dp = sp->t_resp - sp->t_req; da = sp->t_end - sp->t_resp; dh = sp->t_req - sp->t_open; + /* XXX: Add StatReq == StatSess */ WSP(sp, SLT_Length, "%u", sp->acct_req.bodybytes); WSL(sp->wrk, SLT_ReqEnd, sp->id, "%u %.9f %.9f %.9f %.9f %.9f", sp->xid, sp->t_req, sp->t_end, dh, dp, da); } - sp->xid = 0; sp->t_open = sp->t_end; sp->t_resp = NAN; WSL_Flush(sp->wrk, 0); /* If we did an ESI include, don't mess up our state */ - if (sp->esis > 0) { - SES_Charge(sp); + if (sp->esis > 0) return (1); - } + memset(&sp->acct_req, 0, sizeof sp->acct_req); + sp->t_req = NAN; if (sp->fd >= 0 && sp->doclose != NULL) { @@ -277,8 +279,6 @@ vca_close_session(sp, sp->doclose); } - SES_Charge(sp); - if (sp->fd < 0) { sp->wrk->stats.sess_closed++; sp->wrk = NULL; @@ -648,7 +648,7 @@ AN(sp->obj->ban); HSH_Unbusy(sp); } - sp->acct_req.fetch++; + sp->acct_tmp.fetch++; sp->wrk->bereq = NULL; sp->wrk->beresp = NULL; sp->wrk->beresp1 = NULL; @@ -680,7 +680,7 @@ /* Receive a HTTP protocol request */ HTC_Init(sp->htc, sp->ws, sp->fd); sp->wrk->lastused = sp->t_open; - sp->acct_req.sess++; + sp->acct_tmp.sess++; sp->step = STP_WAIT; return (0); @@ -947,7 +947,7 @@ return (0); } assert(sp->handling == VCL_RET_PASS); - sp->acct_req.pass++; + sp->acct_tmp.pass++; sp->sendbody = 1; sp->step = STP_FETCH; return (0); @@ -985,7 +985,7 @@ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC); - sp->acct_req.pipe++; + sp->acct_tmp.pipe++; WS_Reset(sp->wrk->ws, NULL); sp->wrk->bereq = sp->wrk->http[0]; http_Setup(sp->wrk->bereq, sp->wrk->ws); @@ -1109,7 +1109,7 @@ sp->wrk->stats.client_req++; sp->t_req = TIM_real(); sp->wrk->lastused = sp->t_req; - sp->acct_req.req++; + sp->acct_tmp.req++; /* Assign XID and log */ sp->xid = ++xids; /* XXX not locked */ Modified: branches/2.1/varnish-cache/bin/varnishd/cache_esi.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_esi.c 2010-07-06 12:44:37 UTC (rev 5028) +++ branches/2.1/varnish-cache/bin/varnishd/cache_esi.c 2010-07-06 12:51:04 UTC (rev 5029) @@ -863,6 +863,7 @@ char *ws_wm; struct http http_save; struct esidata *ed; + unsigned sxid; w = sp->wrk; WRW_Reserve(w, &sp->fd); @@ -873,7 +874,7 @@ if (Tlen(eb->verbatim)) { if (sp->http->protover >= 1.1) (void)WRW_Write(w, eb->chunk_length, -1); - sp->acct_req.bodybytes += WRW_Write(w, + sp->acct_tmp.bodybytes += WRW_Write(w, eb->verbatim.b, Tlen(eb->verbatim)); if (sp->http->protover >= 1.1) (void)WRW_Write(w, "\r\n", -1); @@ -923,6 +924,7 @@ /* Client content already taken care of */ http_Unset(sp->http, H_Content_Length); + sxid = sp->xid; while (1) { sp->wrk = w; CNT_Session(sp); @@ -933,6 +935,7 @@ DSL(0x20, SLT_Debug, sp->id, "loop waiting for ESI"); (void)usleep(10000); } + sp->xid = sxid; AN(sp->wrk); assert(sp->step == STP_DONE); sp->esis--; Modified: branches/2.1/varnish-cache/bin/varnishd/cache_response.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_response.c 2010-07-06 12:44:37 UTC (rev 5028) +++ branches/2.1/varnish-cache/bin/varnishd/cache_response.c 2010-07-06 12:51:04 UTC (rev 5029) @@ -259,7 +259,7 @@ if (sp->esis == 0) /* no headers for interior ESI includes */ - sp->acct_req.hdrbytes += + sp->acct_tmp.hdrbytes += http_Write(sp->wrk, sp->wrk->resp, 1); if (WRW_FlushRelease(sp->wrk)) { @@ -284,7 +284,7 @@ http_GetHdr(sp->http, H_Range, &r)) res_dorange(sp, r, &low, &high); - sp->acct_req.hdrbytes += http_Write(sp->wrk, sp->wrk->resp, 1); + sp->acct_tmp.hdrbytes += http_Write(sp->wrk, sp->wrk->resp, 1); } else if (!sp->disable_esi && sp->esis > 0 && sp->http->protover >= 1.1 && @@ -330,7 +330,7 @@ ptr += len; - sp->acct_req.bodybytes += len; + sp->acct_tmp.bodybytes += len; #ifdef SENDFILE_WORKS /* * XXX: the overhead of setting up sendfile is not Modified: branches/2.1/varnish-cache/bin/varnishd/cache_session.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_session.c 2010-07-06 12:44:37 UTC (rev 5028) +++ branches/2.1/varnish-cache/bin/varnishd/cache_session.c 2010-07-06 12:51:04 UTC (rev 5029) @@ -84,11 +84,12 @@ void SES_Charge(struct sess *sp) { - struct acct *a = &sp->acct_req; + struct acct *a = &sp->acct_tmp; -#define ACCT(foo) \ +#define ACCT(foo) \ sp->wrk->stats.s_##foo += a->foo; \ - sp->acct.foo += a->foo; \ + sp->acct_req.foo += a->foo; \ + sp->acct_ses.foo += a->foo; \ a->foo = 0; #include "acct_fields.h" #undef ACCT @@ -248,7 +249,7 @@ void SES_Delete(struct sess *sp) { - struct acct *b = &sp->acct; + struct acct *b = &sp->acct_ses; struct sessmem *sm; CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 From tfheen at varnish-cache.org Tue Jul 6 13:19:22 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 6 Jul 2010 15:19:22 +0200 Subject: r5030 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-06 15:19:21 +0200 (Tue, 06 Jul 2010) New Revision: 5030 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_esi.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/e00007.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4743, r4744, r4745: ESI panic when element spans malloc segments r4973: Use WSP instead of VSL for ordering and performance r4974: Minor nitpicking r4975: Fix a bug when ESI elements span storage elements, which only the tightfisted -smalloc would trigger. Fixes: #719 Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_esi.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_esi.c 2010-07-06 12:51:04 UTC (rev 5029) +++ branches/2.1/varnish-cache/bin/varnishd/cache_esi.c 2010-07-06 13:19:21 UTC (rev 5030) @@ -263,7 +263,7 @@ ew->eb->verbatim.e = TRUST_ME(verbatim + len); sprintf(ew->eb->chunk_length, "%x\r\n", Tlen(ew->eb->verbatim)); if (params->esi_syntax & 0x4) - VSL(SLT_Debug, ew->sp->fd, "AddBit: %d <%.*s>", + WSP(ew->sp, SLT_Debug, "AddBit: %d <%.*s>", Tlen(ew->eb->verbatim), Tlen(ew->eb->verbatim), ew->eb->verbatim.b); @@ -395,15 +395,14 @@ txt tag; txt val; unsigned u, v, s; - struct ws *ws; if (ew->eb == NULL || ew->eb->include.b != NULL) esi_addbit(ew, NULL, 0); eb = ew->eb; - VSL(SLT_Debug, ew->sp->fd, "Incl \"%.*s\"", t.e - t.b, t.b); + WSP(ew->sp, SLT_Debug, "Incl \"%.*s\"", t.e - t.b, t.b); while (esi_attrib(ew, &t, &tag, &val) == 1) { if (params->esi_syntax & 0x4) - VSL(SLT_Debug, ew->sp->fd, "<%.*s> -> <%.*s>", + WSP(ew->sp, SLT_Debug, "<%.*s> -> <%.*s>", tag.e - tag.b, tag.b, val.e - val.b, val.b); if (Tlen(tag) != 3 || memcmp(tag.b, "src", 3)) continue; @@ -413,9 +412,7 @@ continue; } - /* Wee are saving the original string */ - ws = ew->sp->obj->ws_o; - WS_Assert(ws); + /* We are saving the original string */ s = 0; if (val.b != val.e) { @@ -626,8 +623,8 @@ * XXX: Ideally, we should only pull together the bits * XXX: we need, like the filename. */ - ew->tag.b = ew->sp->obj->ws_o->f; - ew->tag.e = ew->tag.b + WS_Reserve(ew->sp->obj->ws_o, 0); + ew->tag.b = ew->sp->wrk->ws->f; + ew->tag.e = ew->tag.b + WS_Reserve(ew->sp->wrk->ws, 0); px = ew->s; q = ew->tag.b; while (px.p != ew->p.p) { @@ -636,7 +633,7 @@ Nep(&px); } ew->tag.e = q; - WS_Release(ew->sp->obj->ws_o, Tlen(ew->tag)); + WS_Release(ew->sp->wrk->ws, Tlen(ew->tag)); } ll = Tlen(ew->tag); ew->tag.b++; @@ -651,7 +648,7 @@ ew->tag.b += 4 + (closing ? 1 : 0); l = Tlen(ew->tag); - VSL(SLT_Debug, ew->sp->fd, + WSP(ew->sp, SLT_Debug, "tag {%.*s} %d %d %d", l, ew->tag.b, ew->remflg, empty, closing); if (l >= 6 && !memcmp(ew->tag.b, "remove", 6)) { if (empty) { Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishtest/tests/e00007.vtc =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/e00007.vtc 2010-07-06 12:51:04 UTC (rev 5029) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/e00007.vtc 2010-07-06 13:19:21 UTC (rev 5030) @@ -31,7 +31,7 @@ } } -start -varnish v1 -vcl+backend { +varnish v1 -storage "-smalloc,2m" -vcl+backend { sub vcl_fetch { esi; } Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 From phk at varnish-cache.org Wed Jul 7 11:00:33 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 7 Jul 2010 13:00:33 +0200 Subject: r5031 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-07 13:00:33 +0200 (Wed, 07 Jul 2010) New Revision: 5031 Modified: trunk/varnish-cache/lib/libvcl/vcc_acl.c trunk/varnish-cache/lib/libvcl/vcc_action.c trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_var.c Log: Reduce the scope of VCC code that knows about variables, specifically the handling of if() expressions. Modified: trunk/varnish-cache/lib/libvcl/vcc_acl.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_acl.c 2010-07-06 13:19:21 UTC (rev 5030) +++ trunk/varnish-cache/lib/libvcl/vcc_acl.c 2010-07-07 11:00:33 UTC (rev 5031) @@ -449,18 +449,19 @@ } void -vcc_Cond_Ip(const struct var *vp, struct vcc *tl) +vcc_Cond_Ip(struct vcc *tl, const char *a1) { unsigned tcond; char acln[32]; switch (tl->t->tok) { + /* XXX: T_NOMATCH */ case '~': vcc_NextToken(tl); ExpectErr(tl, ID); vcc_AddRef(tl, tl->t, R_ACL); Fb(tl, 1, "match_acl_named_%.*s(sp, %s)\n", - PF(tl->t), vp->rname); + PF(tl->t), a1); vcc_NextToken(tl); break; case T_EQ: @@ -473,7 +474,7 @@ vcc_acl_entry(tl); vcc_acl_emit(tl, acln, 1); Fb(tl, 1, "%smatch_acl_anon_%s(sp, %s)\n", - (tcond == T_NEQ ? "!" : ""), acln, vp->rname); + (tcond == T_NEQ ? "!" : ""), acln, a1); break; default: vsb_printf(tl->sb, "Invalid condition "); Modified: trunk/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-06 13:19:21 UTC (rev 5030) +++ trunk/varnish-cache/lib/libvcl/vcc_action.c 2010-07-07 11:00:33 UTC (rev 5031) @@ -127,10 +127,8 @@ vcc_NextToken(tl); switch (vp->fmt) { case INT: -// case SIZE: case TIME: case DURATION: -// case FLOAT: if (tl->t->tok != '=') Fb(tl, 0, "%s %c ", vp->rname, *tl->t->b); at = tl->t; @@ -153,22 +151,6 @@ } Fb(tl, 0, ");\n"); break; -#if 0 /* XXX: enable if we find a legit use */ - case IP: - if (tl->t->tok != '=') { - illegal_assignment(tl, "IP numbers"); - return; - } - vcc_NextToken(tl); - u = vcc_vcc_IpVal(tl); - Fb(tl, 0, "= %uU; /* %u.%u.%u.%u */\n", - u, - (u >> 24) & 0xff, - (u >> 16) & 0xff, - (u >> 8) & 0xff, - u & 0xff); - break; -#endif case BACKEND: if (tl->t->tok != '=') { illegal_assignment(tl, "backend"); Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-06 13:19:21 UTC (rev 5030) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-07 11:00:33 UTC (rev 5031) @@ -174,7 +174,7 @@ /* vcc_acl.c */ void vcc_Acl(struct vcc *tl); -void vcc_Cond_Ip(const struct var *vp, struct vcc *tl); +void vcc_Cond_Ip(struct vcc *tl, const char *a1); /* vcc_action.c */ int vcc_ParseAction(struct vcc *tl); Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-06 13:19:21 UTC (rev 5030) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-07 11:00:33 UTC (rev 5031) @@ -60,6 +60,18 @@ tl->t->cnt = tl->cnt; \ } while (0) +/*--------------------------------------------------------------------*/ + +static void +vcc_inval_test(struct vcc *tl, const char *type, const char *valid) +{ + vsb_printf(tl->sb, "Invalid test "); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, " on expression of type %s.\n", type); + vsb_printf(tl->sb, " only %s are legal\n", valid); + vcc_ErrWhere(tl, tl->t); +} + /*-------------------------------------------------------------------- * Recognize and convert units of time, return seconds. */ @@ -93,38 +105,7 @@ return (sc); } -#if 0 /*-------------------------------------------------------------------- - * Recognize and convert units of size, return bytes. - */ - -static double -vcc_SizeUnit(struct vcc *tl) -{ - double sc = 1.0; - - assert(tl->t->tok == ID); - if (vcc_IdIs(tl->t, "b")) - sc = 1.0; - else if (vcc_IdIs(tl->t, "kb")) - sc = 1024.0; - else if (vcc_IdIs(tl->t, "mb") || vcc_IdIs(tl->t, "Mb")) - sc = 1024.0 * 1024.0; - else if (vcc_IdIs(tl->t, "gb") || vcc_IdIs(tl->t, "Gb")) - sc = 1024.0 * 1024.0 * 1024.0; - else { - vsb_printf(tl->sb, "Unknown size unit "); - vcc_ErrToken(tl, tl->t); - vsb_printf(tl->sb, ". Legal are 'kb', 'mb' and 'gb'\n"); - vcc_ErrWhere(tl, tl->t); - return (1.0); - } - vcc_NextToken(tl); - return (sc); -} -#endif - -/*-------------------------------------------------------------------- * Recognize and convert { CNUM } to unsigned value * The tokenizer made sure we only get digits. */ @@ -209,26 +190,10 @@ *d = v * sc; } -#if 0 /*--------------------------------------------------------------------*/ -void -vcc_SizeVal(struct vcc *tl, double *d) -{ - double v, sc; - - v = vcc_DoubleVal(tl); - ERRCHK(tl); - ExpectErr(tl, ID); - sc = vcc_SizeUnit(tl); - *d = v * sc; -} -#endif - -/*--------------------------------------------------------------------*/ - static void -vcc_Cond_String(const struct var *vp, struct vcc *tl) +vcc_Cond_String(struct vcc *tl, const char *a1) { char *p; @@ -242,12 +207,17 @@ p = vcc_regexp(tl); ERRCHK(tl); vcc_NextToken(tl); - Fb(tl, 1, "%s, %s)\n", vp->rname, p); + Fb(tl, 1, "%s, %s)\n", a1, p); break; + case T_LEQ: + case T_GEQ: + case '>': + case '<': + vcc_inval_test(tl, "STRING", "'==', '!=', '~' and '!~'"); case T_EQ: case T_NEQ: Fb(tl, 1, "%sVRT_strcmp(%s, ", - tl->t->tok == T_EQ ? "!" : "", vp->rname); + tl->t->tok == T_EQ ? "!" : "", a1); vcc_NextToken(tl); if (!vcc_StringVal(tl)) { vcc_ExpectedStringval(tl); @@ -256,16 +226,16 @@ Fb(tl, 0, ")\n"); break; default: - Fb(tl, 1, "%s != (void*)0\n", vp->rname); + Fb(tl, 1, "%s != (void*)0\n", a1); break; } } static void -vcc_Cond_Int(const struct var *vp, struct vcc *tl) +vcc_Cond_Int(struct vcc *tl, const char *a1) { - Fb(tl, 1, "%s ", vp->rname); + Fb(tl, 1, "%s ", a1); switch (tl->t->tok) { case T_EQ: case T_NEQ: @@ -275,44 +245,33 @@ case '<': Fb(tl, 0, "%.*s ", PF(tl->t)); vcc_NextToken(tl); - vcc_VarVal(tl, vp, NULL); + Fb(tl, 0, "%u", vcc_UintVal(tl)); ERRCHK(tl); Fb(tl, 0, "\n"); break; default: - vsb_printf(tl->sb, "Invalid condition "); - vcc_ErrToken(tl, tl->t); - vsb_printf(tl->sb, " on numeric variable\n"); - vsb_printf(tl->sb, - " only '==', '!=', '<', '>', '<=' and '>=' are legal\n"); - vcc_ErrWhere(tl, tl->t); + vcc_inval_test(tl, "INT", + "'==', '!=', '<', '>', '<=' and '>='"); break; } } static void -vcc_Cond_Bool(const struct var *vp, const struct vcc *tl) +vcc_Cond_Bool(struct vcc *tl, const char *a1) { - Fb(tl, 1, "%s\n", vp->rname); + Fb(tl, 1, "%s\n", a1); } static void -vcc_Cond_Backend(const struct var *vp, struct vcc *tl) +vcc_Cond_Backend(struct vcc *tl, const char *a1) { - Fb(tl, 1, "%s\n", vp->rname); - if (tl->t->tok == T_EQ) { - Fb(tl, 1, " ==\n"); - } else if (tl->t->tok == T_NEQ) { - Fb(tl, 1, " !=\n"); + Fb(tl, 1, "%s\n", a1); + if (tl->t->tok == T_EQ || tl->t->tok == T_NEQ) { + Fb(tl, 1, " %.*s\n", PF(tl->t)); } else { - vsb_printf(tl->sb, "Invalid condition "); - vcc_ErrToken(tl, tl->t); - vsb_printf(tl->sb, " on backend variable\n"); - vsb_printf(tl->sb, - " only '==' and '!=' are legal\n"); - vcc_ErrWhere(tl, tl->t); + vcc_inval_test(tl, "BACKEND", "'==' and '!='"); return; } vcc_NextToken(tl); @@ -323,44 +282,56 @@ vcc_NextToken(tl); } -const char *typenm[] = { -#define VCC_TYPE(foo) [foo] = #foo, -#include "vcc_types.h" -#undef VCC_TYPE -}; - -static int -vcc_Relation(struct vcc *tl, enum var_type fmt) +static void +vcc_Cond_Time(struct vcc *tl, const char *a1) { + double d; - switch(tl->t->tok) { + Fb(tl, 1, "%s ", a1); + switch (tl->t->tok) { case T_EQ: case T_NEQ: - if (fmt != BOOL) - return (tl->t->tok); - break; - case '>': + case T_LEQ: case T_GEQ: + case '>': case '<': - case T_LEQ: - if (fmt == INT || fmt == TIME || fmt == DURATION) - return (tl->t->tok); + Fb(tl, 0, "%.*s ", PF(tl->t)); + vcc_NextToken(tl); + vcc_RTimeVal(tl, &d); + ERRCHK(tl); + Fb(tl, 0, "%g\n", d); break; - case '~': - case T_NOMATCH: - if (fmt == IP || fmt == STRING || fmt == HEADER) - return (tl->t->tok); + default: + vcc_inval_test(tl, "TIME", + "'==', '!=', '<', '>', '<=' and '>='"); break; + } +} + +static void +vcc_Cond_Duration(struct vcc *tl, const char *a1) +{ + double d; + + Fb(tl, 1, "%s ", a1); + switch (tl->t->tok) { + case T_EQ: + case T_NEQ: + case T_LEQ: + case T_GEQ: + case '>': + case '<': + Fb(tl, 0, "%.*s ", PF(tl->t)); + vcc_NextToken(tl); + vcc_RTimeVal(tl, &d); + ERRCHK(tl); + Fb(tl, 0, "%g\n", d); + break; default: - if (fmt == STRING || fmt == HEADER || fmt == BOOL) - return (-1); + vcc_inval_test(tl, "DURATION", + "'==', '!=', '<', '>', '<=' and '>='"); break; } - vsb_printf(tl->sb, "Invalid comparison/match operator "); - vsb_printf(tl->sb, " for type %s.\n", typenm[fmt]); - vcc_ErrToken(tl, tl->t); - vcc_ErrWhere(tl, tl->t); - return (-1); } static void @@ -386,16 +357,14 @@ ERRCHK(tl); assert(vp != NULL); vcc_NextToken(tl); - vcc_Relation(tl, sym->fmt); switch (vp->fmt) { - case INT: L(tl, vcc_Cond_Int(vp, tl)); break; - // case SIZE: L(tl, vcc_Cond_Int(vp, tl)); break; - case BOOL: L(tl, vcc_Cond_Bool(vp, tl)); break; - case IP: L(tl, vcc_Cond_Ip(vp, tl)); break; - case STRING: L(tl, vcc_Cond_String(vp, tl)); break; - case TIME: L(tl, vcc_Cond_Int(vp, tl)); break; - case DURATION: L(tl, vcc_Cond_Int(vp, tl)); break; - case BACKEND: L(tl, vcc_Cond_Backend(vp, tl)); break; + case BACKEND: L(tl, vcc_Cond_Backend(tl, vp->rname)); break; + case BOOL: L(tl, vcc_Cond_Bool(tl, vp->rname)); break; + case DURATION: L(tl, vcc_Cond_Duration(tl, vp->rname)); break; + case INT: L(tl, vcc_Cond_Int(tl, vp->rname)); break; + case IP: L(tl, vcc_Cond_Ip(tl, vp->rname)); break; + case STRING: L(tl, vcc_Cond_String(tl, vp->rname)); break; + case TIME: L(tl, vcc_Cond_Time(tl, vp->rname)); break; default: vsb_printf(tl->sb, "Variable '%s'" Modified: trunk/varnish-cache/lib/libvcl/vcc_var.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-06 13:19:21 UTC (rev 5030) +++ trunk/varnish-cache/lib/libvcl/vcc_var.c 2010-07-07 11:00:33 UTC (rev 5031) @@ -144,16 +144,6 @@ vcc_RTimeVal(tl, &d); ERRCHK(tl); Fb(tl, 0, "%g", d); -#if 0 - } else if (vp->fmt == SIZE) { - vcc_SizeVal(tl, &d); - ERRCHK(tl); - Fb(tl, 0, "%g", d); -#endif -#if 0 - } else if (vp->fmt == FLOAT) { - Fb(tl, 0, "%g", vcc_DoubleVal(tl)); -#endif } else if (vp->fmt == INT) { Fb(tl, 0, "%u", vcc_UintVal(tl)); } else { From phk at varnish-cache.org Wed Jul 7 11:59:02 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 7 Jul 2010 13:59:02 +0200 Subject: r5032 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-07 13:59:01 +0200 (Wed, 07 Jul 2010) New Revision: 5032 Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c Log: Minor polishing Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-07 11:00:33 UTC (rev 5031) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-07 11:59:01 UTC (rev 5032) @@ -45,7 +45,7 @@ /*--------------------------------------------------------------------*/ static void vcc_Compound(struct vcc *tl); -static void vcc_Cond_0(struct vcc *tl); +static void vcc_Conditional(struct vcc *tl); /*--------------------------------------------------------------------*/ @@ -381,19 +381,15 @@ C(tl, ","); if (tl->t->tok == '!') { - Fb(tl, 1, "!(\n"); + Fb(tl, 1, "!"); vcc_NextToken(tl); - } else { - Fb(tl, 1, "(\n"); } if (tl->t->tok == '(') { - vcc_NextToken(tl); - vcc_Cond_0(tl); - SkipToken(tl, ')'); - Fb(tl, 1, ")\n"); + vcc_Conditional(tl); return; } if (tl->t->tok == ID) { + Fb(tl, 1, "(\n"); vcc_Cond_3(tl); Fb(tl, 1, ")\n"); return; @@ -418,6 +414,7 @@ vcc_NextToken(tl); Fb(tl, 1, ") && (\n"); L(tl, vcc_Cond_2(tl)); + ERRCHK(tl); } Fb(tl, 1, ")\n"); } @@ -432,6 +429,7 @@ vcc_NextToken(tl); Fb(tl, 1, ") || (\n"); L(tl, vcc_Cond_1(tl)); + ERRCHK(tl); } Fb(tl, 1, ")\n"); } From phk at varnish-cache.org Wed Jul 7 14:03:39 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 7 Jul 2010 16:03:39 +0200 Subject: r5033 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-07 16:03:39 +0200 (Wed, 07 Jul 2010) New Revision: 5033 Added: trunk/varnish-cache/lib/libvcl/vcc_expr.c Modified: trunk/varnish-cache/lib/libvcl/Makefile.am trunk/varnish-cache/lib/libvcl/vcc_compile.h trunk/varnish-cache/lib/libvcl/vcc_parse.c Log: Factor numeric type expressions into their own file. Modified: trunk/varnish-cache/lib/libvcl/Makefile.am =================================================================== --- trunk/varnish-cache/lib/libvcl/Makefile.am 2010-07-07 11:59:01 UTC (rev 5032) +++ trunk/varnish-cache/lib/libvcl/Makefile.am 2010-07-07 14:03:39 UTC (rev 5033) @@ -19,6 +19,7 @@ vcc_compile.c \ vcc_dir_random.c \ vcc_dir_round_robin.c \ + vcc_expr.c \ vcc_parse.c \ $(builddir)/vcc_fixed_token.c \ vcc_obj.c \ Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-07 11:59:01 UTC (rev 5032) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.h 2010-07-07 14:03:39 UTC (rev 5033) @@ -215,16 +215,18 @@ /* vcc_dir_round_robin.c */ parsedirector_f vcc_ParseRoundRobinDirector; +/* vcc_expr.c */ +void vcc_RTimeVal(struct vcc *tl, double *); +void vcc_TimeVal(struct vcc *tl, double *); +unsigned vcc_UintVal(struct vcc *tl); +double vcc_DoubleVal(struct vcc *tl); +void vcc_Expr(struct vcc *tl, enum var_type fmt); + /* vcc_obj.c */ extern const struct var vcc_vars[]; /* vcc_parse.c */ void vcc_Parse(struct vcc *tl); -void vcc_RTimeVal(struct vcc *tl, double *); -void vcc_TimeVal(struct vcc *tl, double *); -// void vcc_SizeVal(struct vcc *tl, double *); -unsigned vcc_UintVal(struct vcc *tl); -double vcc_DoubleVal(struct vcc *tl); /* vcc_string.c */ char *vcc_regexp(struct vcc *tl); Copied: trunk/varnish-cache/lib/libvcl/vcc_expr.c (from rev 5032, trunk/varnish-cache/lib/libvcl/vcc_parse.c) =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c (rev 0) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-07-07 14:03:39 UTC (rev 5033) @@ -0,0 +1,202 @@ +/*- + * Copyright (c) 2006 Verdens Gang AS + * Copyright (c) 2006-2009 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. + */ + +#include "config.h" + +#include "svnid.h" +SVNID("$Id$") + +#include +#include +#include +#include + +#include "vsb.h" + +#include "vcc_priv.h" +#include "vcc_compile.h" +#include "libvarnish.h" + +/*--------------------------------------------------------------------*/ + +#define L(tl, foo) do { \ + tl->indent += INDENT; \ + foo; \ + tl->indent -= INDENT; \ +} while (0) + +#define C(tl, sep) do { \ + Fb(tl, 1, "VRT_count(sp, %u)%s\n", ++tl->cnt, sep); \ + tl->t->cnt = tl->cnt; \ +} while (0) + +/*-------------------------------------------------------------------- + * Recognize and convert units of time, return seconds. + */ + +static double +vcc_TimeUnit(struct vcc *tl) +{ + double sc = 1.0; + + assert(tl->t->tok == ID); + if (vcc_IdIs(tl->t, "ms")) + sc = 1e-3; + else if (vcc_IdIs(tl->t, "s")) + sc = 1.0; + else if (vcc_IdIs(tl->t, "m")) + sc = 60.0; + else if (vcc_IdIs(tl->t, "h")) + sc = 60.0 * 60.0; + else if (vcc_IdIs(tl->t, "d")) + sc = 60.0 * 60.0 * 24.0; + else if (vcc_IdIs(tl->t, "w")) + sc = 60.0 * 60.0 * 24.0 * 7.0; + else { + vsb_printf(tl->sb, "Unknown time unit "); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, ". Legal are 's', 'm', 'h' and 'd'\n"); + vcc_ErrWhere(tl, tl->t); + return (1.0); + } + vcc_NextToken(tl); + return (sc); +} + +/*-------------------------------------------------------------------- + * Recognize and convert { CNUM } to unsigned value + * The tokenizer made sure we only get digits. + */ + +unsigned +vcc_UintVal(struct vcc *tl) +{ + unsigned d = 0; + const char *p; + + Expect(tl, CNUM); + for (p = tl->t->b; p < tl->t->e; p++) { + d *= 10; + d += *p - '0'; + } + vcc_NextToken(tl); + return (d); +} + +/*-------------------------------------------------------------------- + * Recognize and convert { CNUM [ '.' [ CNUM ] ] } to double value + * The tokenizer made sure we only get digits and a '.' + */ + +double +vcc_DoubleVal(struct vcc *tl) +{ + double d = 0.0, e = 0.1; + const char *p; + + Expect(tl, CNUM); + if (tl->err) + return (NAN); + for (p = tl->t->b; p < tl->t->e; p++) { + d *= 10; + d += *p - '0'; + } + vcc_NextToken(tl); + if (tl->t->tok != '.') + return (d); + vcc_NextToken(tl); + if (tl->t->tok != CNUM) + return (d); + for (p = tl->t->b; p < tl->t->e; p++) { + d += (*p - '0') * e; + e *= 0.1; + } + vcc_NextToken(tl); + return (d); +} + +/*--------------------------------------------------------------------*/ + +void +vcc_RTimeVal(struct vcc *tl, double *d) +{ + 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 = vcc_TimeUnit(tl); + *d = sign * v * sc; +} + +/*--------------------------------------------------------------------*/ + +void +vcc_TimeVal(struct vcc *tl, double *d) +{ + double v, sc; + + v = vcc_DoubleVal(tl); + ERRCHK(tl); + ExpectErr(tl, ID); + sc = vcc_TimeUnit(tl); + *d = v * sc; +} + +/*--------------------------------------------------------------------*/ + +void +vcc_Expr(struct vcc *tl, enum var_type fmt) +{ + double d; + + switch(fmt) { + case DURATION: + vcc_RTimeVal(tl, &d); + ERRCHK(tl); + Fb(tl, 0, "%g\n", d); + break; + case TIME: + vcc_RTimeVal(tl, &d); + ERRCHK(tl); + Fb(tl, 0, "%g\n", d); + break; + case INT: + Fb(tl, 0, "%u\n", vcc_UintVal(tl)); + ERRCHK(tl); + break; + default: + WRONG("missing type support"); + } +} Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-07 11:59:01 UTC (rev 5032) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-07 14:03:39 UTC (rev 5033) @@ -72,126 +72,8 @@ vcc_ErrWhere(tl, tl->t); } -/*-------------------------------------------------------------------- - * Recognize and convert units of time, return seconds. - */ - -static double -vcc_TimeUnit(struct vcc *tl) -{ - double sc = 1.0; - - assert(tl->t->tok == ID); - if (vcc_IdIs(tl->t, "ms")) - sc = 1e-3; - else if (vcc_IdIs(tl->t, "s")) - sc = 1.0; - else if (vcc_IdIs(tl->t, "m")) - sc = 60.0; - else if (vcc_IdIs(tl->t, "h")) - sc = 60.0 * 60.0; - else if (vcc_IdIs(tl->t, "d")) - sc = 60.0 * 60.0 * 24.0; - else if (vcc_IdIs(tl->t, "w")) - sc = 60.0 * 60.0 * 24.0 * 7.0; - else { - vsb_printf(tl->sb, "Unknown time unit "); - vcc_ErrToken(tl, tl->t); - vsb_printf(tl->sb, ". Legal are 's', 'm', 'h' and 'd'\n"); - vcc_ErrWhere(tl, tl->t); - return (1.0); - } - vcc_NextToken(tl); - return (sc); -} - -/*-------------------------------------------------------------------- - * Recognize and convert { CNUM } to unsigned value - * The tokenizer made sure we only get digits. - */ - -unsigned -vcc_UintVal(struct vcc *tl) -{ - unsigned d = 0; - const char *p; - - Expect(tl, CNUM); - for (p = tl->t->b; p < tl->t->e; p++) { - d *= 10; - d += *p - '0'; - } - vcc_NextToken(tl); - return (d); -} - -/*-------------------------------------------------------------------- - * Recognize and convert { CNUM [ '.' [ CNUM ] ] } to double value - * The tokenizer made sure we only get digits and a '.' - */ - -double -vcc_DoubleVal(struct vcc *tl) -{ - double d = 0.0, e = 0.1; - const char *p; - - Expect(tl, CNUM); - if (tl->err) - return (NAN); - for (p = tl->t->b; p < tl->t->e; p++) { - d *= 10; - d += *p - '0'; - } - vcc_NextToken(tl); - if (tl->t->tok != '.') - return (d); - vcc_NextToken(tl); - if (tl->t->tok != CNUM) - return (d); - for (p = tl->t->b; p < tl->t->e; p++) { - d += (*p - '0') * e; - e *= 0.1; - } - vcc_NextToken(tl); - return (d); -} - /*--------------------------------------------------------------------*/ -void -vcc_RTimeVal(struct vcc *tl, double *d) -{ - 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 = vcc_TimeUnit(tl); - *d = sign * v * sc; -} - -/*--------------------------------------------------------------------*/ - -void -vcc_TimeVal(struct vcc *tl, double *d) -{ - double v, sc; - - v = vcc_DoubleVal(tl); - ERRCHK(tl); - ExpectErr(tl, ID); - sc = vcc_TimeUnit(tl); - *d = v * sc; -} - -/*--------------------------------------------------------------------*/ - static void vcc_Cond_String(struct vcc *tl, const char *a1) { @@ -232,31 +114,6 @@ } static void -vcc_Cond_Int(struct vcc *tl, const char *a1) -{ - - Fb(tl, 1, "%s ", a1); - switch (tl->t->tok) { - case T_EQ: - case T_NEQ: - case T_LEQ: - case T_GEQ: - case '>': - case '<': - Fb(tl, 0, "%.*s ", PF(tl->t)); - vcc_NextToken(tl); - Fb(tl, 0, "%u", vcc_UintVal(tl)); - ERRCHK(tl); - Fb(tl, 0, "\n"); - break; - default: - vcc_inval_test(tl, "INT", - "'==', '!=', '<', '>', '<=' and '>='"); - break; - } -} - -static void vcc_Cond_Bool(struct vcc *tl, const char *a1) { @@ -283,9 +140,9 @@ } static void -vcc_Cond_Time(struct vcc *tl, const char *a1) +vcc_Cond_Num(struct vcc *tl, enum var_type fmt, const char *fmtn, + const char *a1) { - double d; Fb(tl, 1, "%s ", a1); switch (tl->t->tok) { @@ -297,48 +154,21 @@ case '<': Fb(tl, 0, "%.*s ", PF(tl->t)); vcc_NextToken(tl); - vcc_RTimeVal(tl, &d); - ERRCHK(tl); - Fb(tl, 0, "%g\n", d); + vcc_Expr(tl, fmt); break; default: - vcc_inval_test(tl, "TIME", + vcc_inval_test(tl, fmtn, "'==', '!=', '<', '>', '<=' and '>='"); break; } } static void -vcc_Cond_Duration(struct vcc *tl, const char *a1) -{ - double d; - - Fb(tl, 1, "%s ", a1); - switch (tl->t->tok) { - case T_EQ: - case T_NEQ: - case T_LEQ: - case T_GEQ: - case '>': - case '<': - Fb(tl, 0, "%.*s ", PF(tl->t)); - vcc_NextToken(tl); - vcc_RTimeVal(tl, &d); - ERRCHK(tl); - Fb(tl, 0, "%g\n", d); - break; - default: - vcc_inval_test(tl, "DURATION", - "'==', '!=', '<', '>', '<=' and '>='"); - break; - } -} - -static void vcc_Cond_3(struct vcc *tl) { const struct var *vp; const struct symbol *sym; + const char *left; sym = VCC_FindSymbol(tl, tl->t); if (sym == NULL) { @@ -356,15 +186,17 @@ vp = vcc_FindVar(tl, tl->t, 0, "cannot be read"); ERRCHK(tl); assert(vp != NULL); + left = vp->rname; vcc_NextToken(tl); + switch (vp->fmt) { - case BACKEND: L(tl, vcc_Cond_Backend(tl, vp->rname)); break; - case BOOL: L(tl, vcc_Cond_Bool(tl, vp->rname)); break; - case DURATION: L(tl, vcc_Cond_Duration(tl, vp->rname)); break; - case INT: L(tl, vcc_Cond_Int(tl, vp->rname)); break; - case IP: L(tl, vcc_Cond_Ip(tl, vp->rname)); break; - case STRING: L(tl, vcc_Cond_String(tl, vp->rname)); break; - case TIME: L(tl, vcc_Cond_Time(tl, vp->rname)); break; + case BACKEND: L(tl, vcc_Cond_Backend(tl, left)); break; + case BOOL: L(tl, vcc_Cond_Bool(tl, left)); break; + case DURATION: L(tl, vcc_Cond_Num(tl, DURATION, "DURATION", left)); break; + case INT: L(tl, vcc_Cond_Num(tl, INT, "INT", left)); break; + case IP: L(tl, vcc_Cond_Ip(tl, left)); break; + case STRING: L(tl, vcc_Cond_String(tl, left)); break; + case TIME: L(tl, vcc_Cond_Num(tl, TIME, "TIME", left)); break; default: vsb_printf(tl->sb, "Variable '%s'" From phk at varnish-cache.org Wed Jul 7 15:11:33 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Wed, 7 Jul 2010 17:11:33 +0200 Subject: r5034 - trunk/varnish-cache/lib/libvcl Message-ID: Author: phk Date: 2010-07-07 17:11:33 +0200 (Wed, 07 Jul 2010) New Revision: 5034 Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c trunk/varnish-cache/lib/libvcl/vcc_expr.c trunk/varnish-cache/lib/libvcl/vcc_parse.c trunk/varnish-cache/lib/libvcl/vcc_symb.c trunk/varnish-cache/lib/libvcl/vcc_types.h Log: Add initial stage of expression support for numeric types so far. You can now say: if (beresp.ttl >= beresp.grace + 30 s) { } and similar. Modified: trunk/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-07 14:03:39 UTC (rev 5033) +++ trunk/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-07 15:11:33 UTC (rev 5034) @@ -383,7 +383,7 @@ /*--------------------------------------------------------------------*/ static struct source * -vcc_file_source(struct vcc *tl, struct vsb *sb, const char *fn) +vcc_file_source(const struct vcc *tl, struct vsb *sb, const char *fn) { char *f; struct source *sp; Modified: trunk/varnish-cache/lib/libvcl/vcc_expr.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-07-07 14:03:39 UTC (rev 5033) +++ trunk/varnish-cache/lib/libvcl/vcc_expr.c 2010-07-07 15:11:33 UTC (rev 5034) @@ -51,10 +51,12 @@ tl->indent -= INDENT; \ } while (0) +#if 0 #define C(tl, sep) do { \ Fb(tl, 1, "VRT_count(sp, %u)%s\n", ++tl->cnt, sep); \ tl->t->cnt = tl->cnt; \ } while (0) +#endif /*-------------------------------------------------------------------- * Recognize and convert units of time, return seconds. @@ -114,30 +116,44 @@ * The tokenizer made sure we only get digits and a '.' */ -double -vcc_DoubleVal(struct vcc *tl) +static void +vcc_NumVal(struct vcc *tl, double *d, int *frac) { - double d = 0.0, e = 0.1; + double e = 0.1; const char *p; + *frac = 0; + *d = 0.0; Expect(tl, CNUM); - if (tl->err) - return (NAN); + if (tl->err) { + *d = NAN; + return; + } for (p = tl->t->b; p < tl->t->e; p++) { - d *= 10; - d += *p - '0'; + *d *= 10; + *d += *p - '0'; } vcc_NextToken(tl); if (tl->t->tok != '.') - return (d); + return; + *frac = 1; vcc_NextToken(tl); if (tl->t->tok != CNUM) - return (d); + return; for (p = tl->t->b; p < tl->t->e; p++) { - d += (*p - '0') * e; + *d += (*p - '0') * e; e *= 0.1; } vcc_NextToken(tl); +} + +double +vcc_DoubleVal(struct vcc *tl) +{ + double d; + int i; + + vcc_NumVal(tl, &d, &i); return (d); } @@ -176,27 +192,156 @@ /*--------------------------------------------------------------------*/ +static void +vcc_Expr2(struct vcc *tl, enum var_type *fmt) +{ + const struct symbol *sym; + const struct var *vp; + double d; + int frac; + + *fmt = VOID; + switch(tl->t->tok) { + case ID: + sym = VCC_FindSymbol(tl, tl->t); + if (sym == NULL) { + vsb_printf(tl->sb, + "Unknown symbol in numeric expression:\n"); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, "\n"); + vcc_ErrWhere(tl, tl->t); + return; + } + vcc_AddUses(tl, tl->t, sym->r_methods, "Not available"); + AN(sym->var); + vp = vcc_FindVar(tl, tl->t, 0, "cannot be read"); + ERRCHK(tl); + assert(vp != NULL); + Fb(tl, 1, "%s\n", vp->rname); + *fmt = sym->fmt; + vcc_NextToken(tl); + return; + case CNUM: + vcc_NumVal(tl, &d, &frac); + ERRCHK(tl); + if (tl->t->tok == ID) { + d *= vcc_TimeUnit(tl); + ERRCHK(tl); + *fmt = DURATION; + } else if (!frac) { + *fmt = INT; + } else { + WRONG("numeric constant botch"); + } + Fb(tl, 1, "%g\n", d); + return; + + default: + vsb_printf(tl->sb, + "Unknown token in numeric expression:\n"); + vcc_ErrToken(tl, tl->t); + vsb_printf(tl->sb, "\n"); + vcc_ErrWhere(tl, tl->t); + return; + } +} + +static void +vcc_Expr1(struct vcc *tl, enum var_type fmt) +{ + enum var_type lfmt, rfmt, afmt; + struct token *top; + struct token *tfirst; + + tfirst = tl->t; + Fb(tl, 1, "(\n"); + L(tl, vcc_Expr2(tl, &lfmt)); + ERRCHK(tl); + afmt = lfmt; + while (1) { + top = tl->t; + if (tl->t->tok == '+') { + vcc_NextToken(tl); + Fb(tl, 1, " +\n"); + L(tl, vcc_Expr2(tl, &rfmt)); + ERRCHK(tl); + if (lfmt == INT && rfmt == INT) + afmt = INT; + else if (lfmt == DURATION && rfmt == DURATION) + afmt = DURATION; + else if (lfmt == TIME && rfmt == DURATION) + afmt = TIME; + else if (lfmt == DURATION && rfmt == TIME) + afmt = TIME; + else { + vsb_printf(tl->sb, + /* XXX print actual types */ + "Incompatible types in addition.\n" + "Legal combinations:\n" + "\tINT+INT,\n" + "\tDURATION+DURATION,\n" + "\tDURATION+TIME,\n" + "\tTIME+DURATION\n"); + vcc_ErrWhere(tl, top); + return; + } + } else if (tl->t->tok == '-') { + vcc_NextToken(tl); + Fb(tl, 1, " -\n"); + L(tl, vcc_Expr2(tl, &rfmt)); + if (lfmt == INT && rfmt == INT) + afmt = INT; + else if (lfmt == DURATION && rfmt == DURATION) + afmt = DURATION; + else if (lfmt == TIME && rfmt == DURATION) + afmt = TIME; + else if (lfmt == TIME && rfmt == TIME) + afmt = DURATION; + else { + vsb_printf(tl->sb, + /* XXX print actual types */ + "Incompatible types in subtraction.\n" + "Legal combinations:\n" + "\tINT-INT,\n" + "\tDURATION-DURATION,\n" + "\tTIME-DURATION,\n" + "\tTIME-TIME,\n"); + vcc_ErrWhere(tl, top); + return; + } + } else + break; + lfmt = afmt; + } + Fb(tl, 1, ")\n"); + if (fmt != afmt) { + vsb_printf(tl->sb, + /* XXX print actual types */ + "Add/Subtract results in wrong type.\n" + "\nExpression starting at:\n" ); + vcc_ErrWhere(tl, tfirst); + vsb_printf(tl->sb, "\nending before:\n\n"); + vcc_ErrWhere(tl, tl->t); + return; + } +} + void vcc_Expr(struct vcc *tl, enum var_type fmt) { - double d; - switch(fmt) { + switch (fmt) { case DURATION: - vcc_RTimeVal(tl, &d); - ERRCHK(tl); - Fb(tl, 0, "%g\n", d); - break; + case INT: case TIME: - vcc_RTimeVal(tl, &d); + /* These types support addition and subtraction */ + Fb(tl, 1, "(\n"); + L(tl, vcc_Expr1(tl, fmt)); ERRCHK(tl); - Fb(tl, 0, "%g\n", d); - break; - case INT: - Fb(tl, 0, "%u\n", vcc_UintVal(tl)); - ERRCHK(tl); - break; + Fb(tl, 1, ")\n"); + return; default: - WRONG("missing type support"); + WRONG("type not implemented yet"); } } + Modified: trunk/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-07 14:03:39 UTC (rev 5033) +++ trunk/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-07 15:11:33 UTC (rev 5034) @@ -34,7 +34,6 @@ #include #include -#include #include "vsb.h" @@ -96,6 +95,7 @@ case '>': case '<': vcc_inval_test(tl, "STRING", "'==', '!=', '~' and '!~'"); + break; case T_EQ: case T_NEQ: Fb(tl, 1, "%sVRT_strcmp(%s, ", @@ -114,7 +114,7 @@ } static void -vcc_Cond_Bool(struct vcc *tl, const char *a1) +vcc_Cond_Bool(const struct vcc *tl, const char *a1) { Fb(tl, 1, "%s\n", a1); @@ -152,7 +152,7 @@ case T_GEQ: case '>': case '<': - Fb(tl, 0, "%.*s ", PF(tl->t)); + Fb(tl, 0, "%.*s\n", PF(tl->t)); vcc_NextToken(tl); vcc_Expr(tl, fmt); break; Modified: trunk/varnish-cache/lib/libvcl/vcc_symb.c =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_symb.c 2010-07-07 14:03:39 UTC (rev 5033) +++ trunk/varnish-cache/lib/libvcl/vcc_symb.c 2010-07-07 15:11:33 UTC (rev 5034) @@ -56,7 +56,9 @@ WRONG("name collision"); } ALLOC_OBJ(sym, SYMBOL_MAGIC); + AN(sym); REPLACE(sym->name, name); + AN(name); sym->nlen = strlen(name); VTAILQ_INSERT_TAIL(&tl->symbols, sym, list); return (sym); Modified: trunk/varnish-cache/lib/libvcl/vcc_types.h =================================================================== --- trunk/varnish-cache/lib/libvcl/vcc_types.h 2010-07-07 14:03:39 UTC (rev 5033) +++ trunk/varnish-cache/lib/libvcl/vcc_types.h 2010-07-07 15:11:33 UTC (rev 5034) @@ -28,6 +28,7 @@ * $Id$ */ +VCC_TYPE(VOID) VCC_TYPE(BACKEND) VCC_TYPE(BOOL) VCC_TYPE(INT) From perbu at varnish-cache.org Thu Jul 8 08:03:29 2010 From: perbu at varnish-cache.org (perbu at varnish-cache.org) Date: Thu, 8 Jul 2010 10:03:29 +0200 Subject: r5035 - in trunk/varnish-cache/doc/sphinx: . tutorial Message-ID: Author: perbu Date: 2010-07-08 10:03:28 +0200 (Thu, 08 Jul 2010) New Revision: 5035 Modified: trunk/varnish-cache/doc/sphinx/index.rst trunk/varnish-cache/doc/sphinx/tutorial/increasing_your_hitrate.rst trunk/varnish-cache/doc/sphinx/tutorial/index.rst trunk/varnish-cache/doc/sphinx/tutorial/sizing_your_cache.rst Log: typos, minor fixes. Modified: trunk/varnish-cache/doc/sphinx/index.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/index.rst 2010-07-07 15:11:33 UTC (rev 5034) +++ trunk/varnish-cache/doc/sphinx/index.rst 2010-07-08 08:03:28 UTC (rev 5035) @@ -32,4 +32,4 @@ * :ref:`search` -`$Id:$` +$Id: $ Modified: trunk/varnish-cache/doc/sphinx/tutorial/increasing_your_hitrate.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/tutorial/increasing_your_hitrate.rst 2010-07-07 15:11:33 UTC (rev 5034) +++ trunk/varnish-cache/doc/sphinx/tutorial/increasing_your_hitrate.rst 2010-07-08 08:03:28 UTC (rev 5035) @@ -7,8 +7,13 @@ application through Varnish. Unless your application is specifically written to work behind a web accelerator you'll probably need to do some changes to either the configuration or the application in order -to get a high hitrate in Varnish. +to get a high hit rate in Varnish. +Varnish will not cache your data unless it's absolutely sure it is +safe to do so. So, for you to understand how Varnish decides if and +how to cache a page I'll guide you through a couple of tools that you +will find useful. + Note that you need a tool to see what HTTP headers fly between you and the web server. If you have Varnish the easiest is to use varnishlog and varnishtop but sometimes a client-side tool makes sense. Here are @@ -202,8 +207,8 @@ HTTP object Vary. This makes a lot of sense with headers like Accept-Encoding. When a server issues a "Vary: Accept-Encoding" it tells Varnish that its needs to cache a separate version for every -different Accept-Encoding that is comming from the clients. So, if a -clients only accepts gzip encoding Varnish wont't serve the version of +different Accept-Encoding that is coming from the clients. So, if a +clients only accepts gzip encoding Varnish won't serve the version of the page encoded with the deflate encoding. The problem is that the Accept-Encoding field contains a lot of @@ -213,7 +218,7 @@ And another one sends:: - Accept-Encoding:: deflate, gzip + Accept-Encoding:: deflate,gzip Varnish will keep two variants of the page requested due to the different Accept-Encoding headers. Normalizing the accept-encoding @@ -245,9 +250,12 @@ for every variation of User-Agent there is. There are plenty. Even a single patchlevel of the same browser will generate at least 10 different User-Agent headers based just on what operating system they -are running. So if you need to Vary based on User-Agent be sure to -normalize the header or your hit rate will suffer badly. +are running. +So if you *really* need to Vary based on User-Agent be sure to +normalize the header or your hit rate will suffer badly. Use the above +code as a template. + .. _tutorial-increasing_your_hitrate-pragma: Pragma @@ -278,8 +286,8 @@ http://varnish-software.com and http://varnishsoftware.com/ all point at the same site. Since Varnish doesn't know they are different Varnish will cache different versions of every page for every -hostname. You can mitigate this in your web server config by setting -up redirects or by useing the following VCL::: +hostname. You can mitigate this in your web server configuration by setting +up redirects or by using the following VCL::: if (req.http.host ~ "^(www.)?varnish-?software.com") { set req.http.host = "varnish-software.com"; Modified: trunk/varnish-cache/doc/sphinx/tutorial/index.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/tutorial/index.rst 2010-07-07 15:11:33 UTC (rev 5034) +++ trunk/varnish-cache/doc/sphinx/tutorial/index.rst 2010-07-08 08:03:28 UTC (rev 5035) @@ -20,8 +20,6 @@ Good luck. -perbu. - .. toctree:: backend_servers.rst Modified: trunk/varnish-cache/doc/sphinx/tutorial/sizing_your_cache.rst =================================================================== --- trunk/varnish-cache/doc/sphinx/tutorial/sizing_your_cache.rst 2010-07-07 15:11:33 UTC (rev 5034) +++ trunk/varnish-cache/doc/sphinx/tutorial/sizing_your_cache.rst 2010-07-08 08:03:28 UTC (rev 5035) @@ -12,5 +12,6 @@ they are cheap to serve from the backend and you have a limited amount of memory. * Watch the n_lru_nuked counter with varnishstat or some other - tool. If you have a lot of LRU activity then you should consider - increasing the size of the cache. + tool. If you have a lot of LRU activity then your cache is evicting + objects due to space constraints and you should consider increasing + the size of the cache. From tfheen at varnish-cache.org Tue Jul 13 08:16:48 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 10:16:48 +0200 Subject: r5036 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 10:16:48 +0200 (Tue, 13 Jul 2010) New Revision: 5036 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/bin/varnishtest/vtc_server.c branches/2.1/varnish-cache/include/libvarnish.h branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4868: Handle RST leading to EINVAL on Solaris Attempt an even more comprehensive fix for a bug in Solaris: If the remote end RST's a TCP connection, all socket related syscalls seems to return EINVAL. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c 2010-07-08 08:03:28 UTC (rev 5035) +++ branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c 2010-07-13 08:16:48 UTC (rev 5036) @@ -696,10 +696,12 @@ struct sockaddr * VRT_r_server_ip(struct sess *sp) { + int i; - if (sp->mysockaddr->sa_family == AF_UNSPEC) - assert(!getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen) - || errno == ECONNRESET); + if (sp->mysockaddr->sa_family == AF_UNSPEC) { + i = getsockname(sp->fd, sp->mysockaddr, &sp->mysockaddrlen); + assert(TCP_Check(i)); + } return (sp->mysockaddr); } Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishtest/vtc_server.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/vtc_server.c 2010-07-08 08:03:28 UTC (rev 5035) +++ branches/2.1/varnish-cache/bin/varnishtest/vtc_server.c 2010-07-13 08:16:48 UTC (rev 5036) @@ -84,7 +84,7 @@ { struct server *s; struct vtclog *vl; - int i, fd; + int i, j, fd; struct sockaddr_storage addr_s; struct sockaddr *addr; socklen_t l; @@ -105,8 +105,9 @@ vtc_log(vl, 0, "Accepted failed: %s", strerror(errno)); http_process(vl, s->spec, fd, s->sock); vtc_log(vl, 3, "shutting fd %d", fd); - assert((shutdown(fd, SHUT_WR) == 0) - || errno == ENOTCONN || errno == ECONNRESET); + j = shutdown(fd, SHUT_WR); + if (!TCP_Check(j)) + vtc_log(vl, 0, "Shutdown failed: %s", strerror(errno)); TCP_close(&fd); } macro_def(s->vl, s->name, "addr", NULL); Modified: branches/2.1/varnish-cache/include/libvarnish.h =================================================================== --- branches/2.1/varnish-cache/include/libvarnish.h 2010-07-08 08:03:28 UTC (rev 5035) +++ branches/2.1/varnish-cache/include/libvarnish.h 2010-07-13 08:16:48 UTC (rev 5036) @@ -60,7 +60,16 @@ #define TCP_ADDRBUFSIZE 64 #define TCP_PORTBUFSIZE 16 +#if defined (__SVR4) && defined (__sun) +/* + * Solaris returns EINVAL if the other end unexepectedly reset the + * connection. This is a bug in Solaris. + */ +#define TCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN \ + || errno == EINVAL) +#else #define TCP_Check(a) ((a) == 0 || errno == ECONNRESET || errno == ENOTCONN) +#endif #define TCP_Assert(a) assert(TCP_Check(a)) Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/lib/libvarnish/tcp.c =================================================================== --- branches/2.1/varnish-cache/lib/libvarnish/tcp.c 2010-07-08 08:03:28 UTC (rev 5035) +++ branches/2.1/varnish-cache/lib/libvarnish/tcp.c 2010-07-13 08:16:48 UTC (rev 5036) @@ -236,9 +236,11 @@ void TCP_close(int *s) { - assert (close(*s) == 0 || - errno == ECONNRESET || - errno == ENOTCONN); + int i; + + i = close(*s); + + assert (TCP_Check(i)); *s = -1; } Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4867,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 From tfheen at varnish-cache.org Tue Jul 13 08:26:20 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 10:26:20 +0200 Subject: r5037 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 10:26:20 +0200 (Tue, 13 Jul 2010) New Revision: 5037 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/Makefile.am branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge half of r4842: List vmb.h Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/include/Makefile.am =================================================================== --- branches/2.1/varnish-cache/include/Makefile.am 2010-07-13 08:16:48 UTC (rev 5036) +++ branches/2.1/varnish-cache/include/Makefile.am 2010-07-13 08:26:20 UTC (rev 5037) @@ -39,6 +39,7 @@ vev.h \ vlu.h \ vbm.h \ + vmb.h \ vre.h \ vrt.h \ vrt_obj.h \ Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 From tfheen at varnish-cache.org Tue Jul 13 08:32:53 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 10:32:53 +0200 Subject: r5038 - in branches/2.1: . varnish-cache varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 10:32:53 +0200 (Tue, 13 Jul 2010) New Revision: 5038 Modified: branches/2.1/ branches/2.1/varnish-cache/README branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4783: Update URLs and email addresses Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/README =================================================================== --- branches/2.1/varnish-cache/README 2010-07-13 08:26:20 UTC (rev 5037) +++ branches/2.1/varnish-cache/README 2010-07-13 08:32:53 UTC (rev 5038) @@ -1,14 +1,10 @@ This is the Varnish high-performance HTTP accelerator. Documentation and additional information about Varnish is available on -the following web sites: +http://www.varnish-cache.org/ - http://www.varnish-cache.org/ Official web site - - http://varnish.projects.linpro.no/ Developer site and wiki - Technical questions about Varnish and this release should be addressed -to . +to . Questions about commercial support and services related to Varnish -should be addressed to . +should be addressed to . Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 From tfheen at varnish-cache.org Tue Jul 13 08:52:55 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 10:52:55 +0200 Subject: r5039 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 10:52:54 +0200 (Tue, 13 Jul 2010) New Revision: 5039 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_action.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c branches/2.1/varnish-cache/lib/libvcl/vcc_parse.c Log: Merge r4971: Use ExpectErr() instead of Expect this gives us compiler error messages rather than panics. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_action.c 2010-07-13 08:32:53 UTC (rev 5038) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_action.c 2010-07-13 08:52:54 UTC (rev 5039) @@ -321,7 +321,7 @@ vcc_NextToken(tl); - Expect(tl, '('); + ExpectErr(tl, '('); vcc_NextToken(tl); if (tl->t->tok == VAR) { @@ -390,7 +390,7 @@ Fb(tl, 0, "vrt_magic_string_end);\n"); } - Expect(tl, ')'); + ExpectErr(tl, ')'); vcc_NextToken(tl); } @@ -401,7 +401,7 @@ { vcc_NextToken(tl); - Expect(tl, '('); + ExpectErr(tl, '('); vcc_NextToken(tl); Fb(tl, 1, "VRT_ban(sp, \"req.url\", \"~\", "); @@ -409,7 +409,7 @@ vcc_ExpectedStringval(tl); return; } - Expect(tl, ')'); + ExpectErr(tl, ')'); vcc_NextToken(tl); Fb(tl, 0, ", 0);\n"); } @@ -450,9 +450,9 @@ int retval = 0; vcc_NextToken(tl); - Expect(tl, '('); + ExpectErr(tl, '('); vcc_NextToken(tl); - Expect(tl, ID); + ExpectErr(tl, ID); #define VCL_RET_MAC(l, U) \ do { \ @@ -470,7 +470,7 @@ ERRCHK(tl); } vcc_NextToken(tl); - Expect(tl, ')'); + ExpectErr(tl, ')'); vcc_NextToken(tl); } Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_parse.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-13 08:32:53 UTC (rev 5038) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_parse.c 2010-07-13 08:52:54 UTC (rev 5039) @@ -34,6 +34,7 @@ #include #include +#include #include "vsb.h" @@ -153,6 +154,8 @@ const char *p; Expect(tl, CNUM); + if (tl->err) + return (NAN); for (p = tl->t->b; p < tl->t->e; p++) { d *= 10; d += *p - '0'; From tfheen at varnish-cache.org Tue Jul 13 09:03:13 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 11:03:13 +0200 Subject: r5040 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 11:03:13 +0200 (Tue, 13 Jul 2010) New Revision: 5040 Added: branches/2.1/varnish-cache/bin/varnishtest/tests/r00722.vtc Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c branches/2.1/varnish-cache/lib/libvcl/vcc_compile.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c branches/2.1/varnish-cache/lib/libvcl/vcc_xref.c Log: Merge r4967: Fix a problem in director teardown at vcl.discard time We didn't create/destroy directors and backends in a consistent order, and in some case we even destroyed directors more than once. Always destroy in opposite order of creation (which follows VCL source order). Turn the bottom element of the array into (only) an indication of which backend/director is the default. Fixes: #722 Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Copied: branches/2.1/varnish-cache/bin/varnishtest/tests/r00722.vtc (from rev 4967, trunk/varnish-cache/bin/varnishtest/tests/r00722.vtc) =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/r00722.vtc (rev 0) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/r00722.vtc 2010-07-13 09:03:13 UTC (rev 5040) @@ -0,0 +1,31 @@ +# $Id$ + +test "Director cleanup fails on vcl.discard" + +server s1 { + rxreq + txresp +} -start + +varnish v1 -vcl+backend { + director foo random { + { .backend = s1; .weight = 1; } + { .backend = { .host = "${s1_addr}"; .port = "${s1_port}";} .weight =1; } + { .backend = { .host = "${s1_addr}"; .port = "${s1_port}";} .weight =1; } + } + sub vcl_recv { + set req.backend = foo; + } +} -start + + +varnish v1 -vcl+backend { } + +varnish v1 -cliok "vcl.list" +varnish v1 -cliok "vcl.discard vcl1" + +client c1 { + txreq + rxresp +} -run + Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c 2010-07-13 08:52:54 UTC (rev 5039) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c 2010-07-13 09:03:13 UTC (rev 5040) @@ -607,8 +607,6 @@ sprintf(vgcname, "%.*s_%d", PF(tl->t_dir), serial); - Ff(tl, 0, "\tVRT_fini_dir(cli, VGCDIR(_%.*s));\n", - PF(tl->t_dir)); vcc_ParseHostDef(tl, serial, vgcname); if (tl->err) { vsb_printf(tl->sb, @@ -672,6 +670,7 @@ { struct token *t_first; struct dirlist const *dl; + int isfirst; t_first = tl->t; vcc_NextToken(tl); /* ID: director | backend */ @@ -682,14 +681,12 @@ vcc_NextToken(tl); + isfirst = tl->ndirector; if (vcc_IdIs(t_first, "backend")) { tl->t_policy = t_first; vcc_ParseSimpleDirector(tl); } else { - Fh(tl, 1, "\n#define VGC_backend__%.*s %d\n", - PF(tl->t_dir), tl->ndirector); vcc_AddDef(tl, tl->t_dir, R_BACKEND); - tl->ndirector++; ExpectErr(tl, ID); /* ID: policy */ tl->t_policy = tl->t; vcc_NextToken(tl); @@ -708,9 +705,14 @@ dl->func(tl); if (!tl->err) SkipToken(tl, '}'); + Fh(tl, 1, "\n#define VGC_backend__%.*s %d\n", + PF(tl->t_dir), tl->ndirector); + tl->ndirector++; Fi(tl, 0, "\tVRT_init_dir(cli, VCL_conf.director, \"%.*s\",\n", PF(tl->t_policy)); + Ff(tl, 0, "\tVRT_fini_dir(cli, VGCDIR(_%.*s));\n", + PF(tl->t_dir)); Fi(tl, 0, "\t VGC_backend__%.*s, &vgc_dir_priv_%.*s);\n", PF(tl->t_dir), PF(tl->t_dir)); @@ -722,6 +724,18 @@ vcc_ErrWhere(tl, t_first); return; } + + if (isfirst == 1) { + /* + * If this is the first backend|director explicitly + * defined, use it as default backend. + */ + Fi(tl, 0, + "\tVCL_conf.director[0] = VCL_conf.director[%d];\n", + tl->ndirector - 1); + vcc_AddRef(tl, tl->t_dir, R_BACKEND); + } + tl->t_policy = NULL; tl->t_dir = NULL; } Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_compile.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-13 08:52:54 UTC (rev 5039) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_compile.c 2010-07-13 09:03:13 UTC (rev 5040) @@ -469,6 +469,7 @@ VTAILQ_INIT(&tl->sources); tl->nsources = 0; + tl->ndirector = 1; /* General C code */ tl->fc = vsb_newauto(); @@ -580,7 +581,7 @@ return (vcc_DestroyTokenList(tl, NULL)); /* Check if we have any backends at all */ - if (tl->ndirector == 0) { + if (tl->ndirector == 1) { vsb_printf(tl->sb, "No backends or directors found in VCL program, " "at least one is necessary.\n"); Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_xref.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_xref.c 2010-07-13 08:52:54 UTC (rev 5039) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_xref.c 2010-07-13 09:03:13 UTC (rev 5040) @@ -142,10 +142,6 @@ } r->defcnt++; r->name = t; - - /* The first backend is the default and thus has an implicit ref */ - if (type == R_BACKEND && tl->ndirector == 0) - r->refcnt++; } /*--------------------------------------------------------------------*/ From tfheen at varnish-cache.org Tue Jul 13 09:10:48 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 11:10:48 +0200 Subject: r5041 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 11:10:48 +0200 (Tue, 13 Jul 2010) New Revision: 5041 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4968: Destroy directors before their embedded backends. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c 2010-07-13 09:03:13 UTC (rev 5040) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_backend.c 2010-07-13 09:10:48 UTC (rev 5041) @@ -701,6 +701,8 @@ vcc_ErrWhere(tl, tl->t_policy); return; } + Ff(tl, 0, "\tVRT_fini_dir(cli, VGCDIR(_%.*s));\n", + PF(tl->t_dir)); SkipToken(tl, '{'); dl->func(tl); if (!tl->err) @@ -711,8 +713,6 @@ Fi(tl, 0, "\tVRT_init_dir(cli, VCL_conf.director, \"%.*s\",\n", PF(tl->t_policy)); - Ff(tl, 0, "\tVRT_fini_dir(cli, VGCDIR(_%.*s));\n", - PF(tl->t_dir)); Fi(tl, 0, "\t VGC_backend__%.*s, &vgc_dir_priv_%.*s);\n", PF(tl->t_dir), PF(tl->t_dir)); Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 From tfheen at varnish-cache.org Tue Jul 13 09:27:27 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 11:27:27 +0200 Subject: r5042 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 11:27:27 +0200 (Tue, 13 Jul 2010) New Revision: 5042 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_vrt_re.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4823: Fix a minor confusion. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_vrt_re.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_vrt_re.c 2010-07-13 09:10:48 UTC (rev 5041) +++ branches/2.1/varnish-cache/bin/varnishd/cache_vrt_re.c 2010-07-13 09:27:27 UTC (rev 5042) @@ -100,7 +100,7 @@ if (str == NULL) return (""); t = re; - memset(&ovector, 0, sizeof(ovector)); + memset(ovector, 0, sizeof(ovector)); i = VRE_exec(t, str, strlen(str), 0, 0, ovector, 30); /* If it didn't match, we can return the original string */ Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 From tfheen at varnish-cache.org Tue Jul 13 09:33:40 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 11:33:40 +0200 Subject: r5043 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 11:33:40 +0200 (Tue, 13 Jul 2010) New Revision: 5043 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_wrw.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4864: Clarify a debug message Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_wrw.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_wrw.c 2010-07-13 09:27:27 UTC (rev 5042) +++ branches/2.1/varnish-cache/bin/varnishd/cache_wrw.c 2010-07-13 09:33:40 UTC (rev 5043) @@ -105,7 +105,7 @@ if (i != w->liov) { w->werr++; WSL(w, SLT_Debug, *w->wfd, - "Write error, len = %d/%d, errno = %s", + "Write error, retval = %d, len = %d, errno = %s", i, w->liov, strerror(errno)); } } Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4865-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 From tfheen at varnish-cache.org Tue Jul 13 09:38:04 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 11:38:04 +0200 Subject: r5044 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 11:38:04 +0200 (Tue, 13 Jul 2010) New Revision: 5044 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_fetch.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4979: Emit a Length record on fetches from the backend. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_fetch.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_fetch.c 2010-07-13 09:33:40 UTC (rev 5043) +++ branches/2.1/varnish-cache/bin/varnishd/cache_fetch.c 2010-07-13 09:38:04 UTC (rev 5044) @@ -517,6 +517,8 @@ return (__LINE__); } + WSL(sp->wrk, SLT_Length, sp->vbe->fd, "%u", sp->obj->len); + { /* Sanity check fetch methods accounting */ unsigned uu; Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4980-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 From tfheen at varnish-cache.org Tue Jul 13 09:55:33 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 11:55:33 +0200 Subject: r5045 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 11:55:33 +0200 (Tue, 13 Jul 2010) New Revision: 5045 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/binary_heap.c branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4646: Turn the binary heap into a "B-heap" Reduces the number of pagefaults by roughly a factor 9. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Modified: branches/2.1/varnish-cache/lib/libvarnish/binary_heap.c =================================================================== --- branches/2.1/varnish-cache/lib/libvarnish/binary_heap.c 2010-07-13 09:38:04 UTC (rev 5044) +++ branches/2.1/varnish-cache/lib/libvarnish/binary_heap.c 2010-07-13 09:55:33 UTC (rev 5045) @@ -43,7 +43,7 @@ #include "binary_heap.h" #include "libvarnish.h" -/* Paramters ---------------------------------------------------------*/ +/* Parameters --------------------------------------------------------*/ /* * The number of elements in a row has to be a compromise between @@ -81,12 +81,78 @@ unsigned rows; unsigned length; unsigned next; + unsigned page_size; + unsigned page_mask; + unsigned page_shift; }; -#define PARENT(u) ((u) / 2) -/*lint -emacro(835, CHILD) 0 right of + */ -#define CHILD(u,n) ((u) * 2 + (n)) +#define VM_AWARE +#ifdef VM_AWARE + +static unsigned +parent(const struct binheap *bh, unsigned u) +{ + unsigned po; + unsigned v; + + po = u & bh->page_mask; + + if (u < bh->page_size || po > 3) { + v = (u & ~bh->page_mask) | (po >> 1); + } else if (po < 2) { + v = (u - bh->page_size) >> bh->page_shift; + v += v & ~(bh->page_mask >> 1); + v |= bh->page_size / 2; + } else { + v = u - 2; + } + return (v); +} + +static void +child(const struct binheap *bh, unsigned u, unsigned *a, unsigned *b) +{ + + if (u > bh->page_mask && (u & (bh->page_mask - 1)) == 0) { + /* First two elements are magical except on the first page */ + *a = *b = u + 2; + } else if (u & (bh->page_size >> 1)) { + /* The bottom row is even more magical */ + *a = (u & ~bh->page_mask) >> 1; + *a |= u & (bh->page_mask >> 1); + *a += 1; + *a <<= bh->page_shift; + *b = *a + 1; + } else { + /* The rest is as usual, only inside the page */ + *a = u + (u & bh->page_mask); + *b += 1; + } +} + + +#else + +static unsigned +parent(const struct binheap *bh, unsigned u) +{ + + (void)bh; + return (u / 2); +} + +static void +child(const struct binheap *bh, unsigned u, unsigned *a, unsigned *b) +{ + + (void)bh; + *a = u * 2; + *b = *a + 1; +} + +#endif + /* Implementation ----------------------------------------------------*/ static void @@ -114,11 +180,21 @@ binheap_new(void *priv, binheap_cmp_t *cmp_f, binheap_update_t *update_f) { struct binheap *bh; + unsigned u; bh = calloc(sizeof *bh, 1); if (bh == NULL) return (bh); bh->priv = priv; + + bh->page_size = (unsigned)getpagesize() / sizeof (void *); + bh->page_mask = bh->page_size - 1; + assert(!(bh->page_size & bh->page_mask)); /* power of two */ + for (u = 1; (1U << u) != bh->page_size; u++) + ; + bh->page_shift = u; + assert(bh->page_size <= (sizeof(**bh->array) * ROW_WIDTH)); + bh->cmp = cmp_f; bh->update = update_f; bh->next = ROOT_IDX; @@ -164,7 +240,7 @@ assert(bh->magic == BINHEAP_MAGIC); while (u > ROOT_IDX) { - v = PARENT(u); + v = parent(bh, u); if (!bh->cmp(bh->priv, A(bh, u), A(bh, v))) break; binhead_swap(bh, u, v); @@ -180,10 +256,9 @@ assert(bh->magic == BINHEAP_MAGIC); while (1) { - v1 = CHILD(u, 0); + child(bh, u, &v1, &v2); if (v1 >= bh->next) return; - v2 = CHILD(u, 1); if (v2 < bh->next && bh->cmp(bh->priv, A(bh, v2), A(bh, v1))) v1 = v2; if (bh->cmp(bh->priv, A(bh, u), A(bh, v1))) @@ -280,84 +355,14 @@ /* Test driver -------------------------------------------------------*/ #include -#if 1 - -#define N 23 - -static int -cmp(void *priv, void *a, void *b) -{ - - return (*(unsigned *)a < *(unsigned *)b); -} - -void -update(void *priv, void *a, unsigned u) -{ - printf("%p is now %u\n", a, u); -} - -static void -dump(struct binheap *bh, const char *what, unsigned ptr) -{ - FILE *f; - unsigned u, *up; - - printf("dump\n"); - f = popen("dot -Tps >> /tmp/_.ps 2>/dev/null", "w"); - assert(f != NULL); - fprintf(f, "digraph binheap {\n"); - fprintf(f, "size=\"7,10\"\n"); - fprintf(f, "ptr [label=\"%s\"]\n", what); - fprintf(f, "ptr -> node_%u\n", ptr); - for (u = 1; u < bh->next; u++) { - up = A(bh, u); - fprintf(f, "node_%u [label=\"%u\"];\n", u, *up); - if (u > 0) - fprintf(f, "node_%u -> node_%u\n", PARENT(u), u); - } - fprintf(f, "}\n"); - pclose(f); -} - -int -main(int argc, char **argv) -{ - struct binheap *bh; - unsigned l[N], u, *up, lu; - - system("echo %! > /tmp/_.ps"); - bh = binheap_new(NULL, cmp, update); - for (u = 0; u < N; u++) { - l[u] = random() % 1000; - binheap_insert(bh, &l[u]); - if (1) - dump(bh, "Insert", 0); - } - printf("Inserts done\n"); - lu = 0; - while(1) { - up = binheap_root(bh); - if (up == NULL) - break; - assert(*up >= lu); - lu = *up; - u = (random() % (bh->next - 1)) + 1; - binheap_delete(bh, u); - if (1) - dump(bh, "Delete", u); - } - printf("Deletes done\n"); - return (0); -} -#else struct foo { unsigned idx; unsigned key; }; -#define M 1311191 -#define N 1311 +#define M 31011091 /* Number of operations */ +#define N 10313102 /* Number of items */ +#define R -1 /* Random modulus */ struct foo ff[N]; @@ -383,31 +388,23 @@ void chk(struct binheap *bh) { - unsigned u, v, nb = 0; + unsigned u, v; struct foo *fa, *fb; for (u = 2; u < bh->next; u++) { - v = PARENT(u); + v = parent(bh, u); fa = A(bh, u); fb = A(bh, v); - assert(fa->key > fb->key); - continue; - printf("[%2u/%2u] %10u > [%2u/%2u] %10u %s\n", - u, fa - ff, fa->key, - v, fb - ff, fb->key, - fa->key > fb->key ? "OK" : "BAD"); - if (fa->key <= fb->key) - nb++; + assert(fa->key >= fb->key); } - if (nb) - exit(0); } int main(int argc, char **argv) { struct binheap *bh; - unsigned u, v; + unsigned u, v, lr; + struct foo *fp; if (0) { srandomdev(); @@ -416,25 +413,59 @@ srandom(u); } bh = binheap_new(NULL, cmp, update); + + /* First insert our N elements */ + for (u = 0; u < N; u++) { + lr = random() % R; + ff[u].key = lr; + binheap_insert(bh, &ff[u]); + + fp = binheap_root(bh); + assert(fp->idx == 1); + assert(fp->key <= lr); + } + fprintf(stderr, "%d inserts OK\n", N); + /* For M cycles, pick the root, insert new */ for (u = 0; u < M; u++) { + fp = binheap_root(bh); + assert(fp->idx == 1); + + /* It cannot possibly be larger than the last value we added */ + assert(fp->key <= lr); + binheap_delete(bh, fp->idx); + + lr = random() % R; + fp->key = lr; + binheap_insert(bh, fp); + } + fprintf(stderr, "%d replacements OK\n", M); + /* The remove everything */ + lr = 0; + for (u = 0; u < N; u++) { + fp = binheap_root(bh); + assert(fp->idx == 1); + assert(fp->key >= lr); + lr = fp->key; + binheap_delete(bh, fp->idx); + } + fprintf(stderr, "%d removes OK\n", N); + + for (u = 0; u < M; u++) { v = random() % N; if (ff[v].idx > 0) { - if (0) - printf("Delete [%u] %'u\n", v, ff[v].key); - else - printf("-%u", v); + assert(ff[v].idx != 0); binheap_delete(bh, ff[v].idx); + assert(ff[v].idx == 0); } else { - ff[v].key = random(); - if (0) - printf("Insert [%u] %'u\n", v, ff[v].key); - else - printf("+%u", v); + assert(ff[v].idx == 0); + ff[v].key = random() % R; binheap_insert(bh, &ff[v]); + assert(ff[v].idx != 0); } - chk(bh); + if (0) + chk(bh); } + fprintf(stderr, "%d updates OK\n", M); return (0); } #endif -#endif Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4645,4647-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 From tfheen at varnish-cache.org Tue Jul 13 10:26:48 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 12:26:48 +0200 Subject: r5046 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 12:26:47 +0200 (Tue, 13 Jul 2010) New Revision: 5046 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache.h branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_hash.c branches/2.1/varnish-cache/bin/varnishd/flint.lnt branches/2.1/varnish-cache/bin/varnishd/hash_critbit.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4859-r4861: Make the critbit "Y" a independently allocated struct r4859: Make the critbit "Y" a independently allocated struct, rather than using the objhead as carrier for it. The time difference between objhead freeing and Y freeing is very significant on systems with rolling URLS (ie: "article=%d") resulting in far too many objheads being stuck on the cooling list. r4860: Also cool off objheaders r4861: Add a single write memory barrier, to be absolutely 100% sure that the tree is sane at all points. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishd/cache.h =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache.h 2010-07-13 09:55:33 UTC (rev 5045) +++ branches/2.1/varnish-cache/bin/varnishd/cache.h 2010-07-13 10:26:47 UTC (rev 5046) @@ -206,6 +206,7 @@ #define WORKER_MAGIC 0x6391adcf struct objhead *nobjhead; struct objcore *nobjcore; + void *nhashpriv; struct dstat stats; double lastused; Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_hash.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_hash.c 2010-07-13 09:55:33 UTC (rev 5045) +++ branches/2.1/varnish-cache/bin/varnishd/cache_hash.c 2010-07-13 10:26:47 UTC (rev 5046) @@ -146,6 +146,10 @@ w->nobjhead = NULL; w->stats.n_objecthead--; } + if (w->nhashpriv != NULL) { + free(w->nhashpriv); + w->nhashpriv = NULL; + } } void Modified: branches/2.1/varnish-cache/bin/varnishd/flint.lnt =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/flint.lnt 2010-07-13 09:55:33 UTC (rev 5045) +++ branches/2.1/varnish-cache/bin/varnishd/flint.lnt 2010-07-13 10:26:47 UTC (rev 5046) @@ -157,6 +157,7 @@ -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 +-emacro(506, VSTAILQ_FOREACH_SAFE) // constant value boolean -esym(765, vcc_ProcAction) // could be made static -esym(759, vcc_ProcAction) // could be moved to module Modified: branches/2.1/varnish-cache/bin/varnishd/hash_critbit.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/hash_critbit.c 2010-07-13 09:55:33 UTC (rev 5045) +++ branches/2.1/varnish-cache/bin/varnishd/hash_critbit.c 2010-07-13 10:26:47 UTC (rev 5046) @@ -43,11 +43,10 @@ #include "cache.h" #include "hash_slinger.h" #include "cli_priv.h" +#include "vmb.h" static struct lock hcb_mtx; -static VTAILQ_HEAD(,objhead) laylow = VTAILQ_HEAD_INITIALIZER(laylow); - /********************************************************************** * Table for finding out how many bits two bytes have in common, * counting from the MSB towards the LSB. @@ -93,10 +92,13 @@ */ struct hcb_y { + unsigned magic; +#define HCB_Y_MAGIC 0x125c4bd2 unsigned short critbit; unsigned char ptr; unsigned char bitmask; volatile uintptr_t leaf[2]; + VSTAILQ_ENTRY(hcb_y) list; }; #define HCB_BIT_NODE (1<<0) @@ -108,6 +110,11 @@ static struct hcb_root hcb_root; +static VSTAILQ_HEAD(, hcb_y) cool_y = VSTAILQ_HEAD_INITIALIZER(cool_y); +static VSTAILQ_HEAD(, hcb_y) dead_y = VSTAILQ_HEAD_INITIALIZER(dead_y); +static VTAILQ_HEAD(, objhead) cool_h = VTAILQ_HEAD_INITIALIZER(cool_h); +static VTAILQ_HEAD(, objhead) dead_h = VTAILQ_HEAD_INITIALIZER(dead_h); + /********************************************************************** * Pointer accessor functions */ @@ -146,6 +153,7 @@ hcb_r_y(struct hcb_y *y) { + CHECK_OBJ_NOTNULL(y, HCB_Y_MAGIC); assert(!((uintptr_t)y & (HCB_BIT_NODE|HCB_BIT_Y))); return (HCB_BIT_Y | (uintptr_t)y); } @@ -169,6 +177,7 @@ { unsigned char u, r; + CHECK_OBJ_NOTNULL(y, HCB_Y_MAGIC); for (u = 0; u < DIGEST_LEN && oh1->digest[u] == oh2->digest[u]; u++) ; assert(u < DIGEST_LEN); @@ -186,7 +195,7 @@ */ static struct objhead * -hcb_insert(struct hcb_root *root, struct objhead *oh, int has_lock) +hcb_insert(struct worker *wrk, struct hcb_root *root, struct objhead *oh, int has_lock) { volatile uintptr_t *p; uintptr_t pp; @@ -205,6 +214,7 @@ while(hcb_is_y(pp)) { y = hcb_l_y(pp); + CHECK_OBJ_NOTNULL(y, HCB_Y_MAGIC); assert(y->ptr < DIGEST_LEN); s = (oh->digest[y->ptr] & y->bitmask) != 0; assert(s < 2); @@ -231,9 +241,9 @@ /* Insert */ - y2 = (void*)&oh->u; - memset(y2, 0, sizeof *y2); - (void)hcb_crit_bit(oh, hcb_l_node(*p), y2); + CAST_OBJ_NOTNULL(y2, wrk->nhashpriv, HCB_Y_MAGIC); + wrk->nhashpriv = NULL; + (void)hcb_crit_bit(oh, oh2, y2); s2 = (oh->digest[y2->ptr] & y2->bitmask) != 0; assert(s2 < 2); y2->leaf[s2] = hcb_r_node(oh); @@ -244,6 +254,7 @@ while(hcb_is_y(*p)) { y = hcb_l_y(*p); + CHECK_OBJ_NOTNULL(y, HCB_Y_MAGIC); assert(y->critbit != y2->critbit); if (y->critbit > y2->critbit) break; @@ -253,6 +264,7 @@ p = &y->leaf[s]; } y2->leaf[s2] = *p; + VWMB(); *p = hcb_r_y(y2); return(oh); } @@ -282,8 +294,7 @@ assert(s < 2); if (y->leaf[s] == hcb_r_node(oh)) { *p = y->leaf[1 - s]; - y->leaf[0] = 0; - y->leaf[1] = 0; + VSTAILQ_INSERT_TAIL(&cool_y, y, list); return; } p = &y->leaf[s]; @@ -321,21 +332,12 @@ static void hcb_dump(struct cli *cli, const char * const *av, void *priv) { - struct objhead *oh, *oh2; - struct hcb_y *y; (void)priv; (void)av; cli_out(cli, "HCB dump:\n"); dumptree(cli, hcb_root.origo, 0); cli_out(cli, "Coollist:\n"); - Lck_Lock(&hcb_mtx); - VTAILQ_FOREACH_SAFE(oh, &laylow, coollist, oh2) { - y = (void *)&oh->u; - cli_out(cli, "%p ref %d, y{%u, %u}\n", oh, - oh->refcnt, y->leaf[0], y->leaf[1]); - } - Lck_Unlock(&hcb_mtx); } static struct cli_proto hcb_cmds[] = { @@ -348,9 +350,9 @@ static void * hcb_cleaner(void *priv) { + struct hcb_y *y, *y2; + struct worker ww; struct objhead *oh, *oh2; - struct hcb_y *y; - struct worker ww; memset(&ww, 0, sizeof ww); ww.magic = WORKER_MAGIC; @@ -358,25 +360,20 @@ THR_SetName("hcb_cleaner"); (void)priv; while (1) { - Lck_Lock(&hcb_mtx); - VTAILQ_FOREACH_SAFE(oh, &laylow, coollist, oh2) { - CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC); - AZ(oh->refcnt); - y = (void *)&oh->u; - if (y->leaf[0] || y->leaf[1]) - continue; - if (++oh->digest[0] > params->critbit_cooloff) { - VTAILQ_REMOVE(&laylow, oh, coollist); - break; - } + VSTAILQ_FOREACH_SAFE(y, &dead_y, list, y2) { + VSTAILQ_REMOVE_HEAD(&dead_y, list); + FREE_OBJ(y); } - Lck_Unlock(&hcb_mtx); - if (oh == NULL) { - WRK_SumStat(&ww); - (void)sleep(1); - } else { + VTAILQ_FOREACH_SAFE(oh, &dead_h, hoh_list, oh2) { + VTAILQ_REMOVE(&dead_h, oh, hoh_list); HSH_DeleteObjHead(&ww, oh); } + Lck_Lock(&hcb_mtx); + VSTAILQ_CONCAT(&dead_y, &cool_y); + VTAILQ_CONCAT(&dead_h, &cool_h, hoh_list); + Lck_Unlock(&hcb_mtx); + WRK_SumStat(&ww); + TIM_sleep(params->critbit_cooloff); } NEEDLESS_RETURN(NULL); } @@ -393,7 +390,6 @@ CLI_AddFuncs(hcb_cmds); Lck_New(&hcb_mtx); AZ(pthread_create(&tp, NULL, hcb_cleaner, NULL)); - assert(sizeof(struct hcb_y) <= sizeof(oh->u)); memset(&hcb_root, 0, sizeof hcb_root); hcb_build_bittbl(); } @@ -411,11 +407,10 @@ if (oh->refcnt == 0) { Lck_Lock(&hcb_mtx); hcb_delete(&hcb_root, oh); + VTAILQ_INSERT_TAIL(&cool_h, oh, hoh_list); + Lck_Unlock(&hcb_mtx); assert(VTAILQ_EMPTY(&oh->objcs)); assert(VTAILQ_EMPTY(&oh->waitinglist)); - oh->digest[0] = 0; - VTAILQ_INSERT_TAIL(&laylow, oh, coollist); - Lck_Unlock(&hcb_mtx); } Lck_Unlock(&oh->mtx); #ifdef PHK @@ -428,22 +423,28 @@ hcb_lookup(const struct sess *sp, struct objhead *noh) { struct objhead *oh; - volatile unsigned u; + struct hcb_y *y; + unsigned u; unsigned with_lock; (void)sp; - + with_lock = 0; while (1) { if (with_lock) { + if (sp->wrk->nhashpriv == NULL) { + ALLOC_OBJ(y, HCB_Y_MAGIC); + sp->wrk->nhashpriv = y; + } + AN(sp->wrk->nhashpriv); Lck_Lock(&hcb_mtx); VSL_stats->hcb_lock++; assert(noh->refcnt == 1); - oh = hcb_insert(&hcb_root, noh, 1); + oh = hcb_insert(sp->wrk, &hcb_root, noh, 1); Lck_Unlock(&hcb_mtx); } else { VSL_stats->hcb_nolock++; - oh = hcb_insert(&hcb_root, noh, 0); + oh = hcb_insert(sp->wrk, &hcb_root, noh, 0); } if (oh != NULL && oh == noh) { @@ -452,7 +453,7 @@ VSL_stats->hcb_insert++; assert(oh->refcnt > 0); return (oh); - } + } if (oh == NULL) { assert(!with_lock); @@ -468,8 +469,12 @@ * under us, so fall through and try with the lock held. */ u = oh->refcnt; - if (u > 0) + if (u > 0) { oh->refcnt++; + } else { + assert(!with_lock); + with_lock = 1; + } Lck_Unlock(&oh->mtx); if (u > 0) return (oh); Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 From tfheen at varnish-cache.org Tue Jul 13 11:07:01 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Tue, 13 Jul 2010 13:07:01 +0200 Subject: r5047 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-13 13:07:00 +0200 (Tue, 13 Jul 2010) New Revision: 5047 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00018.vtc branches/2.1/varnish-cache/include/shmlog_tags.h branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/include/vrt.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_action.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c Log: Merge r5016: Add "log" command to VCL This allows logging to varnishlog with the VCL_Log tag. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c 2010-07-13 10:26:47 UTC (rev 5046) +++ branches/2.1/varnish-cache/bin/varnishd/cache_vrt.c 2010-07-13 11:07:00 UTC (rev 5047) @@ -940,6 +940,20 @@ /*--------------------------------------------------------------------*/ void +VRT_log(struct sess *sp, const char *str, ...) +{ + va_list ap; + char *b; + + va_start(ap, str); + b = vrt_assemble_string(sp->http, NULL, str, ap); + va_end(ap); + WSP(sp, SLT_VCL_Log, "%s", b); +} + +/*--------------------------------------------------------------------*/ + +void VRT_ban(struct sess *sp, char *cmds, ...) { char *a1, *a2, *a3; Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Modified: branches/2.1/varnish-cache/bin/varnishtest/tests/v00018.vtc =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/v00018.vtc 2010-07-13 10:26:47 UTC (rev 5046) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/v00018.vtc 2010-07-13 11:07:00 UTC (rev 5047) @@ -122,3 +122,7 @@ sub vcl_error { synthetic if "foo"; } } +varnish v1 -vcl { + backend b { .host = "127.0.0.1"; } + sub vcl_recv { log "FOO"; } +} Modified: branches/2.1/varnish-cache/include/shmlog_tags.h =================================================================== --- branches/2.1/varnish-cache/include/shmlog_tags.h 2010-07-13 10:26:47 UTC (rev 5046) +++ branches/2.1/varnish-cache/include/shmlog_tags.h 2010-07-13 11:07:00 UTC (rev 5047) @@ -96,3 +96,4 @@ SLTM(Hash) SLTM(Backend_health) +SLTM(VCL_Log) Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Modified: branches/2.1/varnish-cache/include/vrt.h =================================================================== --- branches/2.1/varnish-cache/include/vrt.h 2010-07-13 10:26:47 UTC (rev 5046) +++ branches/2.1/varnish-cache/include/vrt.h 2010-07-13 11:07:00 UTC (rev 5047) @@ -139,6 +139,7 @@ void VRT_ban(struct sess *sp, char *, ...); void VRT_ban_string(struct sess *sp, const char *, ...); void VRT_purge(struct sess *sp, double ttl, double grace); +void VRT_log(struct sess *, const char *msg, ...); void VRT_count(const struct sess *, unsigned); int VRT_rewrite(const char *, const char *); Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_action.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_action.c 2010-07-13 10:26:47 UTC (rev 5046) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_action.c 2010-07-13 11:07:00 UTC (rev 5047) @@ -493,7 +493,24 @@ } /*--------------------------------------------------------------------*/ +static void +parse_log(struct tokenlist *tl) +{ + vcc_NextToken(tl); + Fb(tl, 1, "VRT_log(sp, "); + if (!vcc_StringVal(tl)) { + vcc_ExpectedStringval(tl); + return; + } + do + Fb(tl, 0, ", "); + while (vcc_StringVal(tl)); + Fb(tl, 0, " vrt_magic_string_end);\n"); +} + +/*--------------------------------------------------------------------*/ + static void parse_new_syntax(struct tokenlist *tl) { @@ -530,6 +547,7 @@ { "synthetic", parse_synthetic }, { "unset", parse_unset }, { "return", parse_return }, + { "log", parse_log }, { NULL, NULL } }; Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-13 10:26:47 UTC (rev 5046) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-13 11:07:00 UTC (rev 5047) @@ -282,8 +282,9 @@ vsb_cat(sb, "void VRT_ban(struct sess *sp, char *, ...);\n"); vsb_cat(sb, "void VRT_ban_string(struct sess *sp, const char *, ..."); vsb_cat(sb, ");\nvoid VRT_purge(struct sess *sp, double ttl, double"); - vsb_cat(sb, " grace);\n\nvoid VRT_count(const struct sess *, unsign"); - vsb_cat(sb, "ed);\nint VRT_rewrite(const char *, const char *);\n"); + vsb_cat(sb, " grace);\nvoid VRT_log(struct sess *, const char *msg,"); + vsb_cat(sb, " ...);\n\nvoid VRT_count(const struct sess *, unsigned"); + vsb_cat(sb, ");\nint VRT_rewrite(const char *, const char *);\n"); vsb_cat(sb, "void VRT_error(struct sess *, unsigned, const char *);"); vsb_cat(sb, "\nint VRT_switch_config(const char *);\n"); vsb_cat(sb, "\nenum gethdr_e { HDR_REQ, HDR_RESP, HDR_OBJ, HDR_BERE"); From phk at varnish-cache.org Thu Jul 15 10:42:54 2010 From: phk at varnish-cache.org (phk at varnish-cache.org) Date: Thu, 15 Jul 2010 12:42:54 +0200 Subject: r5048 - trunk/varnish-cache/bin/varnishd Message-ID: Author: phk Date: 2010-07-15 12:42:54 +0200 (Thu, 15 Jul 2010) New Revision: 5048 Modified: trunk/varnish-cache/bin/varnishd/cache_center.c Log: Make Expect 100-continue test case-insensitive Candidate for merging into 2.1 branch Modified: trunk/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- trunk/varnish-cache/bin/varnishd/cache_center.c 2010-07-13 11:07:00 UTC (rev 5047) +++ trunk/varnish-cache/bin/varnishd/cache_center.c 2010-07-15 10:42:54 UTC (rev 5048) @@ -1149,7 +1149,7 @@ * Handle Expect headers */ if (http_GetHdr(sp->http, H_Expect, &p)) { - if (strcmp(p, "100-continue")) { + if (strcasecmp(p, "100-continue")) { sp->err_code = 417; sp->step = STP_ERROR; return (0); From tfheen at varnish-cache.org Wed Jul 28 09:20:53 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 28 Jul 2010 11:20:53 +0200 Subject: r5049 - branches/2.1/varnish-cache/doc Message-ID: Author: tfheen Date: 2010-07-28 11:20:52 +0200 (Wed, 28 Jul 2010) New Revision: 5049 Added: branches/2.1/varnish-cache/doc/changes-2.1.2-2.1.3.xml branches/2.1/varnish-cache/doc/changes-2.1.3.xml Modified: branches/2.1/varnish-cache/doc/Makefile.am Log: Document changes for 2.1.3 Modified: branches/2.1/varnish-cache/doc/Makefile.am =================================================================== --- branches/2.1/varnish-cache/doc/Makefile.am 2010-07-15 10:42:54 UTC (rev 5048) +++ branches/2.1/varnish-cache/doc/Makefile.am 2010-07-28 09:20:52 UTC (rev 5049) @@ -1,6 +1,7 @@ # $Id$ CHANGELOGS = \ + changes-2.1.3.html \ changes-2.1.2.html \ changes-2.1.1.html \ changes-2.1.0.html \ @@ -17,6 +18,7 @@ changes-1.0.4.html XML = \ + changes-2.1.2-2.1.3.xml \ changes-2.1.1-2.1.2.xml \ changes-2.1.0-2.1.1.xml \ changes-2.0.6-2.1.0.xml \ Added: branches/2.1/varnish-cache/doc/changes-2.1.2-2.1.3.xml =================================================================== --- branches/2.1/varnish-cache/doc/changes-2.1.2-2.1.3.xml (rev 0) +++ branches/2.1/varnish-cache/doc/changes-2.1.2-2.1.3.xml 2010-07-28 09:20:52 UTC (rev 5049) @@ -0,0 +1,74 @@ + + +]> + + + + varnishd + + + Improve scalability of critbit. + + + + The critbit hash algorithm has now been tightened to make + sure the tree is in a consistent state at all points, and the + time we wait for an object to cool off after it is eligible for + garbage collection has been tweaked. + + + + Add log command to VCL. This emits + a VCL_log entry into the shared memory log. + + + + Only emit Length and ReqEnd log entries if we actually + have an XID. This should get rid of some empty log lines in + varnishncsa. + + + + Destroy directors in a predictable fashion, namely reverse + of creation order. + + + + Fix bug when ESI elements spanned storage elements causing + a panic. + + + + In some cases, the VCL compiler would panic instead of + giving sensible messages. This has now been fixed. + + + + Correct an off-by-one error when the requested range + exceeds the size of an object. + + + + Handle requests for the end of an object correctly. + + + + Allow tabulator characters in the third field of the + first line of HTTP requests + + + + On Solaris, if the remote end sends us an RST, all system + calls related to that socket will return EINVAL. We now handle + this better. + + + + libvarnishapi + + The -X parameter didn't work correctly. This + has been fixed. + + + Added: branches/2.1/varnish-cache/doc/changes-2.1.3.xml =================================================================== --- branches/2.1/varnish-cache/doc/changes-2.1.3.xml (rev 0) +++ branches/2.1/varnish-cache/doc/changes-2.1.3.xml 2010-07-28 09:20:52 UTC (rev 5049) @@ -0,0 +1,12 @@ + + + +]> + + + Varnish + 2.1.3 + + + From tfheen at varnish-cache.org Wed Jul 28 09:54:29 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 28 Jul 2010 11:54:29 +0200 Subject: r5050 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-28 11:54:29 +0200 (Wed, 28 Jul 2010) New Revision: 5050 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/cache_center.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c Log: Merge r5048: Make Expect 100-continue test case-insensitive Candidate for merging into 2.1 branch Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Modified: branches/2.1/varnish-cache/bin/varnishd/cache_center.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishd/cache_center.c 2010-07-28 09:20:52 UTC (rev 5049) +++ branches/2.1/varnish-cache/bin/varnishd/cache_center.c 2010-07-28 09:54:29 UTC (rev 5050) @@ -1150,7 +1150,7 @@ * Handle Expect headers */ if (http_GetHdr(sp->http, H_Expect, &p)) { - if (strcmp(p, "100-continue")) { + if (strcasecmp(p, "100-continue")) { sp->err_code = 417; sp->step = STP_ERROR; return (0); Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Modified: branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c =================================================================== --- branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-28 09:20:52 UTC (rev 5049) +++ branches/2.1/varnish-cache/lib/libvcl/vcc_fixed_token.c 2010-07-28 09:54:29 UTC (rev 5050) @@ -227,8 +227,8 @@ vsb_cat(sb, " * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWI"); vsb_cat(sb, "SE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFT"); vsb_cat(sb, "WARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n"); - vsb_cat(sb, " * SUCH DAMAGE.\n *\n * $Id: vrt.h 4703 2010-04-21 09:"); - vsb_cat(sb, "18:39Z tfheen $\n *\n * Runtime support for compiled V"); + vsb_cat(sb, " * SUCH DAMAGE.\n *\n * $Id: vrt.h 5047 2010-07-13 11:"); + vsb_cat(sb, "07:00Z tfheen $\n *\n * Runtime support for compiled V"); vsb_cat(sb, "CL programs.\n *\n * XXX: When this file is changed, l"); vsb_cat(sb, "ib/libvcl/vcc_gen_fixed_token.tcl\n"); vsb_cat(sb, " * XXX: *MUST* be rerun.\n */\n"); From tfheen at varnish-cache.org Wed Jul 28 10:58:20 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 28 Jul 2010 12:58:20 +0200 Subject: r5051 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-28 12:58:20 +0200 (Wed, 28 Jul 2010) New Revision: 5051 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/bin/varnishtest/vtc.c branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4749: Avoid using tempnam(3) Don't use tempnam(3) it results in a bogus compile time warning, because we are not trying to create a file but a directory. Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Modified: branches/2.1/varnish-cache/bin/varnishtest/vtc.c =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/vtc.c 2010-07-28 09:54:29 UTC (rev 5050) +++ branches/2.1/varnish-cache/bin/varnishtest/vtc.c 2010-07-28 10:58:20 UTC (rev 5051) @@ -610,6 +610,7 @@ double tmax, t0, t00; unsigned dur = 30; const char *nmax; + char tmpdir[BUFSIZ]; char cmd[BUFSIZ]; setbuf(stdout, NULL); @@ -644,8 +645,8 @@ init_macro(); init_sema(); - setenv("TMPDIR", "/tmp", 0); - vtc_tmpdir = tempnam(NULL, "vtc"); + bprintf(tmpdir, "/tmp/vtc.%d.%08x", getpid(), (unsigned)random()); + vtc_tmpdir = tmpdir; AN(vtc_tmpdir); AZ(mkdir(vtc_tmpdir, 0700)); macro_def(vltop, NULL, "tmpdir", vtc_tmpdir); @@ -677,7 +678,6 @@ if (vtc_error == 0 || vtc_verbosity == 0) { bprintf(cmd, "rm -rf %s", vtc_tmpdir); AZ(system(cmd)); - free(vtc_tmpdir); } if (vtc_error) Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 From tfheen at varnish-cache.org Wed Jul 28 11:04:31 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 28 Jul 2010 13:04:31 +0200 Subject: r5052 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-28 13:04:31 +0200 (Wed, 28 Jul 2010) New Revision: 5052 Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/include/vmb.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4912: Revisit the memory barriers Try to catch some common platforms with inline assembler. I cannot possibly express the magnitude of this particular POSIX FAIL! Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Modified: branches/2.1/varnish-cache/include/vmb.h =================================================================== --- branches/2.1/varnish-cache/include/vmb.h 2010-07-28 10:58:20 UTC (rev 5051) +++ branches/2.1/varnish-cache/include/vmb.h 2010-07-28 11:04:31 UTC (rev 5052) @@ -29,6 +29,10 @@ * * Memory barriers * + * XXX: It is utterly braindamaged, that no standard facility for this + * XXX: is available. The "just use pthreads locking" excuse does not + * XXX: make sense, and does not apply to two unthreaded programs sharing + * XXX: a memory segment. */ #ifndef VMB_H_INCLUDED @@ -37,15 +41,43 @@ void vmb_pthread(void); #if defined(__FreeBSD__) && __FreeBSD_version >= 800058 + #include #include -#define VMB() mb() -#define VWMB() wmb() -#define VRMB() rmb() +#define VMB() mb() +#define VWMB() wmb() +#define VRMB() rmb() + +#elif defined(__amd64__) && defined(__GNUC__) + +#define VMB() __asm __volatile("mfence;" : : : "memory") +#define VWMB() __asm __volatile("sfence;" : : : "memory") +#define VRMB() __asm __volatile("lfence;" : : : "memory") + +#elif defined(__arm__) + +#define VMB() +#define VWMB() +#define VRMB() + +#elif defined(__i386__) && defined(__GNUC__) + +#define VMB() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory") +#define VWMB() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory") +#define VRMB() __asm __volatile("lock; addl $0,(%%esp)" : : : "memory") + +#elif defined(__sparc64__) && defined(__GNUC__) + +#define VMB() __asm__ __volatile__ ("membar #MemIssue": : :"memory") +#define VWMB() VMB() +#define VRMB() VMB() + #else -#define VMB() vmb_pthread() -#define VWMB() vmb_pthread() -#define VRMB() vmb_pthread() + +#define VMB() vmb_pthread() +#define VWMB() vmb_pthread() +#define VRMB() vmb_pthread() + #endif #endif /* VMB_H_INCLUDED */ Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 From tfheen at varnish-cache.org Wed Jul 28 11:11:56 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 28 Jul 2010 13:11:56 +0200 Subject: r5053 - in branches/2.1: . varnish-cache/bin/varnishd varnish-cache/bin/varnishtest/tests varnish-cache/include varnish-cache/lib/libvarnish varnish-cache/lib/libvcl Message-ID: Author: tfheen Date: 2010-07-28 13:11:56 +0200 (Wed, 28 Jul 2010) New Revision: 5053 Added: branches/2.1/varnish-cache/bin/varnishtest/tests/b00033.vtc Modified: branches/2.1/ branches/2.1/varnish-cache/bin/varnishd/cache_backend.h branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c branches/2.1/varnish-cache/bin/varnishd/vparam.h branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc branches/2.1/varnish-cache/include/vct.h branches/2.1/varnish-cache/include/vev.h branches/2.1/varnish-cache/lib/libvarnish/tcp.c branches/2.1/varnish-cache/lib/libvarnish/vev.c branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c Log: Merge r4986: Add a code coverage test for the classic hasher, now that critbit is the default Property changes on: branches/2.1 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishd/cache_backend.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/cache_backend_cfg.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishd/vparam.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishd/vparam.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Copied: branches/2.1/varnish-cache/bin/varnishtest/tests/b00033.vtc (from rev 4986, trunk/varnish-cache/bin/varnishtest/tests/b00033.vtc) =================================================================== --- branches/2.1/varnish-cache/bin/varnishtest/tests/b00033.vtc (rev 0) +++ branches/2.1/varnish-cache/bin/varnishtest/tests/b00033.vtc 2010-07-28 11:11:56 UTC (rev 5053) @@ -0,0 +1,44 @@ +# $Id$ + +test "classic hash code coverage" + +server s1 { + rxreq + expect req.url == /1 + txresp -bodylen 5 + + rxreq + expect req.url == /2 + txresp -bodylen 6 + + rxreq + expect req.url == /1 + txresp -bodylen 7 + + rxreq + expect req.url == /2 + txresp -bodylen 8 + +} -start + +varnish v1 -arg "-hclassic,11" -vcl+backend {} -start + +client c1 { + txreq -url /1 + rxresp + expect resp.bodylen == 5 + txreq -url /2 + rxresp + expect resp.bodylen == 6 +} -run + +varnish v1 -cliok "purge req.url ~ ." + +client c1 { + txreq -url /1 + rxresp + expect resp.bodylen == 7 + txreq -url /2 + rxresp + expect resp.bodylen == 8 +} -run Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/c00019.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/c00019.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00325.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/r00325.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/r00416.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/r00416.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/bin/varnishtest/tests/v00011.vtc ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/bin/varnishtest/tests/v00011.vtc:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/include/vct.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/include/vct.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/include/vev.h ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/include/vev.h:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/tcp.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/lib/libvarnish/tcp.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvarnish/vev.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/lib/libvarnish/vev.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 Property changes on: branches/2.1/varnish-cache/lib/libvcl/vcc_dir_random.c ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4989,5016,5048 + /trunk/varnish-cache/lib/libvcl/vcc_dir_random.c:4637,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 From tfheen at varnish-cache.org Wed Jul 28 11:26:10 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 28 Jul 2010 13:26:10 +0200 Subject: r5054 - branches/2.1/varnish-cache/doc Message-ID: Author: tfheen Date: 2010-07-28 13:26:10 +0200 (Wed, 28 Jul 2010) New Revision: 5054 Modified: branches/2.1/varnish-cache/doc/changes-2.1.2-2.1.3.xml Log: Fix syntax error in XML file Modified: branches/2.1/varnish-cache/doc/changes-2.1.2-2.1.3.xml =================================================================== --- branches/2.1/varnish-cache/doc/changes-2.1.2-2.1.3.xml 2010-07-28 11:11:56 UTC (rev 5053) +++ branches/2.1/varnish-cache/doc/changes-2.1.2-2.1.3.xml 2010-07-28 11:26:10 UTC (rev 5054) @@ -70,5 +70,6 @@ The -X parameter didn't work correctly. This has been fixed. + From tfheen at varnish-cache.org Wed Jul 28 11:58:01 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 28 Jul 2010 13:58:01 +0200 Subject: r5055 - branches/2.1/varnish-cache Message-ID: Author: tfheen Date: 2010-07-28 13:58:00 +0200 (Wed, 28 Jul 2010) New Revision: 5055 Modified: branches/2.1/varnish-cache/configure.ac Log: Bump version number to 2.1.3 Modified: branches/2.1/varnish-cache/configure.ac =================================================================== --- branches/2.1/varnish-cache/configure.ac 2010-07-28 11:26:10 UTC (rev 5054) +++ branches/2.1/varnish-cache/configure.ac 2010-07-28 11:58:00 UTC (rev 5055) @@ -5,7 +5,7 @@ Copyright (c) 2006-2010 Redpill Linpro AS Copyright (c) 2010 Varnish Software AS]) AC_REVISION([$Id$]) -AC_INIT([Varnish], [2.1.2], [varnish-dev at varnish-cache.org]) +AC_INIT([Varnish], [2.1.3], [varnish-dev at varnish-cache.org]) AC_CONFIG_SRCDIR(include/varnishapi.h) AM_CONFIG_HEADER(config.h) From tfheen at varnish-cache.org Wed Jul 28 12:19:08 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 28 Jul 2010 14:19:08 +0200 Subject: r5056 - in tags: . varnish-2.1.3 Message-ID: Author: tfheen Date: 2010-07-28 14:19:08 +0200 (Wed, 28 Jul 2010) New Revision: 5056 Added: tags/varnish-2.1.3/ Log: Tag 2.1.3 Property changes on: tags/varnish-2.1.3 ___________________________________________________________________ Added: svn:ignore + .deps Makefile Makefile.in aclocal.m4 autom4te.cache compile config.guess config.h config.h.in config.log config.status config.sub configure depcomp install-sh missing stamp-h1 varnish Added: svn:mergeinfo + /trunk:4637,4640,4643-4650,4654-4670,4686,4689-4690,4700,4712,4715-4719,4731,4749-4750,4757-4758,4762,4783,4818,4823,4829,4842,4859-4861,4864-4868,4912,4967-4968,4971,4973-4975,4977,4979-4981,4986,4989,5016,5048 From tfheen at varnish-cache.org Wed Jul 28 14:20:59 2010 From: tfheen at varnish-cache.org (tfheen at varnish-cache.org) Date: Wed, 28 Jul 2010 16:20:59 +0200 Subject: r5057 - branches/2.1/varnish-cache/redhat Message-ID: Author: tfheen Date: 2010-07-28 16:20:59 +0200 (Wed, 28 Jul 2010) New Revision: 5057 Modified: branches/2.1/varnish-cache/redhat/varnish.spec Log: Update RH spec file Modified: branches/2.1/varnish-cache/redhat/varnish.spec =================================================================== --- branches/2.1/varnish-cache/redhat/varnish.spec 2010-07-28 12:19:08 UTC (rev 5056) +++ branches/2.1/varnish-cache/redhat/varnish.spec 2010-07-28 14:20:59 UTC (rev 5057) @@ -1,6 +1,6 @@ Summary: High-performance HTTP accelerator Name: varnish -Version: 2.1.2 +Version: 2.1.3 Release: 1 License: BSD Group: System Environment/Daemons @@ -257,6 +257,10 @@ %postun libs -p /sbin/ldconfig %changelog +* Wed Jul 28 2010 Tollef Fog Heen - 2.1.3-1 +- New upstream release + +%changelog * Wed May 05 2010 Tollef Fog Heen - 2.1.2-1 - New upstream release - Remove patches merged upstream From ingvar at varnish-cache.org Fri Jul 30 12:04:27 2010 From: ingvar at varnish-cache.org (ingvar at varnish-cache.org) Date: Fri, 30 Jul 2010 14:04:27 +0200 Subject: r5058 - trunk/varnish-cache/lib/libjemalloc Message-ID: Author: ingvar Date: 2010-07-30 14:04:26 +0200 (Fri, 30 Jul 2010) New Revision: 5058 Modified: trunk/varnish-cache/lib/libjemalloc/jemalloc_linux.c Log: missing ifdefs for pagesize/pointersize s390 (32bit) Modified: trunk/varnish-cache/lib/libjemalloc/jemalloc_linux.c =================================================================== --- trunk/varnish-cache/lib/libjemalloc/jemalloc_linux.c 2010-07-28 14:20:59 UTC (rev 5057) +++ trunk/varnish-cache/lib/libjemalloc/jemalloc_linux.c 2010-07-30 12:04:26 UTC (rev 5058) @@ -273,6 +273,11 @@ # define QUANTUM_2POW 4 # define SIZEOF_PTR_2POW 2 #endif +#ifdef __s390__ +# define PAGESIZE_2POW 12 +# define QUANTUM_2POW 4 +# define SIZEOF_PTR_2POW 2 +#endif #ifdef __s390x__ # define PAGESIZE_2POW 12 # define QUANTUM_2POW 4 From ingvar at varnish-cache.org Fri Jul 30 13:24:24 2010 From: ingvar at varnish-cache.org (ingvar at varnish-cache.org) Date: Fri, 30 Jul 2010 15:24:24 +0200 Subject: r5059 - trunk/varnish-cache/redhat Message-ID: Author: ingvar Date: 2010-07-30 15:24:24 +0200 (Fri, 30 Jul 2010) New Revision: 5059 Modified: trunk/varnish-cache/redhat/README.redhat Log: Simpler script to build rpm files from trunk Modified: trunk/varnish-cache/redhat/README.redhat =================================================================== --- trunk/varnish-cache/redhat/README.redhat 2010-07-30 12:04:26 UTC (rev 5058) +++ trunk/varnish-cache/redhat/README.redhat 2010-07-30 13:24:24 UTC (rev 5059) @@ -68,14 +68,11 @@ #!/bin/bash VERSION=$( awk ' /^Version:/ { print $2 } ' varnish-cache/redhat/varnish.spec ) -ln -s varnish-cache varnish-$VERSION -tar $( - find varnish-$VERSION/ -type d -name .svn | \ +tar $( find varnish-cache -type d -name .svn | \ while read i; do echo -n "--exclude $i " done -) -cvzf varnish-$VERSION.tar.gz varnish-$VERSION/* -rm varnish-$VERSION +) -cvzf varnish-$VERSION.tar.gz varnish-cache/* rpmbuild -ts varnish-$VERSION.tar.gz # End of script From ingvar at varnish-cache.org Fri Jul 30 13:26:49 2010 From: ingvar at varnish-cache.org (ingvar at varnish-cache.org) Date: Fri, 30 Jul 2010 15:26:49 +0200 Subject: r5060 - trunk/varnish-cache/redhat Message-ID: Author: ingvar Date: 2010-07-30 15:26:48 +0200 (Fri, 30 Jul 2010) New Revision: 5060 Modified: trunk/varnish-cache/redhat/varnish.spec Log: - Synced bits from Fedora - Made to work with trunk again, see specfile changelog Modified: trunk/varnish-cache/redhat/varnish.spec =================================================================== --- trunk/varnish-cache/redhat/varnish.spec 2010-07-30 13:24:24 UTC (rev 5059) +++ trunk/varnish-cache/redhat/varnish.spec 2010-07-30 13:26:48 UTC (rev 5060) @@ -1,7 +1,7 @@ Summary: High-performance HTTP accelerator Name: varnish -Version: 2.1.1 -Release: 0.svn20100415%{?dist} +Version: 2.1.4 +Release: 0.svn20100730%{?dist} License: BSD Group: System Environment/Daemons URL: http://www.varnish-cache.org/ @@ -88,6 +88,12 @@ %build +# No pkgconfig/libpcre.pc in rhel4 +%if 0%{?rhel} == 4 + export PCRE_CFLAGS=`pcre-config --cflags` + export PCRE_LIBS=`pcre-config --libs` +%endif + # Remove "--disable static" if you want to build static libraries # jemalloc is not compatible with Red Hat's ppc* RHEL5 kernel koji server :-( %ifarch ppc64 ppc @@ -99,11 +105,6 @@ %configure --disable-static --localstatedir=/var/lib %endif -# Have to regenerate the docs because of patched doc/changes-2.0.6-2.1.0.xml -pushd doc/ -make clean -popd - # We have to remove rpath - not allowed in Fedora # (This problem only visible on 64 bit arches) sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g; @@ -183,8 +184,8 @@ %{_bindir}/* %{_var}/lib/varnish %{_var}/log/varnish -%{_mandir}/man1/*.1* -%{_mandir}/man7/*.7* +#%{_mandir}/man1/*.1* +#%{_mandir}/man7/*.7* %doc INSTALL LICENSE README redhat/README.redhat ChangeLog %doc examples %doc doc @@ -208,11 +209,7 @@ %{_libdir}/libvarnishcompat.so %{_libdir}/libvcl.so %dir %{_includedir}/varnish -%{_includedir}/varnish/shmlog.h -%{_includedir}/varnish/shmlog_tags.h -%{_includedir}/varnish/stat_field.h -%{_includedir}/varnish/stats.h -%{_includedir}/varnish/varnishapi.h +%{_includedir}/varnish/* %{_libdir}/pkgconfig/varnishapi.pc %doc LICENSE @@ -251,6 +248,25 @@ %postun libs -p /sbin/ldconfig %changelog +* Thu Jul 29 2010 Ingvar Hagelund - 2.1.4-0.svn20100730 +- Replaced specific include files with a wildcard glob +- The man pages seems to have vanished + +* Thu Jul 29 2010 Ingvar Hagelund - 2.1.3-1 +- New upstream release +- Add a patch for jemalloc on s390 that lacks upstream + +* Wed May 05 2010 Ingvar Hagelund - 2.1.2-1 +- New upstream release +- Remove patches merged upstream + +* Tue Apr 27 2010 Ingvar Hagelund - 2.1.1-1 +- New upstream release +- Added a fix for missing pkgconfig/libpcre.pc on rhel4 +- Added a patch from trunk making the rpm buildable on lowspec + build hosts (like Red Hat's ppc build farm nodes) +- Removed patches that are merged upstream + * Wed Apr 14 2010 Ingvar Hagelund - 2.1.0-2 - Added a patch from svn that fixes changes-2.0.6-2.1.0.xml From ingvar at varnish-cache.org Fri Jul 30 23:17:36 2010 From: ingvar at varnish-cache.org (ingvar at varnish-cache.org) Date: Sat, 31 Jul 2010 01:17:36 +0200 Subject: r5061 - trunk/varnish-cache/redhat Message-ID: Author: ingvar Date: 2010-07-31 01:17:36 +0200 (Sat, 31 Jul 2010) New Revision: 5061 Modified: trunk/varnish-cache/redhat/varnish.spec Log: * Thu Jul 29 2010 Ingvar Hagelund - 2.1.4-0.svn20100730 - Replaced specific include files with a wildcard glob - Needs python-sphinx to build sphinx documentation - Builds html and latex documentation. Put that in a subpackage varnish-docs Modified: trunk/varnish-cache/redhat/varnish.spec =================================================================== --- trunk/varnish-cache/redhat/varnish.spec 2010-07-30 13:26:48 UTC (rev 5060) +++ trunk/varnish-cache/redhat/varnish.spec 2010-07-30 23:17:36 UTC (rev 5061) @@ -50,6 +50,14 @@ Development files for %{name}-libs Varnish is a high-performance HTTP accelerator +%package docs +Summary: Documentation files for %name +Group: System Environment/Libraries +BuildRequires: python-sphinx + +%description docs +Documentation files for %name + #%package libs-static #Summary: Files for static linking of %{name} library functions #Group: System Environment/Libraries @@ -131,6 +139,19 @@ redhat/varnish.initrc redhat/varnishlog.initrc redhat/varnishncsa.initrc %endif +# Build html and latex/pdf docs +# Including the sphinx sources may be a good thing for advanced users +pushd doc/sphinx +%{__make} html +%{__make} latex +pushd \=build/latex +# Something is broken in the latex version +for i in `seq 1 53`; do echo -e '\n'; done | %{__make} || true +popd; popd +mv doc/sphinx/\=build/html doc +mv doc/sphinx/\=build/latex/Varnish.pdf doc +rm -rvf doc/sphinx/\=build/* + %check # rhel5 on ppc64 is just too strange %ifarch ppc64 @@ -148,13 +169,9 @@ %endif %endif -LD_LIBRARY_PATH="lib/libvarnish/.libs:lib/libvarnishcompat/.libs:lib/libvarnishapi/.libs:lib/libvcl/.libs" bin/varnishd/varnishd -b 127.0.0.1:80 -C -n /tmp/foo -%{__make} check LD_LIBRARY_PATH="../../lib/libvarnish/.libs:../../lib/libvarnishcompat/.libs:../../lib/libvarnishapi/.libs:../../lib/libvcl/.libs" +#LD_LIBRARY_PATH="lib/libvarnish/.libs:lib/libvarnishcompat/.libs:lib/libvarnishapi/.libs:lib/libvcl/.libs" bin/varnishd/varnishd -b 127.0.0.1:80 -C -n /tmp/foo +#%{__make} check LD_LIBRARY_PATH="../../lib/libvarnish/.libs:../../lib/libvarnishcompat/.libs:../../lib/libvarnishapi/.libs:../../lib/libvcl/.libs" -# Remove uneccessary doc src files -mkdir doc.src -mv doc/*.xml doc/*.xsl doc/Makefile* doc.src - %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} INSTALL="install -p" @@ -184,11 +201,10 @@ %{_bindir}/* %{_var}/lib/varnish %{_var}/log/varnish -#%{_mandir}/man1/*.1* -#%{_mandir}/man7/*.7* -%doc INSTALL LICENSE README redhat/README.redhat ChangeLog +%{_mandir}/man1/*.1* +%{_mandir}/man7/*.7* +%doc INSTALL LICENSE README redhat/README.redhat ChangeLog doc/getting-started.html %doc examples -%doc doc %dir %{_sysconfdir}/varnish/ %config(noreplace) %{_sysconfdir}/varnish/default.vcl %config(noreplace) %{_sysconfdir}/sysconfig/varnish @@ -213,6 +229,12 @@ %{_libdir}/pkgconfig/varnishapi.pc %doc LICENSE +%files docs +%doc LICENSE +%doc doc/Varnish.pdf +%doc doc/sphinx +%doc doc/html + #%files libs-static #%{_libdir}/libvarnish.a #%{_libdir}/libvarnishapi.a @@ -250,7 +272,8 @@ %changelog * Thu Jul 29 2010 Ingvar Hagelund - 2.1.4-0.svn20100730 - Replaced specific include files with a wildcard glob -- The man pages seems to have vanished +- Needs python-sphinx to build sphinx documentation +- Builds html and latex documentation. Put that in a subpackage varnish-docs * Thu Jul 29 2010 Ingvar Hagelund - 2.1.3-1 - New upstream release