From dridi.boukelmoune at gmail.com Mon Feb 1 16:31:08 2021 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Mon, 1 Feb 2021 16:31:08 +0000 (UTC) Subject: [master] c4ec4712f vcl: Make resp.proto read-only Message-ID: <20210201163108.3DFA8115AA5@lists.varnish-cache.org> commit c4ec4712feb7615c6015272fb2b5d01069de4e8b Author: Dridi Boukelmoune Date: Mon Feb 1 17:19:20 2021 +0100 vcl: Make resp.proto read-only One of the VCL 4.1 changes was to make the protocol read-only, which we've successfully done for all variables except resp.proto that kept the exact same definition for both 4.0 and 4.1 versions, despite having distinct definitions. diff --git a/bin/varnishtest/tests/v00001.vtc b/bin/varnishtest/tests/v00001.vtc index 0e9729d49..e31596934 100644 --- a/bin/varnishtest/tests/v00001.vtc +++ b/bin/varnishtest/tests/v00001.vtc @@ -1,5 +1,20 @@ varnishtest "VCL/VRT: url/request/proto/reason/status" +varnish v1 -errvcl "Variable is read only" { + sub vcl_deliver { set req.proto = "HTTP/1.2"; } +} + +varnish v1 -errvcl "Variable is read only" { + sub vcl_deliver { set resp.proto = "HTTP/1.2"; } +} + +varnish v1 -errvcl "Variable is read only" { + sub vcl_backend_response { set bereq.proto = "HTTP/1.2"; } +} + +varnish v1 -errvcl "Variable is read only" { + sub vcl_backend_response { set beresp.proto = "HTTP/1.2"; } +} server s1 { rxreq diff --git a/doc/sphinx/reference/vcl_var.rst b/doc/sphinx/reference/vcl_var.rst index c9fa94df9..fc0d76ef5 100644 --- a/doc/sphinx/reference/vcl_var.rst +++ b/doc/sphinx/reference/vcl_var.rst @@ -1191,8 +1191,6 @@ resp.proto ``VCL >= 4.1`` Readable from: vcl_deliver, vcl_synth - Writable from: vcl_deliver, vcl_synth - The HTTP protocol version to use for the response. resp.status From nils.goroll at uplex.de Mon Feb 1 17:10:08 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 1 Feb 2021 17:10:08 +0000 (UTC) Subject: [master] adfac9453 Slim struct vrt_ctx by 16 bytes on 64bit Message-ID: <20210201171008.92AC2116C43@lists.varnish-cache.org> commit adfac94537004b1b273316e911ca61dfa8960fae Author: Nils Goroll Date: Mon Feb 1 17:03:53 2021 +0100 Slim struct vrt_ctx by 16 bytes on 64bit How 16, you ask? Consider alignment... diff --git a/include/vrt.h b/include/vrt.h index 1fa284921..73840c790 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -310,9 +310,9 @@ struct vrt_ctx { #define VRT_CTX_MAGIC 0x6bb8f0db unsigned syntax; + unsigned vclver; unsigned method; unsigned *handling; - unsigned vclver; /* * msg is for error messages and exists only for From nils.goroll at uplex.de Mon Feb 1 17:10:08 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 1 Feb 2021 17:10:08 +0000 (UTC) Subject: [master] edb0ca986 Teach coccinelle our favourite macros Message-ID: <20210201171008.A5A1A116C46@lists.varnish-cache.org> commit edb0ca9863431dc8ccc6c37e779c179fc29f53cf Author: Nils Goroll Date: Mon Feb 1 18:00:25 2021 +0100 Teach coccinelle our favourite macros It seems they do not parse attributes and how I read --macro-file-builtins they just define them to NIL. diff --git a/tools/coccinelle/README.rst b/tools/coccinelle/README.rst index bf01fc8e3..0c9c06d9e 100644 --- a/tools/coccinelle/README.rst +++ b/tools/coccinelle/README.rst @@ -6,6 +6,8 @@ for both the in-tree code style or out-of-tree VMOD and VUT development. Unless noted otherwise, all patches should work when invoked as:: - spatch -I include/ -I bin/varnishd/ --dir . --in-place --sp-file $COCCI + spatch --macro-file tools/coccinelle/vdef.h \ + -I include/ -I bin/varnishd/ --dir . --in-place \ + --sp-file $COCCI .. _coccinelle: http://coccinelle.lip6.fr/ diff --git a/tools/coccinelle/vdef.h b/tools/coccinelle/vdef.h new file mode 100644 index 000000000..3cd515d79 --- /dev/null +++ b/tools/coccinelle/vdef.h @@ -0,0 +1,6 @@ +#define v_printflike_(f,a) +#define v_deprecated_ +#define v_dont_optimize +#define v_matchproto_(xxx) +#define v_statevariable_(varname) +#define v_unused_ From nils.goroll at uplex.de Mon Feb 1 19:41:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 1 Feb 2021 19:41:07 +0000 (UTC) Subject: [master] 88c596859 assert() for VGC and arm assertions on ctx->method Message-ID: <20210201194107.38C6D11AD8E@lists.varnish-cache.org> commit 88c59685951ea9bedb90e0daf7b2f602c0fa92f2 Author: Nils Goroll Date: Sat Jan 30 17:16:55 2021 +0100 assert() for VGC and arm assertions on ctx->method We wrap VAS_Fail() as VPI_Fail() and add an assert() macro to the Varnish Generated C (VGC) code. This assert() definition is basically a copy of that in vas.h, but deliberately added to a source file which is only used by generate.py for VGC, such that this slightly different definition be only visible to VGC. I also pondered the option to include VCL source information in VPI_Fail: By using the information updated by VPI_count(), we could have that, but as the assert is, for now, intended only to ensure correctness of VCC and core VRT code, I decided against this complication. With assert() in place for VGC, we arm the assertions from 75acb5cc7aa73fcd22b150dd1a3b899c6ec9bc44 diff --git a/bin/varnishd/cache/cache_vpi.c b/bin/varnishd/cache/cache_vpi.c index 06eb802d5..24a3c58b9 100644 --- a/bin/varnishd/cache/cache_vpi.c +++ b/bin/varnishd/cache/cache_vpi.c @@ -133,3 +133,10 @@ VPI_vcl_select(VRT_CTX, VCL_VCL vcl) VSLb(ctx->req->vsl, SLT_VCL_use, "%s via %s", req->vcl->loaded_name, vcl->loaded_name); } + +void v_noreturn_ +VPI_Fail(const char *func, const char *file, int line, + const char *cond) +{ + VAS_Fail(func, file, line, cond, VAS_ASSERT); +} diff --git a/include/Makefile.am b/include/Makefile.am index 818011d3d..25a2c9c8f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -83,6 +83,7 @@ nobase_noinst_HEADERS = \ compat/daemon.h \ vfl.h \ libvcc.h \ + vcc_assert.h \ vcc_interface.h \ vcli_serve.h \ vcs_version.h \ @@ -109,6 +110,7 @@ nobase_noinst_HEADERS = \ ## keep in sync with lib/libvcc/Makefile.am vcl.h: \ $(top_srcdir)/lib/libvcc/generate.py \ + $(top_srcdir)/include/vcc_assert.h \ $(top_srcdir)/include/vcc_interface.h \ $(top_srcdir)/include/vdef.h \ $(top_srcdir)/include/vrt.h \ diff --git a/include/vcc_assert.h b/include/vcc_assert.h new file mode 100644 index 000000000..7e1c7026b --- /dev/null +++ b/include/vcc_assert.h @@ -0,0 +1,6 @@ +#define assert(e) \ +do { \ + if (!(e)) { \ + VPI_Fail(__func__, __FILE__, __LINE__, #e); \ + } \ +} while (0) diff --git a/include/vcc_interface.h b/include/vcc_interface.h index 865c8504e..1d46dc0b0 100644 --- a/include/vcc_interface.h +++ b/include/vcc_interface.h @@ -38,6 +38,8 @@ VCL_VCL VPI_vcl_get(VRT_CTX, const char *); void VPI_vcl_rel(VRT_CTX, VCL_VCL); void VPI_vcl_select(VRT_CTX, VCL_VCL); +void v_noreturn_ VPI_Fail(const char *func, const char *file, int line, + const char *cond); /*********************************************************************** * VPI_count() refers to this structure for coordinates into the VCL source. diff --git a/lib/libvcc/Makefile.am b/lib/libvcc/Makefile.am index 1e3d6f2d0..17a30de39 100644 --- a/lib/libvcc/Makefile.am +++ b/lib/libvcc/Makefile.am @@ -44,6 +44,7 @@ dist_pkgdata_SCRIPTS = \ ## keep in sync with include/Makefile.am vcc_obj.c: \ $(top_srcdir)/lib/libvcc/generate.py \ + $(top_srcdir)/include/vcc_assert.h \ $(top_srcdir)/include/vcc_interface.h \ $(top_srcdir)/include/vdef.h \ $(top_srcdir)/include/vrt.h \ diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py index 823fedc5b..b0668498b 100755 --- a/lib/libvcc/generate.py +++ b/lib/libvcc/generate.py @@ -788,6 +788,7 @@ emit_file(fo, srcroot, "include/vrt.h") emit_file(fo, buildroot, "include/vcl.h") emit_file(fo, buildroot, "include/vrt_obj.h") emit_file(fo, srcroot, "include/vcc_interface.h") +emit_file(fo, srcroot, "include/vcc_assert.h") fo.write("\n}\n") fo.close() diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index 1a2182f41..41277b7f2 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -189,7 +189,7 @@ vcc_EmitProc(struct vcc *tl, struct proc *p) AN(vsbm); vcc_vcl_met2c(vsbm, p->method->bitval); AZ(VSB_finish(vsbm)); - Fc(tl, 1, " // assert(ctx->method == (%s));\n", + Fc(tl, 1, " assert(ctx->method == (%s));\n", VSB_data(vsbm)); VSB_destroy(&vsbm); } From phk at FreeBSD.org Tue Feb 2 08:43:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 2 Feb 2021 08:43:07 +0000 (UTC) Subject: [master] 9570000b0 Whitespace ocd Message-ID: <20210202084307.C00571076C3@lists.varnish-cache.org> commit 9570000b04b47b1a1b3b4161b23b270908ea7d80 Author: Poul-Henning Kamp Date: Tue Feb 2 08:41:36 2021 +0000 Whitespace ocd diff --git a/lib/libvarnish/vav.c b/lib/libvarnish/vav.c index 334f757ef..611ae4ba8 100644 --- a/lib/libvarnish/vav.c +++ b/lib/libvarnish/vav.c @@ -32,7 +32,7 @@ * Parse a command like line into an argv[] * Index zero contains NULL or an error message * (The error message is a static const char* and does not - * need saving or copying.) + * need saving or copying.) * "double quotes" and backslash substitution is handled. * * void VAV_Free(const char **argv) From phk at FreeBSD.org Tue Feb 2 08:43:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 2 Feb 2021 08:43:07 +0000 (UTC) Subject: [master] 0d7466322 VTCP_open should try all possible addresses before giving up. Message-ID: <20210202084307.D0D9F1076C5@lists.varnish-cache.org> commit 0d746632253d038c58110c9f2eeeef19b604556f Author: Poul-Henning Kamp Date: Tue Feb 2 08:41:53 2021 +0000 VTCP_open should try all possible addresses before giving up. Fixes #3509 diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c index e56cd3ba9..4ba37a19e 100644 --- a/lib/libvarnish/vtcp.c +++ b/lib/libvarnish/vtcp.c @@ -51,6 +51,7 @@ #include #include "vdef.h" +#include "miniobj.h" #include "vas.h" #include "vsa.h" #include "vss.h" @@ -371,25 +372,50 @@ VTCP_set_read_timeout(int s, vtim_dur seconds) /*-------------------------------------------------------------------- */ +struct vto_priv { + unsigned magic; +#define VTO_PRIV_MAGIC 0xca70b0e7 + int latest_errno; + int fd; + double timeout; +}; + static int v_matchproto_(vss_resolved_f) vtcp_open_callback(void *priv, const struct suckaddr *sa) { - /* XXX: vtim_dur? */ - double *p = priv; + struct vto_priv *vto; + int fd; - return (VTCP_connect(sa, (int)floor(*p * 1e3))); + CAST_OBJ_NOTNULL(vto, priv, VTO_PRIV_MAGIC); + + errno = 0; + fd = VTCP_connect(sa, (int)floor(vto->timeout * 1e3)); + if (fd > 0) { + vto->fd = fd; + vto->latest_errno = 0; + return (1); + } + vto->latest_errno = errno; + return (0); } int VTCP_open(const char *addr, const char *def_port, vtim_dur timeout, const char **errp) { + struct vto_priv vto[1]; AN(errp); assert(timeout >= 0); + INIT_OBJ(vto, VTO_PRIV_MAGIC); + vto->fd = -1; + vto->timeout = timeout; - return (VSS_resolver(addr, def_port, vtcp_open_callback, - &timeout, errp)); + if (VSS_resolver(addr, def_port, vtcp_open_callback, vto, errp) < 0) + return (-1); + if (vto->fd < 0) + *errp = strerror(vto->latest_errno); + return (vto->fd); } /*-------------------------------------------------------------------- From nils.goroll at uplex.de Tue Feb 2 09:59:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 2 Feb 2021 09:59:07 +0000 (UTC) Subject: [master] 65e682328 Trivial refactor of generate.py Message-ID: <20210202095907.81EFD10968B@lists.varnish-cache.org> commit 65e6823281c21e269088988bbb9013fbe597ea3a Author: Nils Goroll Date: Tue Feb 2 10:44:17 2021 +0100 Trivial refactor of generate.py to split the output formattings from emit_file() from reading the file The produced output lib/libvcc/vcc_fixed_token.c is identical before/after. diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py index b0668498b..94c13c000 100755 --- a/lib/libvcc/generate.py +++ b/lib/libvcc/generate.py @@ -431,21 +431,16 @@ def emit_vcl_tnames(fo, tokens): ####################################################################### -def emit_file(fo, fd, bn): - "Read a C-source file and spit out code that outputs it with VSB_cat()" - fn = join(fd, bn) - - fi = open(fn) - fc = fi.read() - fi.close() +def emit_strings(fo, name, fc): + "spit out code that outputs the fc iterable with VSB_cat()" - w = 66 # Width of lines, after white space prefix + w = 66 # Width of lines, after white space prefix maxlen = 10240 # Max length of string literal x = 0 l = 0 - fo.write("\n\t/* %s */\n\n" % fn) - fo.write('\tVSB_cat(sb, "/* ---===### %s ###===--- */\\n\\n");\n' % bn) + + fo.write('\tVSB_cat(sb, "/* ---===### %s ###===--- */\\n\\n");\n' % name) for c in fc: if l == 0: fo.write("\tVSB_cat(sb, \"") @@ -488,6 +483,18 @@ def emit_file(fo, fd, bn): fo.write("\t);\n") fo.write('\tVSB_cat(sb, "\\n");\n') + +def emit_file(fo, fd, bn): + "Read a C-source file and spit out code that outputs it with VSB_cat()" + fn = join(fd, bn) + + fi = open(fn) + fc = fi.read() + fi.close() + + fo.write("\n\t/* %s */\n\n" % fn) + emit_strings(fo, bn, fc) + ####################################################################### From nils.goroll at uplex.de Tue Feb 2 09:59:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 2 Feb 2021 09:59:07 +0000 (UTC) Subject: [master] 54410f97e inline vcc_assert.h in generate.py Message-ID: <20210202095907.AE29D10968E@lists.varnish-cache.org> commit 54410f97e92caa9458682826871c9503653b268b Author: Nils Goroll Date: Tue Feb 2 10:53:18 2021 +0100 inline vcc_assert.h in generate.py as requested by phk. I found no way to avoid having to escape the backslashes because python, even for uninterpolated ''' long strings, sees them as line continuations. The generated output is identical except for two comments (in the code and the code output by the code). --- ./lib/libvcc/vcc_fixed_token.o.c 2021-02-02 10:40:03.725244373 +0100 +++ ./lib/libvcc/vcc_fixed_token.c 2021-02-02 10:52:04.921259718 +0100 @@ -834,10 +834,7 @@ "uct vre **, const char *);\nvoid VPI_re_fini(struct vre *);\n" ); VSB_cat(sb, "\n"); - - /* ../include/vcc_assert.h */ - - VSB_cat(sb, "/* ---===### include/vcc_assert.h ###===--- */\n\n"); + VSB_cat(sb, "/* ---===### vgc asserts (generate.py) ###===--- */\n\n"); VSB_cat(sb, "#define assert(e)\t\t\t\t\t\t\t\\\ndo {\t\t\t\t" "\t\t\t\t\t\\\n\tif (!(e)) {\t\t\t\t\t\t\t\\\n\t\tVPI_Fail(__func" "__, __FILE__, __LINE__, #e);\t\t\\\n\t}\t\t\t\t\t\t\t\t\\\n" diff --git a/include/Makefile.am b/include/Makefile.am index 25a2c9c8f..818011d3d 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -83,7 +83,6 @@ nobase_noinst_HEADERS = \ compat/daemon.h \ vfl.h \ libvcc.h \ - vcc_assert.h \ vcc_interface.h \ vcli_serve.h \ vcs_version.h \ @@ -110,7 +109,6 @@ nobase_noinst_HEADERS = \ ## keep in sync with lib/libvcc/Makefile.am vcl.h: \ $(top_srcdir)/lib/libvcc/generate.py \ - $(top_srcdir)/include/vcc_assert.h \ $(top_srcdir)/include/vcc_interface.h \ $(top_srcdir)/include/vdef.h \ $(top_srcdir)/include/vrt.h \ diff --git a/include/vcc_assert.h b/include/vcc_assert.h deleted file mode 100644 index 7e1c7026b..000000000 --- a/include/vcc_assert.h +++ /dev/null @@ -1,6 +0,0 @@ -#define assert(e) \ -do { \ - if (!(e)) { \ - VPI_Fail(__func__, __FILE__, __LINE__, #e); \ - } \ -} while (0) diff --git a/lib/libvcc/Makefile.am b/lib/libvcc/Makefile.am index 17a30de39..1e3d6f2d0 100644 --- a/lib/libvcc/Makefile.am +++ b/lib/libvcc/Makefile.am @@ -44,7 +44,6 @@ dist_pkgdata_SCRIPTS = \ ## keep in sync with include/Makefile.am vcc_obj.c: \ $(top_srcdir)/lib/libvcc/generate.py \ - $(top_srcdir)/include/vcc_assert.h \ $(top_srcdir)/include/vcc_interface.h \ $(top_srcdir)/include/vdef.h \ $(top_srcdir)/include/vrt.h \ diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py index 94c13c000..dd614f97f 100755 --- a/lib/libvcc/generate.py +++ b/lib/libvcc/generate.py @@ -795,7 +795,14 @@ emit_file(fo, srcroot, "include/vrt.h") emit_file(fo, buildroot, "include/vcl.h") emit_file(fo, buildroot, "include/vrt_obj.h") emit_file(fo, srcroot, "include/vcc_interface.h") -emit_file(fo, srcroot, "include/vcc_assert.h") +emit_strings(fo, "vgc asserts (generate.py)", +'''#define assert(e) \\ +do { \\ + if (!(e)) { \\ + VPI_Fail(__func__, __FILE__, __LINE__, #e); \\ + } \\ +} while (0) +''') fo.write("\n}\n") fo.close() From nils.goroll at uplex.de Tue Feb 2 12:15:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 2 Feb 2021 12:15:07 +0000 (UTC) Subject: [master] 5f07720a2 Make v1.vtc vcls syntactically correct Message-ID: <20210202121507.D9C8210F05A@lists.varnish-cache.org> commit 5f07720a2760551fca79a9a8abae294b55d26c09 Author: Nils Goroll Date: Tue Feb 2 13:11:42 2021 +0100 Make v1.vtc vcls syntactically correct besides the incorrect bits we want to check for. Ref c4ec4712feb7615c6015272fb2b5d01069de4e8b Exposed by #3163 diff --git a/bin/varnishtest/tests/v00001.vtc b/bin/varnishtest/tests/v00001.vtc index e31596934..1abed8076 100644 --- a/bin/varnishtest/tests/v00001.vtc +++ b/bin/varnishtest/tests/v00001.vtc @@ -1,18 +1,22 @@ varnishtest "VCL/VRT: url/request/proto/reason/status" varnish v1 -errvcl "Variable is read only" { + backend proforma None; sub vcl_deliver { set req.proto = "HTTP/1.2"; } } varnish v1 -errvcl "Variable is read only" { + backend proforma None; sub vcl_deliver { set resp.proto = "HTTP/1.2"; } } varnish v1 -errvcl "Variable is read only" { + backend proforma None; sub vcl_backend_response { set bereq.proto = "HTTP/1.2"; } } varnish v1 -errvcl "Variable is read only" { + backend proforma None; sub vcl_backend_response { set beresp.proto = "HTTP/1.2"; } } From nils.goroll at uplex.de Tue Feb 2 17:33:06 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 2 Feb 2021 17:33:06 +0000 (UTC) Subject: [master] 5a974c753 vcc: teach VCC_SymbolGet() how to be a good partner for life Message-ID: <20210202173307.13E23116F3C@lists.varnish-cache.org> commit 5a974c7537890de8f2542c1f1f66c5d3230eaf36 Author: Nils Goroll Date: Tue Feb 2 18:10:21 2021 +0100 vcc: teach VCC_SymbolGet() how to be a good partner for life In any good relationship, one should be clear about expectations. And VCL authors want to know what VCC wants to hear, so tell them. ;) diff --git a/bin/varnishtest/tests/m00008.vtc b/bin/varnishtest/tests/m00008.vtc index 95ea39af0..1d1696784 100644 --- a/bin/varnishtest/tests/m00008.vtc +++ b/bin/varnishtest/tests/m00008.vtc @@ -2,7 +2,7 @@ varnishtest "VCL compiler vmod coverage / vmod loading" feature topbuild -varnish v1 -errvcl {Symbol 'debug' has wrong type (sub):} { +varnish v1 -errvcl {Symbol 'debug' has wrong type (sub), expected vmod:} { backend b { .host = "${localhost}"; } sub debug {} import debug; diff --git a/bin/varnishtest/tests/v00018.vtc b/bin/varnishtest/tests/v00018.vtc index 7e8b2b827..7e515e967 100644 --- a/bin/varnishtest/tests/v00018.vtc +++ b/bin/varnishtest/tests/v00018.vtc @@ -122,7 +122,7 @@ varnish v1 -errvcl {Not a valid action in subroutine 'vcl_recv'} { } } -varnish v1 -errvcl {Symbol 'vcl_recv' has wrong type (sub):} { +varnish v1 -errvcl {Symbol 'vcl_recv' has wrong type (sub), expected vcl:} { sub vcl_recv { return (vcl(vcl_recv)); } diff --git a/bin/varnishtest/tests/v00020.vtc b/bin/varnishtest/tests/v00020.vtc index 45f9474cd..068135836 100644 --- a/bin/varnishtest/tests/v00020.vtc +++ b/bin/varnishtest/tests/v00020.vtc @@ -360,7 +360,7 @@ varnish v1 -errvcl {'||' must be preceeded by BOOL, found REAL.} { sub vcl_recv { if (std.random(0,1) || 0) { } } } -varnish v1 -errvcl {Symbol 'acl' has wrong type (reserved):} { +varnish v1 -errvcl {Symbol 'acl' has wrong type (reserved), expected sub:} { import std; sub vcl_recv { call acl; } } diff --git a/bin/varnishtest/tests/v00021.vtc b/bin/varnishtest/tests/v00021.vtc index 4c8e8ee26..720ff8ca5 100644 --- a/bin/varnishtest/tests/v00021.vtc +++ b/bin/varnishtest/tests/v00021.vtc @@ -149,7 +149,7 @@ varnish v1 -errvcl {Symbol not found: 'req.foobar'} { sub vcl_recv { set req.foobar = 3; } } -varnish v1 -errvcl {Symbol 'anacl' has wrong type (acl):} { +varnish v1 -errvcl {Symbol 'anacl' has wrong type (acl), expected sub:} { sub vcl_recv { if (client.ip ~ anacl) { } } @@ -162,7 +162,7 @@ varnish v1 -errvcl {Symbols named 'vcl_*' are reserved.} { } } -varnish v1 -errvcl {Symbol 'true' has wrong type (func):} { +varnish v1 -errvcl {Symbol 'true' has wrong type (func), expected acl:} { sub vcl_recv { if (client.ip ~ true) { } } diff --git a/lib/libvcc/vcc_symb.c b/lib/libvcc/vcc_symb.c index 96cce270f..0138c2cf6 100644 --- a/lib/libvcc/vcc_symb.c +++ b/lib/libvcc/vcc_symb.c @@ -338,7 +338,8 @@ VCC_SymbolGet(struct vcc *tl, vcc_ns_t ns, vcc_kind_t kind, VSB_cat(tl->sb, "Symbol '"); for (tn1 = t0; tn1 != tl->t; tn1 = VTAILQ_NEXT(tn1, list)) VSB_printf(tl->sb, "%.*s", PF(tn1)); - VSB_printf(tl->sb, "' has wrong type (%s): ", sym->kind->name); + VSB_printf(tl->sb, "' has wrong type (%s), expected %s:", + sym->kind->name, kind->name); VSB_cat(tl->sb, "\nAt: "); vcc_ErrWhere2(tl, t0, tl->t); if (sym->def_b != NULL) { From phk at FreeBSD.org Wed Feb 3 07:30:11 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 3 Feb 2021 07:30:11 +0000 (UTC) Subject: [master] 5c4ceb7e8 Remove a colon which makes this test fail Message-ID: <20210203073011.0E9201054B1@lists.varnish-cache.org> commit 5c4ceb7e81ee8b28f1286616007aed67b925d85d Author: Poul-Henning Kamp Date: Wed Feb 3 07:29:33 2021 +0000 Remove a colon which makes this test fail diff --git a/bin/varnishtest/tests/v00016.vtc b/bin/varnishtest/tests/v00016.vtc index 250bdd51c..c596e0170 100644 --- a/bin/varnishtest/tests/v00016.vtc +++ b/bin/varnishtest/tests/v00016.vtc @@ -89,7 +89,7 @@ varnish v1 -errvcl {resolves to too many addresses} { } } -varnish v1 -errvcl {Symbol 'foo' has wrong type (instance):} { +varnish v1 -errvcl {Symbol 'foo' has wrong type (instance)} { import directors; backend b { .host = "${localhost}"; } From phk at FreeBSD.org Thu Feb 4 08:04:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 4 Feb 2021 08:04:08 +0000 (UTC) Subject: [master] a0e0b0d26 VRT_acl_log -> VPI_acl_log Message-ID: <20210204080408.81B521056EA@lists.varnish-cache.org> commit a0e0b0d268d6ef912747600b18421349a5065918 Author: Poul-Henning Kamp Date: Thu Feb 4 07:36:43 2021 +0000 VRT_acl_log -> VPI_acl_log diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c index 3e2b67260..9421f529d 100644 --- a/bin/varnishd/cache/cache_vrt.c +++ b/bin/varnishd/cache/cache_vrt.c @@ -101,7 +101,7 @@ VRT_synth(VRT_CTX, VCL_INT code, VCL_STRING reason) /*--------------------------------------------------------------------*/ void -VRT_acl_log(VRT_CTX, const char *msg) +VPI_acl_log(VRT_CTX, const char *msg) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); diff --git a/include/vcc_interface.h b/include/vcc_interface.h index 1d46dc0b0..353cb0d45 100644 --- a/include/vcc_interface.h +++ b/include/vcc_interface.h @@ -69,6 +69,8 @@ struct vrt_acl { const char *name; }; +void VPI_acl_log(VRT_CTX, const char *); + /* vmod object instance info */ struct vpi_ii { const void * p; diff --git a/include/vrt.h b/include/vrt.h index 73840c790..899f8c85a 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -461,7 +461,6 @@ VCL_BACKEND VRT_DirectorResolve(VRT_CTX, VCL_BACKEND); * Implementation details of ACLs */ -void VRT_acl_log(VRT_CTX, const char *); int VRT_acl_match(VRT_CTX, VCL_ACL, VCL_IP); /*********************************************************************** diff --git a/lib/libvcc/vcc_acl.c b/lib/libvcc/vcc_acl.c index 361e900c7..35573eb3f 100644 --- a/lib/libvcc/vcc_acl.c +++ b/lib/libvcc/vcc_acl.c @@ -445,7 +445,7 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon) Fh(tl, 0, "\n"); Fh(tl, 0, "\tfam = VRT_VSA_GetPtr(ctx, p, &a);\n"); Fh(tl, 0, "\tif (fam < 0) {\n"); - Fh(tl, 0, "\t\tVRT_acl_log(ctx, \"NO_FAM %s\");\n", name); + Fh(tl, 0, "\t\tVPI_acl_log(ctx, \"NO_FAM %s\");\n", name); Fh(tl, 0, "\t\treturn(0);\n"); Fh(tl, 0, "\t}\n\n"); if (!tl->err_unref && !anon) { @@ -499,7 +499,7 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon) i = ((int)ae->mask + 7) / 8; if (!anon) { - Fh(tl, 0, "\t%*sVRT_acl_log(ctx, \"%sMATCH %s \" ", + Fh(tl, 0, "\t%*sVPI_acl_log(ctx, \"%sMATCH %s \" ", -i, "", ae->not ? "NEG_" : "", name); t = ae->t_addr; do { @@ -529,7 +529,7 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon) /* Deny by default */ if (!anon) - Fh(tl, 0, "\tVRT_acl_log(ctx, \"NO_MATCH %s\");\n", name); + Fh(tl, 0, "\tVPI_acl_log(ctx, \"NO_MATCH %s\");\n", name); Fh(tl, 0, "\treturn (0);\n}\n"); if (!anon) { From phk at FreeBSD.org Thu Feb 4 08:04:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 4 Feb 2021 08:04:08 +0000 (UTC) Subject: [master] 5e03b60d5 Make generate.py emit struct vrt_type Message-ID: <20210204080408.994501056ED@lists.varnish-cache.org> commit 5e03b60d5fa4f55cec53d99bbfbaee7950ab8174 Author: Poul-Henning Kamp Date: Thu Feb 4 07:41:54 2021 +0000 Make generate.py emit struct vrt_type diff --git a/include/vrt.h b/include/vrt.h index 899f8c85a..5b49c1d5e 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -53,6 +53,8 @@ * binary/load-time compatible, increment MAJOR version * * 13.0 (2021-03-15) + * struct vrt_type now produced by generate.py + * VRT_acl_log() moved to VPI_acl_log() * VRT_Endpoint_Clone() added. * Calling convention for VDP implementation changed * VRT_ValidHdr() added. @@ -286,15 +288,6 @@ typedef vtim_real VCL_TIME; typedef struct vcl * VCL_VCL; typedef void VCL_VOID; -struct vrt_type { - unsigned magic; -#define VRT_TYPE_MAGIC 0xa943bc32 - const char *lname; - const char *uname; - const char *ctype; - size_t szof; -}; - enum lbody_e { LBODY_SET, LBODY_ADD, diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py index dd614f97f..238969bcc 100755 --- a/lib/libvcc/generate.py +++ b/lib/libvcc/generate.py @@ -646,6 +646,17 @@ for i in sorted(rets.keys()): fo.write("\n" + tbl40("#define VCL_RET_MAX", "%d\n" % n)) fo.write("\n/* VCL Types */\n") +fo.write(''' +struct vrt_type { +\tunsigned\t\tmagic; +#define VRT_TYPE_MAGIC\t\t0xa943bc32 +\tconst char\t\t*lname; +\tconst char\t\t*uname; +\tconst char\t\t*ctype; +\tsize_t\t\t\tszof; +}; + +''') for vcltype in sorted(vcltypes.keys()): fo.write("extern const struct vrt_type VCL_TYPE_%s[1];\n" % vcltype) From phk at FreeBSD.org Thu Feb 4 08:04:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 4 Feb 2021 08:04:08 +0000 (UTC) Subject: [master] d58c4baf6 Resort vrt.h into some semblance of semantic order Message-ID: <20210204080408.B48DB1056F0@lists.varnish-cache.org> commit d58c4baf69f7fb6ae0d381b7bd3759ba6c23b12e Author: Poul-Henning Kamp Date: Thu Feb 4 08:02:44 2021 +0000 Resort vrt.h into some semblance of semantic order (While auditing for #2800) diff --git a/include/vrt.h b/include/vrt.h index 5b49c1d5e..61148778e 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -191,7 +191,6 @@ #include // NULL, size_t #include // [u]int%d_t -struct VCL_conf; struct busyobj; struct director; struct http; @@ -199,30 +198,32 @@ struct req; struct stevedore; struct suckaddr; struct vcl; +struct vcldir; +struct VCL_conf; struct vmod; struct vmod_priv; struct vrt_acl; struct vsb; +struct VSC_main; struct vsc_seg; -struct vsmw_cluster; struct vsl_log; +struct vsmw_cluster; struct ws; -struct VSC_main; -/* +/*********************************************************************** * VCL_STRANDS: * - * An argc+argv type of data structure where n indicates the number of strings - * in the p array. Individual components of a strands may be null. + * An argc+argv type of data structure where n indicates the number of + * strings in the p array. Individual components of a strands may be null. * - * A STRANDS allows you to work on a strings concatenation with the option to - * collect it into a single STRING, or if possible work directly on individual - * parts. + * A STRANDS allows you to work on a strings concatenation with the + * option to collect it into a single STRING, or if possible work + * directly on individual parts. * - * The memory management is very strict: a VMOD function receiving a STRANDS - * argument should keep no reference after the function returns. Retention of - * a STRANDS further in the ongoing task is undefined behavior and may result - * in a panic or data corruption. + * The memory management is very strict: a VMOD function receiving a + * STRANDS argument should keep no reference after the function returns. + * Retention of a STRANDS further in the ongoing task is undefined + * behavior and may result in a panic or data corruption. */ struct strands { @@ -230,23 +231,19 @@ struct strands { const char **p; }; -struct strands * VRT_AllocStrandsWS(struct ws *, int); - - -/* +/*********************************************************************** * VCL_BLOB: * - * Opaque, immutable data (pointer + length), minimum lifetime is the VCL task. + * Opaque, immutable data (pointer + length), minimum lifetime is the + * VCL task. * - * Type (optional) is owned by the creator of the blob. blob consumers may use - * it for checks, but should not assert on it. + * Type (optional) is owned by the creator of the blob. blob consumers + * may use it for checks, but should not assert on it. * - * The data behind the blob pointer is assumed to be immutable for the blob's - * lifetime. + * The data behind the blob pointer is assumed to be immutable for the + * blob's lifetime. * - * Memory management is either implicit or up to the vmod: - * - * - memory for shortlived blobs should come from the respective workspace + * - memory for shortlived blobs can be put on the tasks workspace * * - management of memory for longer lived blobs is up to the vmod * (in which case the blob will probably be embedded in an object or @@ -262,7 +259,7 @@ struct vrt_blob { /*********************************************************************** * This is the central definition of the mapping from VCL types to * C-types. The python scripts read these from here. - * (alphabetic order) + * (keep alphabetic order) */ typedef const struct vrt_acl * VCL_ACL; @@ -288,14 +285,9 @@ typedef vtim_real VCL_TIME; typedef struct vcl * VCL_VCL; typedef void VCL_VOID; -enum lbody_e { - LBODY_SET, - LBODY_ADD, -}; - /*********************************************************************** - * This is the composite argument we pass to compiled VCL and VRT - * functions. + * This is the composite "context" argument for compiled VCL, VRT and + * VMOD functions. */ struct vrt_ctx { @@ -339,9 +331,11 @@ struct vrt_ctx { }; #define VRT_CTX const struct vrt_ctx *ctx +void VRT_CTX_Assert(VRT_CTX); /*********************************************************************** * This is the interface structure to a compiled VMOD + * (produced by vmodtool.py) */ struct vmod_data { @@ -360,7 +354,7 @@ struct vmod_data { }; /*********************************************************************** - * Enum for events sent to compiled VCL and from there to Vmods + * VCL events sent to VMODs */ enum vcl_event_e { @@ -370,10 +364,59 @@ enum vcl_event_e { VCL_EVENT_DISCARD, }; -/***********************************************************************/ +typedef int vmod_event_f(VRT_CTX, struct vmod_priv *, enum vcl_event_e); -extern const void * const vrt_magic_string_end; -extern const void * const vrt_magic_string_unset; +/*********************************************************************** + * Utility functions operating on VCL_types + * (alphabetic by type-ish) + */ + +/* VCL_ACL */ +int VRT_acl_match(VRT_CTX, VCL_ACL, VCL_IP); + +/* VCL_BACKEND */ +VCL_BACKEND VRT_DirectorResolve(VRT_CTX, VCL_BACKEND); + +/* VCL_BLOB */ +VCL_BLOB VRT_blob(VRT_CTX, const char *, const void *, size_t, unsigned); + +/* VCL_IP */ +int VRT_VSA_GetPtr(VRT_CTX, VCL_IP sua, const unsigned char ** dst); +VCL_BOOL VRT_ipcmp(VRT_CTX, VCL_IP, VCL_IP); +void VRT_Format_Proxy(struct vsb *, VCL_INT, VCL_IP, VCL_IP, VCL_STRING); + +/* VCL_REGEX */ +VCL_BOOL VRT_re_match(VRT_CTX, VCL_STRING, VCL_REGEX); +VCL_STRING VRT_regsub(VRT_CTX, int all, VCL_STRING, VCL_REGEX, VCL_STRING); + +/* VCL_STEVEDORE */ +VCL_STEVEDORE VRT_stevedore(const char *nm); + +/* VCL_STRANDS */ +struct strands * VRT_AllocStrandsWS(struct ws *, int); +int VRT_CompareStrands(VCL_STRANDS a, VCL_STRANDS b); +VCL_BOOL VRT_Strands2Bool(VCL_STRANDS); +uint32_t VRT_HashStrands32(VCL_STRANDS); +char *VRT_Strands(char *, size_t, VCL_STRANDS); +VCL_STRING VRT_StrandsWS(struct ws *, const char *, VCL_STRANDS); +VCL_STRING VRT_CollectStrands(VRT_CTX, VCL_STRANDS); +VCL_STRING VRT_UpperLowerStrands(VRT_CTX, VCL_STRANDS s, int up); + +/* Functions to turn types into canonical strings */ + +VCL_STRING VRT_BACKEND_string(VCL_BACKEND); +VCL_STRING VRT_BOOL_string(VCL_BOOL); +VCL_STRING VRT_BLOB_string(VRT_CTX, VCL_BLOB); +VCL_STRING VRT_CollectString(VRT_CTX, const char *p, ...); +VCL_STRING VRT_INT_string(VRT_CTX, VCL_INT); +VCL_STRING VRT_IP_string(VRT_CTX, VCL_IP); +VCL_STRING VRT_REAL_string(VRT_CTX, VCL_REAL); +VCL_STRING VRT_STEVEDORE_string(VCL_STEVEDORE); +VCL_STRING VRT_TIME_string(VRT_CTX, VCL_TIME); + +/* historical */ +int VRT_strcmp(const char *s1, const char *s2); +void VRT_memmove(void *dst, const void *src, unsigned len); /*********************************************************************** * We want the VCC to spit this structs out as const, but when VMODs @@ -448,13 +491,14 @@ struct vrt_backend_probe { VRT_BACKEND_PROBE_FIELDS(const) }; -VCL_BACKEND VRT_DirectorResolve(VRT_CTX, VCL_BACKEND); - -/*********************************************************************** - * Implementation details of ACLs - */ +/* Backend related */ +VCL_BACKEND VRT_new_backend(VRT_CTX, const struct vrt_backend *); +VCL_BACKEND VRT_new_backend_clustered(VRT_CTX, + struct vsmw_cluster *, const struct vrt_backend *); +size_t VRT_backend_vsm_need(VRT_CTX); +void VRT_delete_backend(VRT_CTX, VCL_BACKEND *); +struct vrt_endpoint *VRT_Endpoint_Clone(const struct vrt_endpoint *vep); -int VRT_acl_match(VRT_CTX, VCL_ACL, VCL_IP); /*********************************************************************** * Getting hold of the various struct http @@ -481,12 +525,13 @@ VCL_STRING VRT_GetHdr(VRT_CTX, VCL_HEADER); * req related */ -VCL_BYTES VRT_CacheReqBody(VRT_CTX, VCL_BYTES maxsize); +enum lbody_e { + LBODY_SET, + LBODY_ADD, +}; -/* Regexp related */ +VCL_BYTES VRT_CacheReqBody(VRT_CTX, VCL_BYTES maxsize); -VCL_BOOL VRT_re_match(VRT_CTX, VCL_STRING, VCL_REGEX); -VCL_STRING VRT_regsub(VRT_CTX, int all, VCL_STRING, VCL_REGEX, VCL_STRING); VCL_STRING VRT_ban_string(VRT_CTX, VCL_STRING); VCL_INT VRT_purge(VRT_CTX, VCL_DURATION, VCL_DURATION, VCL_DURATION); VCL_VOID VRT_synth(VRT_CTX, VCL_INT, VCL_STRING); @@ -498,30 +543,14 @@ VCL_VOID VRT_handling(VRT_CTX, unsigned hand); VCL_VOID VRT_fail(VRT_CTX, const char *fmt, ...) v_printflike_(2,3); VCL_VOID VRT_hashdata(VRT_CTX, VCL_STRANDS); -/* Simple stuff */ -int VRT_strcmp(const char *s1, const char *s2); -void VRT_memmove(void *dst, const void *src, unsigned len); -VCL_BOOL VRT_ipcmp(VRT_CTX, VCL_IP, VCL_IP); -VCL_BLOB VRT_blob(VRT_CTX, const char *, const void *, size_t, unsigned); - VCL_VOID VRT_Rollback(VRT_CTX, VCL_HTTP); /* Synthetic pages */ VCL_VOID VRT_synth_page(VRT_CTX, VCL_STRANDS); -/* Backend related */ -VCL_BACKEND VRT_new_backend(VRT_CTX, const struct vrt_backend *); -VCL_BACKEND VRT_new_backend_clustered(VRT_CTX, - struct vsmw_cluster *, const struct vrt_backend *); -size_t VRT_backend_vsm_need(VRT_CTX); -void VRT_delete_backend(VRT_CTX, VCL_BACKEND *); -struct vrt_endpoint *VRT_Endpoint_Clone(const struct vrt_endpoint *vep); - -/* VSM related */ -struct vsmw_cluster *VRT_VSM_Cluster_New(VRT_CTX, size_t); -void VRT_VSM_Cluster_Destroy(VRT_CTX, struct vsmw_cluster **); - -/* VDI - Director API */ +/*********************************************************************** + * VDI - Director API + */ typedef VCL_BOOL vdi_healthy_f(VRT_CTX, VCL_BACKEND, VCL_TIME *); typedef VCL_BACKEND vdi_resolve_f(VRT_CTX, VCL_BACKEND); typedef int vdi_gethdrs_f(VRT_CTX, VCL_BACKEND); @@ -549,8 +578,6 @@ struct vdi_methods { vdi_list_f *list; }; -struct vcldir; - struct director { unsigned magic; #define DIRECTOR_MAGIC 0x3336351d @@ -567,14 +594,9 @@ void VRT_DisableDirector(VCL_BACKEND); VCL_BACKEND VRT_LookupDirector(VRT_CTX, VCL_STRING); void VRT_DelDirector(VCL_BACKEND *); -/* Suckaddr related */ -int VRT_VSA_GetPtr(VRT_CTX, VCL_IP sua, const unsigned char ** dst); -/* transitional interface */ -void VRT_Format_Proxy(struct vsb *, VCL_INT, VCL_IP, VCL_IP, VCL_STRING); - -typedef int vmod_event_f(VRT_CTX, struct vmod_priv *, enum vcl_event_e); - -/* vmod_priv related */ +/*********************************************************************** + * vmod_priv related + */ typedef void vmod_priv_fini_f(VRT_CTX, void *); struct vmod_priv_methods { @@ -596,29 +618,12 @@ struct vmod_priv *VRT_priv_task_get(VRT_CTX, const void *vmod_id); struct vmod_priv *VRT_priv_top(VRT_CTX, const void *vmod_id); struct vmod_priv *VRT_priv_top_get(VRT_CTX, const void *vmod_id); -/* Stevedore related functions */ -int VRT_Stv(const char *nm); -VCL_STEVEDORE VRT_stevedore(const char *nm); - -/* Convert things to string */ - -int VRT_CompareStrands(VCL_STRANDS a, VCL_STRANDS b); -VCL_BOOL VRT_Strands2Bool(VCL_STRANDS); -uint32_t VRT_HashStrands32(VCL_STRANDS); -char *VRT_Strands(char *, size_t, VCL_STRANDS); -VCL_STRING VRT_StrandsWS(struct ws *, const char *, VCL_STRANDS); -VCL_STRING VRT_CollectStrands(VRT_CTX, VCL_STRANDS); -VCL_STRING VRT_UpperLowerStrands(VRT_CTX, VCL_STRANDS s, int up); +/*********************************************************************** + * VSM and VSC + */ -VCL_STRING VRT_BACKEND_string(VCL_BACKEND); -VCL_STRING VRT_BOOL_string(VCL_BOOL); -VCL_STRING VRT_BLOB_string(VRT_CTX, VCL_BLOB); -VCL_STRING VRT_CollectString(VRT_CTX, const char *p, ...); -VCL_STRING VRT_INT_string(VRT_CTX, VCL_INT); -VCL_STRING VRT_IP_string(VRT_CTX, VCL_IP); -VCL_STRING VRT_REAL_string(VRT_CTX, VCL_REAL); -VCL_STRING VRT_STEVEDORE_string(VCL_STEVEDORE); -VCL_STRING VRT_TIME_string(VRT_CTX, VCL_TIME); +struct vsmw_cluster *VRT_VSM_Cluster_New(VRT_CTX, size_t); +void VRT_VSM_Cluster_Destroy(VRT_CTX, struct vsmw_cluster **); #ifdef va_start // XXX: hackish void *VRT_VSC_Alloc(struct vsmw_cluster *, struct vsc_seg **, @@ -629,9 +634,7 @@ void VRT_VSC_Hide(const struct vsc_seg *); void VRT_VSC_Reveal(const struct vsc_seg *); size_t VRT_VSC_Overhead(size_t); -void VRT_CTX_Assert(VRT_CTX); - -/* +/*********************************************************************** * API to restrict the VCL in various ways */ @@ -641,3 +644,11 @@ void VRT_VCL_Allow_Cold(struct vclref **); struct vclref * VRT_VCL_Prevent_Discard(VRT_CTX, const char *); void VRT_VCL_Allow_Discard(struct vclref **); + +/*********************************************************************** + * Deprecated interfaces, do not use + */ + +extern const void * const vrt_magic_string_end; +extern const void * const vrt_magic_string_unset; +int VRT_Stv(const char *nm); From phk at FreeBSD.org Thu Feb 4 08:34:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 4 Feb 2021 08:34:07 +0000 (UTC) Subject: [master] 4127a37a0 Add VRT_synth_blob(). Rename VRT_synth_page() to VRT_synth_strands() Message-ID: <20210204083407.A8C0E1065F7@lists.varnish-cache.org> commit 4127a37a0fc6a77758439dcbd992ca4d18159dfd Author: Poul-Henning Kamp Date: Thu Feb 4 08:32:32 2021 +0000 Add VRT_synth_blob(). Rename VRT_synth_page() to VRT_synth_strands() (VRT_synth_page() still works, but is now deprecated.) diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c index 9421f529d..aab4b72e9 100644 --- a/bin/varnishd/cache/cache_vrt.c +++ b/bin/varnishd/cache/cache_vrt.c @@ -817,7 +817,7 @@ VRT_Rollback(VRT_CTX, VCL_HTTP hp) /*--------------------------------------------------------------------*/ VCL_VOID -VRT_synth_page(VRT_CTX, VCL_STRANDS s) +VRT_synth_strands(VRT_CTX, VCL_STRANDS s) { struct vsb *vsb; int i; @@ -832,6 +832,22 @@ VRT_synth_page(VRT_CTX, VCL_STRANDS s) } } +VCL_VOID +VRT_synth_blob(VRT_CTX, VCL_BLOB b) +{ + struct vsb *vsb; + CAST_OBJ_NOTNULL(vsb, ctx->specific, VSB_MAGIC); + + if (b->len > 0 && b->blob != NULL) + VSB_bcat(vsb, b->blob, b->len); +} + +VCL_VOID +VRT_synth_page(VRT_CTX, VCL_STRANDS s) +{ + VRT_synth_strands(ctx, s); +} + /*--------------------------------------------------------------------*/ static VCL_STRING diff --git a/include/vrt.h b/include/vrt.h index 61148778e..b882b1136 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -53,6 +53,8 @@ * binary/load-time compatible, increment MAJOR version * * 13.0 (2021-03-15) + * Move VRT_synth_page() to deprecated status + * Add VRT_synth_strands() and VRT_synth_blob() * struct vrt_type now produced by generate.py * VRT_acl_log() moved to VPI_acl_log() * VRT_Endpoint_Clone() added. @@ -546,7 +548,8 @@ VCL_VOID VRT_hashdata(VRT_CTX, VCL_STRANDS); VCL_VOID VRT_Rollback(VRT_CTX, VCL_HTTP); /* Synthetic pages */ -VCL_VOID VRT_synth_page(VRT_CTX, VCL_STRANDS); +VCL_VOID VRT_synth_strands(VRT_CTX, VCL_STRANDS); +VCL_VOID VRT_synth_blob(VRT_CTX, VCL_BLOB); /*********************************************************************** * VDI - Director API @@ -646,9 +649,10 @@ struct vclref * VRT_VCL_Prevent_Discard(VRT_CTX, const char *); void VRT_VCL_Allow_Discard(struct vclref **); /*********************************************************************** - * Deprecated interfaces, do not use + * Deprecated interfaces, do not use, they will disappear at some point. */ +VCL_VOID VRT_synth_page(VRT_CTX, VCL_STRANDS); extern const void * const vrt_magic_string_end; extern const void * const vrt_magic_string_unset; int VRT_Stv(const char *nm); diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index eed78708a..10ee8e4c5 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -387,7 +387,7 @@ vcc_act_synthetic(struct vcc *tl, struct token *t, struct symbol *sym) ERRCHK(tl); vcc_NextToken(tl); - Fb(tl, 1, "VRT_synth_page(ctx, "); + Fb(tl, 1, "VRT_synth_strands(ctx, "); vcc_Expr(tl, STRANDS); ERRCHK(tl); Fb(tl, 1, ");\n"); From phk at FreeBSD.org Thu Feb 4 08:39:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 4 Feb 2021 08:39:06 +0000 (UTC) Subject: [master] 1537c213b Quench a flexelint warning. Message-ID: <20210204083907.020FE106918@lists.varnish-cache.org> commit 1537c213b89abb39c5d332a5508b0e2d349e73a3 Author: Poul-Henning Kamp Date: Thu Feb 4 08:38:10 2021 +0000 Quench a flexelint warning. diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index 41277b7f2..cc3803d6b 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -79,6 +79,7 @@ vcc_vcl_met2c(struct vsb *vsb, unsigned method) { int d = 0; + //lint -e{774} Boolean within 'if' always evaluates to False #define VCL_MET_MAC(l,U,t,b) \ if (method & VCL_MET_##U) { \ if (d) \ From phk at FreeBSD.org Mon Feb 8 09:03:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 8 Feb 2021 09:03:08 +0000 (UTC) Subject: [master] b9d8f84be Make it clear to Coverity what's going on. Message-ID: <20210208090308.623D5105358@lists.varnish-cache.org> commit b9d8f84be5dff170e88702b1adaf6dca3d36f424 Author: Poul-Henning Kamp Date: Mon Feb 8 09:01:24 2021 +0000 Make it clear to Coverity what's going on. (If it wasnt because vtcp has spread to other code I would assert that the fd is larger than stderr.) diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c index 4ba37a19e..1c4996b21 100644 --- a/lib/libvarnish/vtcp.c +++ b/lib/libvarnish/vtcp.c @@ -390,7 +390,7 @@ vtcp_open_callback(void *priv, const struct suckaddr *sa) errno = 0; fd = VTCP_connect(sa, (int)floor(vto->timeout * 1e3)); - if (fd > 0) { + if (fd >= 0) { vto->fd = fd; vto->latest_errno = 0; return (1); From phk at FreeBSD.org Mon Feb 8 10:39:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 8 Feb 2021 10:39:06 +0000 (UTC) Subject: [master] f127a1190 Sort the reference manual index page Message-ID: <20210208103906.A4D781079CE@lists.varnish-cache.org> commit f127a11909436f788d006ab9def06f1c1fe92b20 Author: Poul-Henning Kamp Date: Mon Feb 8 10:37:56 2021 +0000 Sort the reference manual index page diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst index 934cbc02f..8ffdc2fdf 100644 --- a/doc/sphinx/reference/index.rst +++ b/doc/sphinx/reference/index.rst @@ -4,21 +4,22 @@ The Varnish Reference Manual %%%%%%%%%%%%%%%%%%%%%%%%%%%% +The VCL language +---------------- + .. toctree:: - :maxdepth: 2 + :maxdepth: 1 - vcl.rst + VCL - Varnish Configuration Language states.rst - varnish-cli.rst - varnishadm.rst - varnishd.rst - varnishhist.rst - varnishlog.rst - varnishncsa.rst - varnishstat.rst - varnishtest.rst - varnishtop.rst - vsm.rst + vmod.rst + +Bundled VMODs +------------- + +.. toctree:: + :maxdepth: 1 + vmod_blob.rst vmod_cookie.rst vmod_directors.rst @@ -26,50 +27,77 @@ The Varnish Reference Manual vmod_purge.rst vmod_std.rst vmod_unix.rst + +The CLI interface +----------------- + +.. toctree:: + :maxdepth: 1 + + VarnishAdm - Control program for Varnish + VCLI - The commands varnish understands + +Logging and monitoring +---------------------- + +.. toctree:: + :maxdepth: 1 + + VSL - The log records Varnish generates + VSLQ - Filter/Query expressions for VSL + VarnishLog - Logging raw VSL + VarnishNCSA - Logging in NCSA format + VarnishHist - Realtime reponse histogram display + VarnishTop - Realtime activity display + +Counters and statistics +----------------------- + +.. toctree:: + :maxdepth: 1 + + VSC - The statistics Varnish collects + VarnishStat - Watching and logging statistics + +The Varnishd program +-------------------- + +.. toctree:: + :maxdepth: 1 + + VarnishD - The program which does the actual work + +Varnishtest +----------- + +.. toctree:: + :maxdepth: 1 + + VTC - Language for writing test cases + VarnishTest - execute test cases vmod_vtc.rst - vmod.rst - directors.rst - varnish-counters.rst - vsl.rst - vsl-query.rst - vtc.rst - vtla.rst -.. vmod_debug left out deliberately ? - -.. todo:: - The programs: - . varnishd manual page - . varnishstat - . - counters explained - . common filtering options for shmlog tools - . varnishlog .. - . varnishtop .. - . varnishncsa .. - . varnishhist .. - The CLI: - . connections: -T -S -M - . varnishadm - . CLI commands and what they do - . - vcl.load - . - stop - . - start - . - ... - VCL language - . The subroutines: - . - vcl_recv - . - vcl_miss - . --- - . The things you can do - . - set - . - unset - . - esi - . - rollback - Varnishtest - . syntax etc. - Shared Memory - . internals - . Log records - Libvarnishapi - . function descriptions +For Developers +-------------- + +.. toctree:: + :maxdepth: 1 + VSM - Shared memory use + VDIR - Backends & Directors + +.. Vmod_debug ? + +.. Libvarnishapi + +.. VRT + +.. VRT compat levels + +Code-book +--------- + +.. toctree:: + :maxdepth: 1 + + vtla.rst From phk at FreeBSD.org Mon Feb 8 10:44:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 8 Feb 2021 10:44:06 +0000 (UTC) Subject: [master] c796c8adf Update bugwash hours to current schedule Message-ID: <20210208104406.A218D107D1D@lists.varnish-cache.org> commit c796c8adf3a2adead0f7a426c445392831cdc04c Author: Poul-Henning Kamp Date: Mon Feb 8 10:42:54 2021 +0000 Update bugwash hours to current schedule diff --git a/doc/sphinx/dev-guide/index.rst b/doc/sphinx/dev-guide/index.rst index 85bfbea7d..192ec689a 100644 --- a/doc/sphinx/dev-guide/index.rst +++ b/doc/sphinx/dev-guide/index.rst @@ -48,8 +48,8 @@ Bugs, issues, feature requests & VIPs Bugs, issues and feature requests start out as github issues. -Monday at 13:00-14:00 (EU time) we "bug-wash" on IRC to -decide who and how issues are dealt with. +Monday at 15:00-16:00 (EU time) we "bug-wash" on IRC (#varnish-hacking +on irc.linpro.no) to decide who and how issues are dealt with. Issues we cannot do anything about are closed. From phk at FreeBSD.org Mon Feb 8 13:58:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 8 Feb 2021 13:58:07 +0000 (UTC) Subject: [master] 5d0f4e1bc The VMOD document is aimed at developers Message-ID: <20210208135807.2055710EC46@lists.varnish-cache.org> commit 5d0f4e1bc379178c8559b3416cc877141b524aee Author: Poul-Henning Kamp Date: Mon Feb 8 11:52:58 2021 +0000 The VMOD document is aimed at developers diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst index 8ffdc2fdf..5cda7e77a 100644 --- a/doc/sphinx/reference/index.rst +++ b/doc/sphinx/reference/index.rst @@ -12,7 +12,6 @@ The VCL language VCL - Varnish Configuration Language states.rst - vmod.rst Bundled VMODs ------------- @@ -83,7 +82,8 @@ For Developers .. toctree:: :maxdepth: 1 - VSM - Shared memory use + VMODS - Extensions to VCL + VSM - Shared memory use VDIR - Backends & Directors .. Vmod_debug ? From phk at FreeBSD.org Mon Feb 8 13:58:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 8 Feb 2021 13:58:07 +0000 (UTC) Subject: [master] 44eb6b0e1 Rewrite the Tutorial introduction Message-ID: <20210208135807.3B9A410EC49@lists.varnish-cache.org> commit 44eb6b0e10e74c1d7c5a57f94bf6c406bd691810 Author: Poul-Henning Kamp Date: Mon Feb 8 13:57:06 2021 +0000 Rewrite the Tutorial introduction diff --git a/doc/sphinx/tutorial/introduction.rst b/doc/sphinx/tutorial/introduction.rst index 237ff1c12..067a7f834 100644 --- a/doc/sphinx/tutorial/introduction.rst +++ b/doc/sphinx/tutorial/introduction.rst @@ -1,55 +1,171 @@ .. _tutorial-intro: -The fundamentals of web proxy caching with Varnish --------------------------------------------------- +Varnish: The beef in the sandwich +--------------------------------- -Varnish is a caching HTTP reverse proxy. It receives requests from clients -and tries to answer them from the cache. If Varnish cannot answer the -request from the cache it will forward the request to the backend, -fetch the response, store it in the cache and deliver it to the client. +You may have heard the term "web-delivery-sandwich" used in relation to +Varnish, and it is a pretty apt metafor:: -When Varnish has a cached response ready it is typically delivered in a -matter of microseconds, two orders of magnitude faster than your typical -backend server, so you want to make sure to have Varnish answer as many -of the requests as possible directly from the cache. -Varnish decides whether it can store the content or not based on the -response it gets back from the backend. The backend can instruct Varnish -to cache the content with the HTTP response header `Cache-Control`. There -are a few conditions where Varnish will not cache, the most common one -being the use of cookies. Since cookies indicates a client-specific web -object, Varnish will by default not cache it. + ??????????? + ? browser ? + ??????????? ??????????? + \ ???????????? + ??????? ??????????? ??????? ??????????? ????????????? + ? app ? --- ? Network ? -- ? TLS ? -- ? Varnish ? -- ? Backend ?? + ??????? ??????????? ??????? ??????????? ??????????? + / + ?????????????? + ? API-client ? + ?????????????? -This behaviour as most of Varnish functionality can be changed using -policies written in the Varnish Configuration Language (VCL). See -:ref:`users-guide-index` for more information on how to do that. +The top layer of the sandwich, 'TLS' is responsible for handling +the TLS ("https") encryption, which means it must have access to +the cryptographic certificate which authenticates your website. -Performance -~~~~~~~~~~~ +The bottom layer of the sandwich are your webservers, CDNs, +API-servers, business backend systems and all the other sources for +your web-content. -Varnish has a modern architecture and is written with performance -in mind. It is usually bound by the speed of the network, effectively -turning performance into a non-issue. You get to focus on how your web -applications work and you can allow yourself, to some degree, to care -less about performance and scalability. +Varnish goes in the middle, where it provides caching, policy, +analytics, visibility and mitigation for your webtraffic. -.. XXX:Not totally sure what the last sentence above means. benc +How Varnish works +----------------- -Flexibility -~~~~~~~~~~~ +For each and every request, Varnish runs through the 'VCL' program +to decide what should happen: Which backend has this content, how +long time can we cache it, is it accessible for this request, should +it be redirected elsewhere and so on. If that particular backend +is down, varnish can find another or substitute different content +until it comes back up. -One of the key features of Varnish Cache, in addition to its performance, -is the flexibility of its configuration language, VCL. VCL enables you -to write policies on how incoming requests should be handled. +Your first VCL program will probably be trivial, for instance just +splitting the traffic between two different backend servers:: -In such a policy you can decide what content you want to serve, from -where you want to get the content and how the request or response should -be altered. + sub vcl_recv { + if (req.url ~ "^/wiki") { + set req.backend_hint = wiki_server; + } else { + set req.backend_hint = wordpress_server; + } + } -Supported platforms +When you load the VCL program into Varnish, it is compiled into +a C-program which is compiled into a shared library, which varnish +then loads and calls into, therefore VCL code is *fast*. + +Everything Varnish does is recorded in 'VSL' log records which can +be examined and monitored in real time or recorded for later use +in native or NCSA format, and when we say 'everything' we mean +*everything*:: + + * << Request >> 318737 + - Begin req 318736 rxreq + - Timestamp Start: 1612787907.221931 0.000000 0.000000 + - Timestamp Req: 1612787907.221931 0.000000 0.000000 + - VCL_use boot + - ReqStart 192.0.2.24 39698 a1 + - ReqMethod GET + - ReqURL /vmods/ + - ReqProtocol HTTP/1.1 + - ReqHeader Host: varnish-cache.org + - ReqHeader Accept: text/html, application/rss+xml, [?] + - ReqHeader Accept-Encoding: gzip,deflate + - ReqHeader Connection: close + - ReqHeader User-Agent: Mozilla/5.0 [?] + - ReqHeader X-Forwarded-For: 192.0.2.24 + - VCL_call RECV + - VCL_acl NO_MATCH bad_guys + - VCL_return hash + [?] + +These `VSL` log records are written to a circular buffer in shared +memory, from where other programs can subscribe to them via a supported +API. One such program is `varnishncsa` which produces NCSA-style log +records:: + + 192.0.2.24 - - [08/Feb/2021:12:42:35 +0000] "GET http://vmods/ HTTP/1.1" 200 0 [?] + +Varnish is also engineered for uptime, it is not necessary to restart +varnish to change the VCL program, in fact, multiple VCL programs can be +loaded at the same time and you can switch between them instantly. + +Caching with Varnish -------------------- -Varnish is written to run on modern versions of Linux and FreeBSD and the -best experience is had on those platforms. Thanks to our contributors -it also runs on NetBSD, OpenBSD, OS X and various Solaris-descendants -like Oracle Solaris, OmniOS and SmartOS. +When Varnish receives a request, VCL can decide to look for a +reusable answer in the cache, if there is one, that becomes one +less request to put load on your backend applications database. +Cache-hits take less than a millisecond, often mere microseconds, +to deliver. + +If there is nothing usable in the cache, the answer from the backend +can, again under VCL control, be put in the cache for some amount +of time, so future requests for the same object can find it there. + +Varnish understands the `Cache-Control` HTTP header if your backend +server sends one, but ultimately the VCL program makes the decision +to cache and how long, and if you want to send a different `Cache-Control` +header to the clients, VCL can do that too. + +Content Composition with Varnish +-------------------------------- + +Varnish supports `ESI - Edge Side Includes` which makes it possible +to send responses to clients which are composed of different bits +from different backends, with the very important footnote that the +different bits can have very different caching policies. + +With ESI a backend can tell varnish to edit the content of another +object into a HTML page:: + +

Todays Top News

+ + +The `/topnews` request will be handled like every other request in +Varnish, VCL will decide if it can be cached, which backend should +supply it and so on, so even if the whole object in the example can +not be cached, for instance if the page is dynamic content for a +logged-in user, the `/topnews` object can be cached and can be +shared from the cache, between all users. + +Content Policy with Varnish +--------------------------- + +Because VCL is in full control of every request, and because VCL +can be changed instantly on the fly, Varnish is a great tool to +implement both reactive and prescriptive content-policies. + +Prescriptive content-policies can be everything from complying +with UN sanctions using IP number access lists over delivering +native language content to different clients to closing +access to employee web-mail in compliance with "Right to +disconnect" laws. + +Varnish, and VCL is particular, are well suited to sort requests +and collect metrics for real-time A/B testing or during migrations +to a new backend system. + +Reactive content-policies can be anything from blocking access to +an infected backend or fixing the URL from the QR code on the new +product, to extending caching times while the backend rebuilds the +database. + +Varnish is general purpose +-------------------------- + +Varnish is written to run on modern UNIX-like operating systems: +Linux, FreeBSD, OS/X, OpenBSD, NetBSD, Solaris, OmniOs, SmartOS etc. + +Varnish runs on any CPU architecture: i386, amd64, arm32, arm64, +mips, power, riscV, s390 - you name it. + +Varnish can be deployed on dedicated hardware, in VMs, jails, +Containers, Cloud, as a service or any other way you may care for. + +Unfortunately the `sudo make me a sandwich`_ feature is not ready yet, +so you will have to do that yourself but click on "Next topic" in the +navigation menu on the left and we'll tell you the recipe... + +.. _sudo make me a sandwich: https://xkcd.com/149/ From nils.goroll at uplex.de Mon Feb 8 16:37:06 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 16:37:06 +0000 (UTC) Subject: [call_SUB] 648675358 SQUASHME: treat SYM_METHOD like SYM_FUNC Message-ID: <20210208163706.D5631112CC7@lists.varnish-cache.org> commit 648675358b7e9a4e577f27c26720b529b0df605e Author: Nils Goroll Date: Mon Feb 8 17:35:17 2021 +0100 SQUASHME: treat SYM_METHOD like SYM_FUNC Spotted by @Dridi diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index b1a593183..96651dcbf 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -52,8 +52,8 @@ vcc_act_call(struct vcc *tl, struct token *t, struct symbol *sym) t0 = tl->t; sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_NONE, SYMTAB_NOERR, XREF_NONE); tl->t = t0; - // only SYM_FUNC may evaluate to SUB - if (sym != NULL && sym->kind == SYM_FUNC) { + // only functions/methods may evaluate to SUB + if (sym != NULL && (sym->kind == SYM_FUNC || sym->kind == SYM_METHOD)) { u = tl->unique++; Fb(tl, 1, "{\n"); From nils.goroll at uplex.de Mon Feb 8 16:39:48 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:39:48 +0100 Subject: [call_SUB] 648675358 SQUASHME: treat SYM_METHOD like SYM_FUNC In-Reply-To: <20210208163706.D5631112CC7@lists.varnish-cache.org> References: <20210208163706.D5631112CC7@lists.varnish-cache.org> Message-ID: I did it again. Sorry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From nils.goroll at uplex.de Mon Feb 8 17:52:03 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:03 +0000 (UTC) Subject: [master] 3192a79ad vcc: link procs to their symbol Message-ID: <20210208175203.6C4C1114F86@lists.varnish-cache.org> commit 3192a79ad8f1680f6e55f65424148ed5a3d1d0ad Author: Nils Goroll Date: Fri Jan 29 14:33:24 2021 +0100 vcc: link procs to their symbol diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index cc3803d6b..4d728d7d7 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -161,6 +161,7 @@ vcc_NewProc(struct vcc *tl, struct symbol *sym) p->cname = VSB_new_auto(); AN(p->cname); sym->proc = p; + p->sym = sym; return (p); } diff --git a/lib/libvcc/vcc_compile.h b/lib/libvcc/vcc_compile.h index d4b1ea8db..47d0fdd62 100644 --- a/lib/libvcc/vcc_compile.h +++ b/lib/libvcc/vcc_compile.h @@ -215,6 +215,7 @@ struct proc { struct vsb *cname; struct vsb *prologue; struct vsb *body; + struct symbol *sym; }; struct inifin { From nils.goroll at uplex.de Mon Feb 8 17:52:03 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:03 +0000 (UTC) Subject: [master] bba4b145d vcc: Expand SUB type, add possible calling methods Message-ID: <20210208175203.82775114F89@lists.varnish-cache.org> commit bba4b145df403f12731a8670cbdd1d38555fad19 Author: Nils Goroll Date: Tue Dec 17 14:06:26 2019 +0100 vcc: Expand SUB type, add possible calling methods Until now, the VCC SUB type represented the literal name of a vcc-generated C function, which was used to expand the VCL "call" action. We now add a struct to describe VCL subs and calculate a bitmask which represents the bilt-in subs which a SUB may be called from (the "okmask"), This is in preparation of the goal to add a VCL_SUB vmod type which will allow VMODs to call into vcl subs. We add to the vcl shared object a struct vcl_sub for each sub, which contains: - a methods bitmask defining which built-in subs this sub may be called from (directly or indirectly) - the name as seen from vcl - a pointer back to the VCL_conf - the function pointer to the vcl_func_f - a unique number About the methods bitmask: It contains the VCL_MET_* bits of of built-in subs (traditionally called methods) which are allowed to call this sub. It is intended for checks like if (sub->methods & ctx->method) { sub->func(ctx); return; } else { VRT_fail(ctx, "not allowed here"); return; } In existing compile-time calls, we already check if used objects and returned actions are allowed within the respective calling context. To build the methods bitmask, we begin with a VCL_MET_TASK_ALL bitfield and clear the bits of methods which would not be allowed for any used object or returned action. About the VCL_conf pointer: Each VCL SUB belongs to a VCL, this pointer will allow to check that it is only ever used from the right VCL. About the unique number: By numbering vcl subs (per VCL), we can later implement a recursion check using a bitmask. In struct VCL_conf, we record the total number of subs. diff --git a/include/vcc_interface.h b/include/vcc_interface.h index 353cb0d45..32f09b970 100644 --- a/include/vcc_interface.h +++ b/include/vcc_interface.h @@ -81,3 +81,15 @@ struct vpi_ii { void VPI_re_init(struct vre **, const char *); void VPI_re_fini(struct vre *); + +/* VCL_SUB type */ + +struct vcl_sub { + unsigned magic; +#define VCL_SUB_MAGIC 0x12c1750b + const unsigned methods; // ok &= ctx->method + const char * const name; + const struct VCL_conf *vcl_conf; + vcl_func_f *func; + unsigned n; +}; diff --git a/include/vrt.h b/include/vrt.h index b882b1136..1b0765454 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -211,6 +211,7 @@ struct vsc_seg; struct vsl_log; struct vsmw_cluster; struct ws; +struct vcl_sub; /*********************************************************************** * VCL_STRANDS: @@ -283,6 +284,7 @@ typedef const struct vre * VCL_REGEX; typedef const struct stevedore * VCL_STEVEDORE; typedef const struct strands * VCL_STRANDS; typedef const char * VCL_STRING; +typedef const struct vcl_sub * VCL_SUB; typedef vtim_real VCL_TIME; typedef struct vcl * VCL_VCL; typedef void VCL_VOID; @@ -335,6 +337,8 @@ struct vrt_ctx { #define VRT_CTX const struct vrt_ctx *ctx void VRT_CTX_Assert(VRT_CTX); +typedef void vcl_func_f(VRT_CTX); + /*********************************************************************** * This is the interface structure to a compiled VMOD * (produced by vmodtool.py) diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py index 238969bcc..1b23b6282 100755 --- a/lib/libvcc/generate.py +++ b/lib/libvcc/generate.py @@ -666,7 +666,6 @@ fo.write(""" typedef int vcl_event_f(VRT_CTX, enum vcl_event_e); typedef int vcl_init_f(VRT_CTX); typedef void vcl_fini_f(VRT_CTX); -typedef void vcl_func_f(VRT_CTX); struct VCL_conf { unsigned magic; @@ -679,6 +678,7 @@ struct VCL_conf { const struct vpi_ref *ref; int nsrc; + unsigned nsub; const char **srcname; const char **srcbody; diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index 10ee8e4c5..ec263fd8e 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -315,7 +315,7 @@ vcc_act_return_vcl(struct vcc *tl) static void v_matchproto_(sym_act_f) vcc_act_return(struct vcc *tl, struct token *t, struct symbol *sym) { - unsigned hand; + unsigned hand, mask; const char *h; (void)t; @@ -335,6 +335,7 @@ vcc_act_return(struct vcc *tl, struct token *t, struct symbol *sym) if (vcc_IdIs(tl->t, #l)) { \ hand = VCL_RET_ ## U; \ h = #U; \ + mask = B; \ } #include "tbl/vcl_returns.h" if (h == NULL) { @@ -344,7 +345,7 @@ vcc_act_return(struct vcc *tl, struct token *t, struct symbol *sym) } assert(hand < VCL_RET_MAX); - vcc_ProcAction(tl->curproc, hand, tl->t); + vcc_ProcAction(tl->curproc, hand, mask, tl->t); vcc_NextToken(tl); if (tl->t->tok == '(') { if (hand == VCL_RET_SYNTH || hand == VCL_RET_ERROR) diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index 4d728d7d7..d4dfa0601 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -59,6 +59,7 @@ #include #include #include +#include #include "vcc_compile.h" @@ -160,6 +161,7 @@ vcc_NewProc(struct vcc *tl, struct symbol *sym) AN(p->body); p->cname = VSB_new_auto(); AN(p->cname); + p->okmask = VCL_MET_TASK_ALL; sym->proc = p; p->sym = sym; return (p); @@ -170,11 +172,21 @@ vcc_EmitProc(struct vcc *tl, struct proc *p) { struct vsb *vsbm; + AN(p->okmask); AZ(VSB_finish(p->cname)); AZ(VSB_finish(p->prologue)); AZ(VSB_finish(p->body)); Fh(tl, 1, "vcl_func_f %s;\n", VSB_data(p->cname)); + Fh(tl, 1, "const struct vcl_sub sub_%s[1] = {{\n", + VSB_data(p->cname)); + Fh(tl, 1, "\t.magic\t\t= VCL_SUB_MAGIC,\n"); + Fh(tl, 1, "\t.methods\t= 0x%x,\n", p->okmask); + Fh(tl, 1, "\t.name\t\t= \"%.*s\",\n", PF(p->name)); + Fh(tl, 1, "\t.vcl_conf\t= &VCL_conf,\n"); + Fh(tl, 1, "\t.func\t\t= %s,\n", VSB_data(p->cname)); + Fh(tl, 1, "\t.n\t\t= %d\n", tl->nsub++); + Fh(tl, 1, "}};\n"); /* * TODO: v_dont_optimize for custom subs called from vcl_init/fini only * @@ -526,6 +538,7 @@ EmitStruct(const struct vcc *tl) Fc(tl, 0, "\t.ref = VGC_ref,\n"); Fc(tl, 0, "\t.nref = VGC_NREFS,\n"); Fc(tl, 0, "\t.nsrc = VGC_NSRCS,\n"); + Fc(tl, 0, "\t.nsub = %d,\n", tl->nsub); Fc(tl, 0, "\t.srcname = srcname,\n"); Fc(tl, 0, "\t.srcbody = srcbody,\n"); Fc(tl, 0, "\t.nvmod = %u,\n", tl->vmod_count); diff --git a/lib/libvcc/vcc_compile.h b/lib/libvcc/vcc_compile.h index 47d0fdd62..814414c66 100644 --- a/lib/libvcc/vcc_compile.h +++ b/lib/libvcc/vcc_compile.h @@ -211,6 +211,7 @@ struct proc { unsigned ret_bitmap; unsigned called; unsigned active; + unsigned okmask; struct token *return_tok[VCL_RET_MAX]; struct vsb *cname; struct vsb *prologue; @@ -265,6 +266,7 @@ struct vcc { */ struct vsb *sb; int err; + unsigned nsub; struct proc *curproc; VTAILQ_HEAD(, proc) procs; @@ -427,7 +429,7 @@ void VCC_InstanceInfo(struct vcc *tl); void VCC_XrefTable(struct vcc *); void vcc_AddCall(struct vcc *, struct token *, struct symbol *); -void vcc_ProcAction(struct proc *p, unsigned action, struct token *t); +void vcc_ProcAction(struct proc *, unsigned, unsigned, struct token *); int vcc_CheckAction(struct vcc *tl); diff --git a/lib/libvcc/vcc_xref.c b/lib/libvcc/vcc_xref.c index b6f08bd71..091874895 100644 --- a/lib/libvcc/vcc_xref.c +++ b/lib/libvcc/vcc_xref.c @@ -161,11 +161,12 @@ vcc_AddCall(struct vcc *tl, struct token *t, struct symbol *sym) } void -vcc_ProcAction(struct proc *p, unsigned returns, struct token *t) +vcc_ProcAction(struct proc *p, unsigned returns, unsigned mask, struct token *t) { assert(returns < VCL_RET_MAX); p->ret_bitmap |= (1U << returns); + p->okmask &= mask; /* Record the first instance of this return */ if (p->return_tok[returns] == NULL) p->return_tok[returns] = t; @@ -212,6 +213,7 @@ vcc_CheckActionRecurse(struct vcc *tl, struct proc *p, unsigned bitmap) vcc_ErrWhere(tl, pc->t); return (1); } + p->okmask &= pc->sym->proc->okmask; } p->active = 0; p->called++; @@ -279,22 +281,27 @@ vcc_illegal_write(struct vcc *tl, struct procuse *pu, const struct method *m) } static struct procuse * -vcc_FindIllegalUse(struct vcc *tl, const struct proc *p, const struct method *m) +vcc_FindIllegalUse(struct vcc *tl, struct proc *p, const struct method *m) { - struct procuse *pu, *pw; + struct procuse *pu, *pw, *r = NULL; VTAILQ_FOREACH(pu, &p->uses, list) { + p->okmask &= pu->mask; + if (m == NULL) + continue; pw = vcc_illegal_write(tl, pu, m); + if (r != NULL) + continue; if (tl->err) - return (pw); - if (!(pu->mask & m->bitval)) - return (pu); + r = pw; + else if (!(pu->mask & m->bitval)) + r = pu; } - return (NULL); + return (r); } static int -vcc_CheckUseRecurse(struct vcc *tl, const struct proc *p, +vcc_CheckUseRecurse(struct vcc *tl, struct proc *p, const struct method *m) { struct proccall *pc; @@ -319,6 +326,7 @@ vcc_CheckUseRecurse(struct vcc *tl, const struct proc *p, vcc_ErrWhere(tl, pc->t); return (1); } + p->okmask &= pc->sym->proc->okmask; } return (0); } @@ -331,8 +339,6 @@ vcc_checkuses(struct vcc *tl, const struct symbol *sym) p = sym->proc; AN(p); - if (p->method == NULL) - return; pu = vcc_FindIllegalUse(tl, p, p->method); if (pu != NULL) { vcc_ErrWhere2(tl, pu->t1, pu->t2); From nils.goroll at uplex.de Mon Feb 8 17:52:03 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:03 +0000 (UTC) Subject: [master] ae87e52f9 vcc: check for impossible subs at compile time Message-ID: <20210208175203.9DD76114F8C@lists.varnish-cache.org> commit ae87e52f926b8248622e72851573129ccc3ef605 Author: Nils Goroll Date: Sat Feb 6 14:25:37 2021 +0100 vcc: check for impossible subs at compile time We call those subs impossible which use a combination of variables not being available together from any of the built-in subroutines (aka methods), for example:: sub foo { set req.http.impossible = beresp.reason; } For this example, there is no built-in subroutine for which both req and beresp were available, so it can not possibly be valid in any context. As long as subs were actually called directly or indirectly from a built-in sub, VCC did already detect the problem. For the above example, if `sub vcl_recv { call foo; }` existed, VCC would complain about beresp.reason not being accessible from vcl_recv. Except, when vcc_err_unref was disabled, the example would pass without error, and likewise it will with calls which we are about to add. We now add a check to detect impossible subroutines. It happens in a second walk over the VCL's SUB symbols in order to keep the more precise error messages for calls rooting in one of the built-in subs. This change also changes the order of error reporting slightly and incorporates, indirectly, the vcc_CheckUses() check moved in ed36b6389f9dbf6962e726f0df34d59132d9241a. v00020.vtc now has the "Impossible Subroutine with vcc_err_unref off" check, while the newly added m00053.vtc has been changed to test failure of the impossible sub at compile time rather than at runtime. This change was triggered by feedback from Dridi diff --git a/bin/varnishtest/tests/v00020.vtc b/bin/varnishtest/tests/v00020.vtc index 068135836..c9d41647b 100644 --- a/bin/varnishtest/tests/v00020.vtc +++ b/bin/varnishtest/tests/v00020.vtc @@ -246,6 +246,17 @@ varnish v1 -errvcl {Not available in subroutine 'vcl_recv'.} { } } +varnish v1 -cliok "param.set vcc_err_unref off" + +varnish v1 -errvcl {Impossible Subroutine} { + backend b { .host = "127.0.0.1"; } + sub foo { + set req.http.foo = 100 + beresp.status; + } +} + +varnish v1 -cliok "param.set vcc_err_unref on" + varnish v1 -errvcl { ('' Line 4 Pos 44) -- (Pos 49) sub foo { set req.http.foo = 100 + beresp.status; } diff --git a/lib/libvcc/vcc_xref.c b/lib/libvcc/vcc_xref.c index 091874895..c2e63ed76 100644 --- a/lib/libvcc/vcc_xref.c +++ b/lib/libvcc/vcc_xref.c @@ -140,10 +140,6 @@ vcc_AddUses(struct vcc *tl, const struct token *t1, const struct token *t2, WRONG("wrong xref use"); VTAILQ_INSERT_TAIL(&tl->curproc->uses, pu, list); - - if (pu->mask == 0) - if (vcc_CheckUses(tl)) - AN(tl->err); } void @@ -355,11 +351,34 @@ vcc_checkuses(struct vcc *tl, const struct symbol *sym) } } +/* + * Used from a second symbol walk because vcc_checkuses is more precise for + * subroutines called from methods. We catch here subs used for dynamic calls + * and with vcc_err_unref = off + */ +static void +vcc_checkpossible(struct vcc *tl, const struct symbol *sym) +{ + struct proc *p; + + p = sym->proc; + AN(p); + + if (p->okmask != 0) + return; + + VSB_cat(tl->sb, "Impossible Subroutine"); + vcc_ErrWhere(tl, p->name); +} + int vcc_CheckUses(struct vcc *tl) { VCC_WalkSymbols(tl, vcc_checkuses, SYM_MAIN, SYM_SUB); + if (tl->err) + return (tl->err); + VCC_WalkSymbols(tl, vcc_checkpossible, SYM_MAIN, SYM_SUB); return (tl->err); } From nils.goroll at uplex.de Mon Feb 8 17:52:03 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:03 +0000 (UTC) Subject: [master] 59034c010 vcc SUB type: store C symbols for struct vcl_sub and the function Message-ID: <20210208175203.B7D11114F91@lists.varnish-cache.org> commit 59034c0101047c86756d3f97c3734162a740da3a Author: Nils Goroll Date: Sat Feb 6 14:23:05 2021 +0100 vcc SUB type: store C symbols for struct vcl_sub and the function We change the semantics of the rname and lname attributes of SUB symbols: rname now is the name of the (struct vcl_sub), lname is the cname, the name of the function to be called directly from VGC. diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index ec263fd8e..45eb278ca 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -53,7 +53,7 @@ vcc_act_call(struct vcc *tl, struct token *t, struct symbol *sym) if (sym != NULL) { vcc_AddCall(tl, t0, sym); VCC_GlobalSymbol(sym, SUB, "VGC_function"); - Fb(tl, 1, "%s(ctx);\n", sym->rname); + Fb(tl, 1, "%s(ctx);\n", sym->lname); SkipToken(tl, ';'); } } diff --git a/lib/libvcc/vcc_parse.c b/lib/libvcc/vcc_parse.c index 3331d961c..dc1d55c5b 100644 --- a/lib/libvcc/vcc_parse.c +++ b/lib/libvcc/vcc_parse.c @@ -251,7 +251,7 @@ vcc_ParseFunction(struct vcc *tl) VCC_GlobalSymbol(sym, SUB, "VGC_function"); p = vcc_NewProc(tl, sym); p->name = t; - VSB_printf(p->cname, "%s", sym->rname); + VSB_printf(p->cname, "%s", sym->lname); } else if (p->method == NULL) { VSB_printf(tl->sb, "Subroutine '%s' redefined\n", sym->name); vcc_ErrWhere(tl, t); diff --git a/lib/libvcc/vcc_symb.c b/lib/libvcc/vcc_symb.c index 0138c2cf6..2f8632359 100644 --- a/lib/libvcc/vcc_symb.c +++ b/lib/libvcc/vcc_symb.c @@ -471,6 +471,14 @@ VCC_GlobalSymbol(struct symbol *sym, vcc_type_t type, const char *pfx) VSB_printf(vsb, "%s_", pfx); VCC_PrintCName(vsb, sym->name, NULL); AZ(VSB_finish(vsb)); + sym->lname = strdup(VSB_data(vsb)); + if (type == SUB) { + VSB_destroy(&vsb); + vsb = VSB_new_auto(); + AN(vsb); + VSB_printf(vsb, "sub_%s", sym->lname); + AZ(VSB_finish(vsb)); + } sym->rname = strdup(VSB_data(vsb)); AN(sym->rname); VSB_destroy(&vsb); From nils.goroll at uplex.de Mon Feb 8 17:52:03 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:03 +0000 (UTC) Subject: [master] 00df3c9e3 vcc: record if any SUB references have been encountered Message-ID: <20210208175203.D02F9114F95@lists.varnish-cache.org> commit 00df3c9e380773f97d512ef2472e1bce5f69c944 Author: Nils Goroll Date: Sat Feb 6 14:25:12 2021 +0100 vcc: record if any SUB references have been encountered For follow up commits, we will need to know if a VCL contains any references to the SUB type, that is, if the SUB type was used as a vmod function or method argument. diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index d4dfa0601..78457763d 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -538,7 +538,7 @@ EmitStruct(const struct vcc *tl) Fc(tl, 0, "\t.ref = VGC_ref,\n"); Fc(tl, 0, "\t.nref = VGC_NREFS,\n"); Fc(tl, 0, "\t.nsrc = VGC_NSRCS,\n"); - Fc(tl, 0, "\t.nsub = %d,\n", tl->nsub); + Fc(tl, 0, "\t.nsub = %d,\n", tl->subref > 0 ? tl->nsub : 0); Fc(tl, 0, "\t.srcname = srcname,\n"); Fc(tl, 0, "\t.srcbody = srcbody,\n"); Fc(tl, 0, "\t.nvmod = %u,\n", tl->vmod_count); diff --git a/lib/libvcc/vcc_compile.h b/lib/libvcc/vcc_compile.h index 814414c66..2dff6dfa5 100644 --- a/lib/libvcc/vcc_compile.h +++ b/lib/libvcc/vcc_compile.h @@ -267,6 +267,7 @@ struct vcc { struct vsb *sb; int err; unsigned nsub; + unsigned subref; // SUB arguments present struct proc *curproc; VTAILQ_HEAD(, proc) procs; diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c index 06d2c7d75..f44a868ab 100644 --- a/lib/libvcc/vcc_expr.c +++ b/lib/libvcc/vcc_expr.c @@ -446,6 +446,8 @@ vcc_do_arg(struct vcc *tl, struct func_arg *fa) vcc_do_enum(tl, fa, PF(tl->t)); SkipToken(tl, ID); } else { + if (fa->type == SUB) + tl->subref++; vcc_expr0(tl, &e2, fa->type); ERRCHK(tl); assert(e2->fmt == fa->type); From nils.goroll at uplex.de Mon Feb 8 17:52:03 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:03 +0000 (UTC) Subject: [master] d86a90ee6 vcc: Repurpose (struct proc).called and add info to struct vcl_sub Message-ID: <20210208175203.E9C10114F99@lists.varnish-cache.org> commit d86a90ee699e02b1e61b738107e26d057ec34886 Author: Nils Goroll Date: Fri Jan 29 14:37:35 2021 +0100 vcc: Repurpose (struct proc).called and add info to struct vcl_sub The .called attribute was not used. We now increment it only for custom subs which are actually called statically (with "call"), that is, not for the builtin subs. This is to simplify and clarify the use case in the next commits. The increment happens for each VCC walk of the SUBs. We also add the number of symbolic references and calls to (struct vcl_sub) of the VGC to facilitate reviews and debugging. diff --git a/include/vcc_interface.h b/include/vcc_interface.h index 32f09b970..4c2a5c295 100644 --- a/include/vcc_interface.h +++ b/include/vcc_interface.h @@ -92,4 +92,6 @@ struct vcl_sub { const struct VCL_conf *vcl_conf; vcl_func_f *func; unsigned n; + unsigned nref; + unsigned called; }; diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index 78457763d..f3a87aa39 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -176,6 +176,7 @@ vcc_EmitProc(struct vcc *tl, struct proc *p) AZ(VSB_finish(p->cname)); AZ(VSB_finish(p->prologue)); AZ(VSB_finish(p->body)); + AN(p->sym); Fh(tl, 1, "vcl_func_f %s;\n", VSB_data(p->cname)); Fh(tl, 1, "const struct vcl_sub sub_%s[1] = {{\n", @@ -185,7 +186,9 @@ vcc_EmitProc(struct vcc *tl, struct proc *p) Fh(tl, 1, "\t.name\t\t= \"%.*s\",\n", PF(p->name)); Fh(tl, 1, "\t.vcl_conf\t= &VCL_conf,\n"); Fh(tl, 1, "\t.func\t\t= %s,\n", VSB_data(p->cname)); - Fh(tl, 1, "\t.n\t\t= %d\n", tl->nsub++); + Fh(tl, 1, "\t.n\t\t= %d,\n", tl->nsub++); + Fh(tl, 1, "\t.nref\t\t= %d,\n", p->sym->nref); + Fh(tl, 1, "\t.called\t\t= %d\n", p->called); Fh(tl, 1, "}};\n"); /* * TODO: v_dont_optimize for custom subs called from vcl_init/fini only diff --git a/lib/libvcc/vcc_xref.c b/lib/libvcc/vcc_xref.c index c2e63ed76..55a4198de 100644 --- a/lib/libvcc/vcc_xref.c +++ b/lib/libvcc/vcc_xref.c @@ -203,6 +203,7 @@ vcc_CheckActionRecurse(struct vcc *tl, struct proc *p, unsigned bitmap) vcc_ErrWhere(tl, pc->t); return (1); } + pc->sym->proc->called++; if (vcc_CheckActionRecurse(tl, pc->sym->proc, bitmap)) { VSB_printf(tl->sb, "\n...called from \"%.*s\"\n", PF(p->name)); @@ -212,7 +213,6 @@ vcc_CheckActionRecurse(struct vcc *tl, struct proc *p, unsigned bitmap) p->okmask &= pc->sym->proc->okmask; } p->active = 0; - p->called++; return (0); } From nils.goroll at uplex.de Mon Feb 8 17:52:04 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:04 +0000 (UTC) Subject: [master] 75fcc13e5 vcc: Mark subs statically reachable via dynamic subs as "dynamic" Message-ID: <20210208175204.104F8114F9E@lists.varnish-cache.org> commit 75fcc13e5b714a7bfc640f2617df6b1052d33138 Author: Nils Goroll Date: Sat Jan 30 20:27:04 2021 +0100 vcc: Mark subs statically reachable via dynamic subs as "dynamic" In follow up commits, we will need a marker for subs which can be reachable via dynamically referenced SUBs. We use "more references than calls" is this marker. When walking the call trees, we add one reference for all subs which are called from a SUB having this marker, thus marking those, too. diff --git a/lib/libvcc/vcc_xref.c b/lib/libvcc/vcc_xref.c index 55a4198de..286e81ee0 100644 --- a/lib/libvcc/vcc_xref.c +++ b/lib/libvcc/vcc_xref.c @@ -195,6 +195,10 @@ vcc_CheckActionRecurse(struct vcc *tl, struct proc *p, unsigned bitmap) vcc_ErrWhere(tl, p->name); return (1); } + + // more references than calls -> sub is referenced for dynamic calls + u = (p->sym->nref > p->called); + p->active = 1; VTAILQ_FOREACH(pc, &p->calls, list) { if (pc->sym->proc == NULL) { @@ -204,6 +208,7 @@ vcc_CheckActionRecurse(struct vcc *tl, struct proc *p, unsigned bitmap) return (1); } pc->sym->proc->called++; + pc->sym->nref += u; if (vcc_CheckActionRecurse(tl, pc->sym->proc, bitmap)) { VSB_printf(tl->sb, "\n...called from \"%.*s\"\n", PF(p->name)); From nils.goroll at uplex.de Mon Feb 8 17:52:04 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:04 +0000 (UTC) Subject: [master] f53ae41f2 vcc: Run compile time recursion check also on dynamic-only SUBs Message-ID: <20210208175204.29742114FA3@lists.varnish-cache.org> commit f53ae41f2bf21293521c1b474f0c9f38d3317879 Author: Nils Goroll Date: Sat Jan 30 20:24:27 2021 +0100 vcc: Run compile time recursion check also on dynamic-only SUBs We previously missed to run the static recursion check on SUBs which are only referenced symbolically (and thus might be called dynamically). This changes the error reporting tested in v00021.vtc because the recursion is detected on the recursing subs alone before the call tree from vcl_recv {} is walked. diff --git a/bin/varnishtest/tests/v00021.vtc b/bin/varnishtest/tests/v00021.vtc index 720ff8ca5..74bb36509 100644 --- a/bin/varnishtest/tests/v00021.vtc +++ b/bin/varnishtest/tests/v00021.vtc @@ -49,11 +49,6 @@ Subroutine recurses on sub foo { call foo; } -----------------------###--- - -...called from "vcl_recv" -('' Line 6 Pos 29) - sub vcl_recv { call foo; } -----------------------------###--- } { backend b { .host = "${localhost}"; } @@ -62,16 +57,9 @@ Subroutine recurses on } varnish v1 -errvcl { -Subroutine recurses on -('' Line 6 Pos 13) - sub foo { call bar; } -------------###-------------- - - -...called from "bar" -('' Line 5 Pos 24) +('' Line 5 Pos 13) sub bar { call foo; } ------------------------###--- +------------###-------------- ...called from "foo" @@ -80,10 +68,11 @@ Subroutine recurses on -----------------------###--- -...called from "vcl_recv" -('' Line 7 Pos 29) - sub vcl_recv { call foo; } -----------------------------###--- +...called from "bar" +('' Line 5 Pos 24) + sub bar { call foo; } +-----------------------###--- + } { backend b { .host = "${localhost}"; } diff --git a/lib/libvcc/vcc_xref.c b/lib/libvcc/vcc_xref.c index 286e81ee0..83dec7461 100644 --- a/lib/libvcc/vcc_xref.c +++ b/lib/libvcc/vcc_xref.c @@ -227,25 +227,33 @@ static void vcc_checkaction(struct vcc *tl, const struct symbol *sym) { struct proc *p; + unsigned bitmap; p = sym->proc; AN(p); AN(p->name); + if (p->method == NULL) + bitmap = ~0U; + else + bitmap = p->method->ret_bitmap; + + if (! vcc_CheckActionRecurse(tl, p, bitmap)) return; - if (vcc_CheckActionRecurse(tl, p, p->method->ret_bitmap)) { - VSB_printf(tl->sb, - "\n...which is the \"%s\" subroutine\n", p->method->name); - VSB_cat(tl->sb, "Legal returns are:"); + + tl->err = 1; + if (p->method == NULL) + return; + + VSB_printf(tl->sb, + "\n...which is the \"%s\" subroutine\n", p->method->name); + VSB_cat(tl->sb, "Legal returns are:"); #define VCL_RET_MAC(l, U, B) \ - if (p->method->ret_bitmap & ((1 << VCL_RET_##U))) \ - VSB_printf(tl->sb, " \"%s\"", #l); + if (p->method->ret_bitmap & ((1 << VCL_RET_##U))) \ + VSB_printf(tl->sb, " \"%s\"", #l); #include "tbl/vcl_returns.h" - VSB_cat(tl->sb, "\n"); - tl->err = 1; - } - + VSB_cat(tl->sb, "\n"); } int From nils.goroll at uplex.de Mon Feb 8 17:52:04 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:04 +0000 (UTC) Subject: [master] 7574ac639 vgc: Assert on ctx->method also for custom subs Message-ID: <20210208175204.43032114FB6@lists.varnish-cache.org> commit 7574ac63950e7adb963da2a085090c6e8349ae66 Author: Nils Goroll Date: Sat Jan 30 21:09:19 2021 +0100 vgc: Assert on ctx->method also for custom subs Improve safety by asserting that a sub is never called from a context which is not allowed as per its okmask. This is to ensure correctness of our compile- and runtime-checks. diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index f3a87aa39..20aac191d 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -171,6 +171,8 @@ static void vcc_EmitProc(struct vcc *tl, struct proc *p) { struct vsb *vsbm; + unsigned mask; + const char *maskcmp; AN(p->okmask); AZ(VSB_finish(p->cname)); @@ -178,6 +180,14 @@ vcc_EmitProc(struct vcc *tl, struct proc *p) AZ(VSB_finish(p->body)); AN(p->sym); + if (p->method) { + mask = p->method->bitval; + maskcmp = "=="; + } else { + mask = p->okmask; + maskcmp = "&"; + } + Fh(tl, 1, "vcl_func_f %s;\n", VSB_data(p->cname)); Fh(tl, 1, "const struct vcl_sub sub_%s[1] = {{\n", VSB_data(p->cname)); @@ -201,15 +211,12 @@ vcc_EmitProc(struct vcc *tl, struct proc *p) p->method && p->method->bitval & VCL_MET_TASK_H ? "v_dont_optimize " : ""); Fc(tl, 1, "%s(VRT_CTX)\n{\n", VSB_data(p->cname)); - if (p->method) { - vsbm = VSB_new_auto(); - AN(vsbm); - vcc_vcl_met2c(vsbm, p->method->bitval); - AZ(VSB_finish(vsbm)); - Fc(tl, 1, " assert(ctx->method == (%s));\n", - VSB_data(vsbm)); - VSB_destroy(&vsbm); - } + vsbm = VSB_new_auto(); + AN(vsbm); + vcc_vcl_met2c(vsbm, mask); + AZ(VSB_finish(vsbm)); + Fc(tl, 1, " assert(ctx->method %s (%s));\n", maskcmp, VSB_data(vsbm)); + VSB_destroy(&vsbm); Fc(tl, 1, "%s\n%s}\n", VSB_data(p->prologue), VSB_data(p->body)); VSB_destroy(&p->body); VSB_destroy(&p->prologue); From nils.goroll at uplex.de Mon Feb 8 17:52:04 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:04 +0000 (UTC) Subject: [master] 8551b1f59 vgc: Advise C compiler not optimize housekeeping subs *only* Message-ID: <20210208175204.59736114FC5@lists.varnish-cache.org> commit 8551b1f59f9f4fdebfbaa8dfd9e539d73500d695 Author: Nils Goroll Date: Sun Jan 31 11:17:43 2021 +0100 vgc: Advise C compiler not optimize housekeeping subs *only* Before the addition of the okmask, we could only selectively turn off optimizations for the built-in housekeeping subs (vcl_init {} / vcl_fini {}), not for any custom subs called from there. The previous commit changed this and turned off optimizations for any custom subs called from there. We pull this tighter again by only turning off optimizations for subs which can _only_ be called from housekeeping. Ref f1c47e4860f213710bd58f0c41fc1f1437d6c461 Ref #3230 diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index 20aac191d..e9fb25b8b 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -200,15 +200,8 @@ vcc_EmitProc(struct vcc *tl, struct proc *p) Fh(tl, 1, "\t.nref\t\t= %d,\n", p->sym->nref); Fh(tl, 1, "\t.called\t\t= %d\n", p->called); Fh(tl, 1, "}};\n"); - /* - * TODO: v_dont_optimize for custom subs called from vcl_init/fini only - * - * Needs infrastructure similar to that in #3163 : custom subs need a - * mask containing the builtin subs calling the custom sub. If that is - * no larger than VCL_MET_TASK_H, we can enable v_dont_optimize - */ Fc(tl, 1, "\nvoid %sv_matchproto_(vcl_func_f)\n", - p->method && p->method->bitval & VCL_MET_TASK_H ? + ((mask & VCL_MET_TASK_H) && (mask & ~VCL_MET_TASK_H) == 0) ? "v_dont_optimize " : ""); Fc(tl, 1, "%s(VRT_CTX)\n{\n", VSB_data(p->cname)); vsbm = VSB_new_auto(); From nils.goroll at uplex.de Mon Feb 8 17:52:04 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:04 +0000 (UTC) Subject: [master] a294c31dd Add a bitmask tracking SUB calls to detect recursions Message-ID: <20210208175204.72FE7114FD3@lists.varnish-cache.org> commit a294c31ddabaf2cc08e92fa09e512233c154f7c1 Author: Nils Goroll Date: Sat Feb 6 15:13:42 2021 +0100 Add a bitmask tracking SUB calls to detect recursions To allow dynamic SUB calls, we need to check for recursions at runtime, reflecting the compile time recursion check. We create a bitmask to note each dynamically called SUB by its unique number. To check for recursions, we only need to test if the respective bit for the sub number is already set. We only conduct this check if the track_call argument of vcl_call_method() is true. By setting this argument to the number of SUB references, we enable call tracking only for VCLs with dynamic SUB references (when (struct VCL_conf).nsub is non-zero). VCC already guarantees that static calls are loop free - so loops can only be introduced through dynamic SUB references. Call tracking with a bitmask was suggested by phk diff --git a/bin/varnishd/cache/cache_vrt_vcl.c b/bin/varnishd/cache/cache_vrt_vcl.c index 04cc68107..b474ea4e9 100644 --- a/bin/varnishd/cache/cache_vrt_vcl.c +++ b/bin/varnishd/cache/cache_vrt_vcl.c @@ -39,9 +39,11 @@ #include "vcl.h" #include "vtim.h" +#include "vbm.h" #include "cache_director.h" #include "cache_vcl.h" +#include "vcc_interface.h" /*--------------------------------------------------------------------*/ @@ -444,10 +446,13 @@ VRT_VCL_Allow_Discard(struct vclref **refp) static void vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo, - void *specific, unsigned method, vcl_func_f *func) + void *specific, unsigned method, vcl_func_f *func, unsigned track_call) { - uintptr_t aws; + uintptr_t rws = 0, aws; struct vrt_ctx ctx; + struct vbitmap *vbm; + void *p; + size_t sz; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); INIT_OBJ(&ctx, VRT_CTX_MAGIC); @@ -468,6 +473,15 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo, assert(ctx.now != 0); ctx.specific = specific; ctx.method = method; + if (track_call > 0) { + rws = WS_Snapshot(wrk->aws); + sz = VBITMAP_SZ(track_call); + p = WS_Alloc(wrk->aws, sz); + // No use to attempt graceful failure, all VCL calls will fail + AN(p); + vbm = vbit_init(p, sz); + ctx.called = vbm; + } aws = WS_Snapshot(wrk->aws); wrk->cur_method = method; wrk->seen_methods |= method; @@ -484,6 +498,8 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo, * wrk->aws, but they can reserve and return from it. */ assert(aws == WS_Snapshot(wrk->aws)); + if (rws != 0) + WS_Reset(wrk->aws, rws); } #define VCL_MET_MAC(func, upper, typ, bitmap) \ @@ -496,7 +512,7 @@ VCL_##func##_method(struct vcl *vcl, struct worker *wrk, \ CHECK_OBJ_NOTNULL(vcl->conf, VCL_CONF_MAGIC); \ CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); \ vcl_call_method(wrk, req, bo, specific, \ - VCL_MET_ ## upper, vcl->conf->func##_func); \ + VCL_MET_ ## upper, vcl->conf->func##_func, vcl->conf->nsub);\ AN((1U << wrk->handling) & bitmap); \ } diff --git a/include/vrt.h b/include/vrt.h index 1b0765454..c95d0f820 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -332,6 +332,8 @@ struct vrt_ctx { * synth+error: struct vsb * */ void *specific; + /* if present, vbitmap of called subs */ + void *called; }; #define VRT_CTX const struct vrt_ctx *ctx From nils.goroll at uplex.de Mon Feb 8 17:52:04 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:04 +0000 (UTC) Subject: [master] a91e16ed5 Add VPI interface for runtime recursion tracking & checks Message-ID: <20210208175204.8AB3C114FDB@lists.varnish-cache.org> commit a91e16ed5bba1ffd6aec494f8976823c0254289d Author: Nils Goroll Date: Sun Jan 31 12:51:46 2021 +0100 Add VPI interface for runtime recursion tracking & checks This implements the first bit of phks suggestion in https://github.com/varnishcache/varnish-cache/pull/3163#issuecomment-769718143 These VPI functions implement the operations on the recursion check bitmask for dynamic SUB calls. Strictly speaking, the VPI subs would not need to be concerned with the methods bitmask check and the assertion that calls originate from the right VCL, but we centralise these aspects for simplicity. We also add an enum to denote check failures. diff --git a/bin/varnishd/cache/cache_vpi.c b/bin/varnishd/cache/cache_vpi.c index 24a3c58b9..f6e09dd86 100644 --- a/bin/varnishd/cache/cache_vpi.c +++ b/bin/varnishd/cache/cache_vpi.c @@ -35,6 +35,7 @@ #include "cache_varnishd.h" #include "vcl.h" +#include "vbm.h" #include "vcc_interface.h" @@ -140,3 +141,48 @@ VPI_Fail(const char *func, const char *file, int line, { VAS_Fail(func, file, line, cond, VAS_ASSERT); } + +enum vcl_func_fail_e +VPI_Call_Check(VRT_CTX, const struct VCL_conf *conf, + unsigned methods, unsigned n) +{ + struct vbitmap *vbm; + + CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); + CHECK_OBJ_NOTNULL(ctx->vcl, VCL_MAGIC); + + assert(conf == ctx->vcl->conf); + + vbm = ctx->called; + AN(vbm); + + if ((methods & ctx->method) == 0) + return (VSUB_E_METHOD); + + if (vbit_test(vbm, n)) + return (VSUB_E_RECURSE); + + return (VSUB_E_OK); +} + +void +VPI_Call_Begin(VRT_CTX, unsigned n) +{ + struct vbitmap *vbm; + + CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); + vbm = ctx->called; + AN(vbm); + vbit_set(vbm, n); +} + +void +VPI_Call_End(VRT_CTX, unsigned n) +{ + struct vbitmap *vbm; + + CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); + vbm = ctx->called; + AN(vbm); + vbit_clr(vbm, n); +} diff --git a/include/vcc_interface.h b/include/vcc_interface.h index 4c2a5c295..7ad670ea3 100644 --- a/include/vcc_interface.h +++ b/include/vcc_interface.h @@ -95,3 +95,8 @@ struct vcl_sub { unsigned nref; unsigned called; }; + +enum vcl_func_fail_e VPI_Call_Check(VRT_CTX, const struct VCL_conf *conf, + unsigned methods, unsigned n); +void VPI_Call_Begin(VRT_CTX, unsigned n); +void VPI_Call_End(VRT_CTX, unsigned n); diff --git a/include/vrt.h b/include/vrt.h index c95d0f820..ffb6d2abc 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -339,6 +339,12 @@ struct vrt_ctx { #define VRT_CTX const struct vrt_ctx *ctx void VRT_CTX_Assert(VRT_CTX); +enum vcl_func_fail_e { + VSUB_E_OK, + VSUB_E_RECURSE, // call would recurse + VSUB_E_METHOD // can not be called from this method +}; + typedef void vcl_func_f(VRT_CTX); /*********************************************************************** From nils.goroll at uplex.de Mon Feb 8 17:52:04 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:04 +0000 (UTC) Subject: [master] 06696692f Support dynamic SUBs with VRT_call() / VRT_check_call() Message-ID: <20210208175204.A6C98114FE0@lists.varnish-cache.org> commit 06696692fd9fa24b799c44cd6b83fc620cc6a30b Author: Nils Goroll Date: Sat Feb 6 15:21:02 2021 +0100 Support dynamic SUBs with VRT_call() / VRT_check_call() This allows for VCL subs to be called dynamically at runtime: vmods may store references to VCL_SUBs and call them some time later. Calling a VCL_SUB pointer requires to conduct two fundamental checks also at runtime, which previously were implemented by VCC at compile time only: * checking the allowed context * checking for recursive calls The foundation for both has been laid in previous commits and has been made available through VPI_Call_*(). Note that we do not change the VCC checks in any way for static calls, we only add runtime checks for dynamic calls. This commit adds a VRT interface for dynamic calls and changes VGC to ensure proper runtime checking (as suggested by phk). We add to the vcl_func_f signature - a vcl_func_call_e argument denoting the type of call and - a vcl_func_fail_e value argument to optionally return a failure code On vcl_func_call_e: VSUB_CHECK allows runtime callers to preflight a "can this sub be called" check, which is the basis for VRT_check_call(). VSUB_DYNAMIC must be used by any calls outside VGC. VSUB_STATIC is for VGC only and, strictly speaking, would not be required. It is added for clarity and safety and used for "call" actions from VCL. On vcl_func_fail_e: If the argument is present, any error will be returned in it. Otherwise, the generated code fails the VCL. On the implementation: To minimize the overhead for runtime context and recursion checks, we only add them where needed. In previous commits, we changed the VCC walks over SUBs to ensure that any dynamically referenced SUBs and all SUBs reachable from these via "call" can be identified by having more references than calls (p->sym->nref > p->called). So we now know, at compile time, for which SUBs we need to add runtime checks. Read https://github.com/varnishcache/varnish-cache/pull/3163#issuecomment-770266098 for more details. Depending on whether the SUB is dynamically callable or not, we either add runtime checks or keep the code identical to before (except for a changed signature and some assertions). For the dynamic case, we need to wrap the actual SUB in order to clear the recursion check bit when it returns. Note that this happens independend of whether the actuall call is static or dynamic - because it has to. The recursion check for dynamic calls requires any previous static calls to be registered. The VGC for the dynamic case looks like this (slightly edited for clarity): static void VGC_function_foo_checked(VRT_CTX) { assert(ctx->method & (VCL_MET_DELIVER|VCL_MET_SYNTH)); { { VPI_count(ctx, 1); // ... as before void v_matchproto_(vcl_func_f) VGC_function_foo(VRT_CTX, enum vcl_func_call_e call, enum vcl_func_fail_e *failp) { enum vcl_func_fail_e fail; fail = VPI_Call_Check(ctx, &VCL_conf, 0x300, 0); if (failp) *failp = fail; else if (fail == VSUB_E_METHOD) VRT_fail(ctx, "call to \"sub foo{}\" not allowed from here"); else if (fail == VSUB_E_RECURSE) VRT_fail(ctx, "Recursive call to \"sub foo{}\" not allowed from here"); else assert(fail == VSUB_E_OK); if (fail != VSUB_E_OK || call == VSUB_CHECK) return; VPI_Call_Begin(ctx, 0); VGC_function_foo_checked(ctx); VPI_Call_End(ctx, 0); } The actual function body remains unchanged, but is contained in the static function named "*_checked". The vcl_func_f is now a wrapper. The wrapper - checks for context errors using VPI_Call_Check() - either returns any error in the failp argument or fails the VCL - encoses the call to the "_checked" function with VPI_Call_Begin / VPI_Call_End which set/clear the recursion marker bit. diff --git a/bin/varnishd/cache/cache_vrt_vcl.c b/bin/varnishd/cache/cache_vrt_vcl.c index b474ea4e9..8d20c7848 100644 --- a/bin/varnishd/cache/cache_vrt_vcl.c +++ b/bin/varnishd/cache/cache_vrt_vcl.c @@ -487,7 +487,7 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo, wrk->seen_methods |= method; AN(ctx.vsl); VSLb(ctx.vsl, SLT_VCL_call, "%s", VCL_Method_Name(method)); - func(&ctx); + func(&ctx, VSUB_STATIC, NULL); VSLb(ctx.vsl, SLT_VCL_return, "%s", VCL_Return_Name(wrk->handling)); wrk->cur_method |= 1; // Magic marker if (wrk->handling == VCL_RET_FAIL) @@ -517,3 +517,51 @@ VCL_##func##_method(struct vcl *vcl, struct worker *wrk, \ } #include "tbl/vcl_returns.h" + +/*-------------------------------------------------------------------- + */ + +VCL_STRING +VRT_check_call(VRT_CTX, VCL_SUB sub) +{ + VCL_STRING err = NULL; + enum vcl_func_fail_e fail; + + CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); + CHECK_OBJ_NOTNULL(sub, VCL_SUB_MAGIC); + + AN(sub->func); + sub->func(ctx, VSUB_CHECK, &fail); + + switch (fail) { + case VSUB_E_OK: + break; + case VSUB_E_METHOD: + err = WS_Printf(ctx->ws, "Dynamic call to \"sub %s{}\"" + " not allowed from here", sub->name); + if (err == NULL) + err = "Dynamic call not allowed and workspace overflow"; + break; + case VSUB_E_RECURSE: + err = WS_Printf(ctx->ws, "Recursive dynamic call to" + " \"sub %s{}\"", sub->name); + if (err == NULL) + err = "Recursive dynamic call and workspace overflow"; + break; + default: + INCOMPL(); + } + + return (err); +} + +VCL_VOID +VRT_call(VRT_CTX, VCL_SUB sub) +{ + + CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); + CHECK_OBJ_NOTNULL(sub, VCL_SUB_MAGIC); + + AN(sub->func); + sub->func(ctx, VSUB_DYNAMIC, NULL); +} diff --git a/doc/changes.rst b/doc/changes.rst index 4b7c61886..e98abd650 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -56,6 +56,19 @@ Varnish Cache Next (2021-03-15) * All shard ``Error`` and ``Notice`` messages now use the unified prefix ``vmod_directors: shard %s``. +* The ``VCL_SUB`` data type is now supported for VMODs to save + references to subroutines to be called later using + ``VRT_call()``. Calls from a wrong context (e.g. calling a + subroutine accessing ``req`` from the backend side) and recursive + calls fail the VCL. + +* ``VRT_check_call()`` can be used to check if a ``VRT_call()`` would + succeed in order to avoid the potential VCL failure in case it would + not. + + It returns ``NULL`` if ``VRT_call()`` would make the call or an + error string why not. + ================================ Varnish Cache 6.5.1 (2020-09-25) ================================ diff --git a/doc/sphinx/reference/vmod.rst b/doc/sphinx/reference/vmod.rst index f9d49d01c..8eb6baa8a 100644 --- a/doc/sphinx/reference/vmod.rst +++ b/doc/sphinx/reference/vmod.rst @@ -460,6 +460,26 @@ TIME An absolute time, as in 1284401161. +VCL_SUB + C-type: ``const struct vcl_sub *`` + + Opaque handle on a VCL subroutine. + + References to subroutines can be passed into VMODs as + arguments and called later through ``VRT_call()``. The scope + strictly is the VCL: vmods must ensure that ``VCL_SUB`` + references never be called from a different VCL. + + ``VRT_call()`` fails the VCL for recursive calls and when the + ``VCL_SUB`` can not be called from the current context + (e.g. calling a subroutine accessing ``req`` from the backend + side). + + ``VRT_check_call()`` can be used to check if a ``VRT_call()`` + would succeed in order to avoid the potential VCL failure. It + returns ``NULL`` if ``VRT_call()`` would make the call or an + error string why not. + VOID C-type: ``void`` diff --git a/include/vrt.h b/include/vrt.h index ffb6d2abc..4071756a7 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -70,6 +70,8 @@ * VRT_re_fini removed * VRT_re_match signature changed * VRT_regsub signature changed + * VRT_call() added + * VRT_check_call() added * 12.0 (2020-09-15) * Added VRT_DirectorResolve() * Added VCL_STRING VRT_BLOB_string(VRT_CTX, VCL_BLOB) @@ -339,13 +341,19 @@ struct vrt_ctx { #define VRT_CTX const struct vrt_ctx *ctx void VRT_CTX_Assert(VRT_CTX); +enum vcl_func_call_e { + VSUB_STATIC, // VCL "call" action, only allowed from VCC + VSUB_DYNAMIC, // VRT_call() + VSUB_CHECK // VRT_check_call() +}; + enum vcl_func_fail_e { VSUB_E_OK, VSUB_E_RECURSE, // call would recurse VSUB_E_METHOD // can not be called from this method }; -typedef void vcl_func_f(VRT_CTX); +typedef void vcl_func_f(VRT_CTX, enum vcl_func_call_e, enum vcl_func_fail_e *); /*********************************************************************** * This is the interface structure to a compiled VMOD @@ -416,6 +424,10 @@ VCL_STRING VRT_StrandsWS(struct ws *, const char *, VCL_STRANDS); VCL_STRING VRT_CollectStrands(VRT_CTX, VCL_STRANDS); VCL_STRING VRT_UpperLowerStrands(VRT_CTX, VCL_STRANDS s, int up); +/* VCL_SUB */ +VCL_STRING VRT_check_call(VRT_CTX, VCL_SUB); +VCL_VOID VRT_call(VRT_CTX, VCL_SUB); + /* Functions to turn types into canonical strings */ VCL_STRING VRT_BACKEND_string(VCL_BACKEND); diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index 45eb278ca..4a7ee7de2 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -53,7 +53,8 @@ vcc_act_call(struct vcc *tl, struct token *t, struct symbol *sym) if (sym != NULL) { vcc_AddCall(tl, t0, sym); VCC_GlobalSymbol(sym, SUB, "VGC_function"); - Fb(tl, 1, "%s(ctx);\n", sym->lname); + + Fb(tl, 1, "%s(ctx, VSUB_STATIC, NULL);\n", sym->lname); SkipToken(tl, ';'); } } diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index e9fb25b8b..df20b6e45 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -171,8 +171,10 @@ static void vcc_EmitProc(struct vcc *tl, struct proc *p) { struct vsb *vsbm; - unsigned mask; + unsigned mask, nsub; const char *maskcmp; + const char *cc_adv; + int dyn = (p->sym->nref > p->called); AN(p->okmask); AZ(VSB_finish(p->cname)); @@ -188,6 +190,13 @@ vcc_EmitProc(struct vcc *tl, struct proc *p) maskcmp = "&"; } + if ((mask & VCL_MET_TASK_H) && (mask & ~VCL_MET_TASK_H) == 0) + cc_adv = "v_dont_optimize "; + else + cc_adv = ""; + + nsub = tl->nsub++; + Fh(tl, 1, "vcl_func_f %s;\n", VSB_data(p->cname)); Fh(tl, 1, "const struct vcl_sub sub_%s[1] = {{\n", VSB_data(p->cname)); @@ -196,14 +205,23 @@ vcc_EmitProc(struct vcc *tl, struct proc *p) Fh(tl, 1, "\t.name\t\t= \"%.*s\",\n", PF(p->name)); Fh(tl, 1, "\t.vcl_conf\t= &VCL_conf,\n"); Fh(tl, 1, "\t.func\t\t= %s,\n", VSB_data(p->cname)); - Fh(tl, 1, "\t.n\t\t= %d,\n", tl->nsub++); + Fh(tl, 1, "\t.n\t\t= %d,\n", nsub); Fh(tl, 1, "\t.nref\t\t= %d,\n", p->sym->nref); Fh(tl, 1, "\t.called\t\t= %d\n", p->called); Fh(tl, 1, "}};\n"); - Fc(tl, 1, "\nvoid %sv_matchproto_(vcl_func_f)\n", - ((mask & VCL_MET_TASK_H) && (mask & ~VCL_MET_TASK_H) == 0) ? - "v_dont_optimize " : ""); - Fc(tl, 1, "%s(VRT_CTX)\n{\n", VSB_data(p->cname)); + + if (dyn) { + Fc(tl, 1, "\nstatic inline void %s\n", cc_adv); + Fc(tl, 1, "%s_checked(VRT_CTX)\n{\n", VSB_data(p->cname)); + } else { + Fc(tl, 1, "\nvoid %sv_matchproto_(vcl_func_f)\n", cc_adv); + Fc(tl, 1, "%s(VRT_CTX, enum vcl_func_call_e call,\n", + VSB_data(p->cname)); + Fc(tl, 1, " enum vcl_func_fail_e *failp)\n{\n"); + Fc(tl, 1, " assert(call == VSUB_STATIC);\n"); + Fc(tl, 1, " assert(failp == NULL);\n"); + } + vsbm = VSB_new_auto(); AN(vsbm); vcc_vcl_met2c(vsbm, mask); @@ -213,6 +231,36 @@ vcc_EmitProc(struct vcc *tl, struct proc *p) Fc(tl, 1, "%s\n%s}\n", VSB_data(p->prologue), VSB_data(p->body)); VSB_destroy(&p->body); VSB_destroy(&p->prologue); + + if (! dyn) { + VSB_destroy(&p->cname); + return; + } + + /* wrapper to call the actual (_checked) function */ + Fc(tl, 1, "\nvoid v_matchproto_(vcl_func_f)\n"); + Fc(tl, 1, "%s(VRT_CTX, enum vcl_func_call_e call,\n", + VSB_data(p->cname)); + Fc(tl, 1, " enum vcl_func_fail_e *failp)\n{\n"); + Fc(tl, 1, " enum vcl_func_fail_e fail;\n\n"); + Fc(tl, 1, " fail = VPI_Call_Check(ctx, &VCL_conf, 0x%x, %d);\n", + mask, nsub); + Fc(tl, 1, " if (failp)\n"); + Fc(tl, 1, " *failp = fail;\n"); + Fc(tl, 1, " else if (fail == VSUB_E_METHOD)\n"); + Fc(tl, 1, " VRT_fail(ctx, \"call to \\\"sub %.*s{}\\\"" + " not allowed from here\");\n", PF(p->name)); + Fc(tl, 1, " else if (fail == VSUB_E_RECURSE)\n"); + Fc(tl, 1, " VRT_fail(ctx, \"Recursive call to " + "\\\"sub %.*s{}\\\"\");\n", PF(p->name)); + Fc(tl, 1, " else\n"); + Fc(tl, 1, " assert (fail == VSUB_E_OK);\n"); + Fc(tl, 1, " if (fail != VSUB_E_OK || call == VSUB_CHECK)\n"); + Fc(tl, 1, " return;\n"); + Fc(tl, 1, " VPI_Call_Begin(ctx, %d);\n", nsub); + Fc(tl, 1, " %s_checked(ctx);\n", VSB_data(p->cname)); + Fc(tl, 1, " VPI_Call_End(ctx, %d);\n", nsub); + Fc(tl, 1, "}\n"); VSB_destroy(&p->cname); } @@ -784,13 +832,13 @@ vcc_CompileSource(struct vcc *tl, struct source *sp, const char *jfile) /* Tie vcl_init/fini in */ ifp = New_IniFin(tl); - VSB_cat(ifp->ini, "\tVGC_function_vcl_init(ctx);\n"); + VSB_cat(ifp->ini, "\tVGC_function_vcl_init(ctx, VSUB_STATIC, NULL);\n"); /* * Because the failure could be half way into vcl_init{} so vcl_fini{} * must always be called, also on failure. */ ifp->ignore_errors = 1; - VSB_cat(ifp->fin, "\t\tVGC_function_vcl_fini(ctx);\n"); + VSB_cat(ifp->fin, "\t\tVGC_function_vcl_fini(ctx, VSUB_STATIC, NULL);\n"); VSB_cat(ifp->fin, "\t\t\tVPI_vcl_fini(ctx);"); /* Emit method functions */ diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py index 8bc43a807..126fc8306 100755 --- a/lib/libvcc/vmodtool.py +++ b/lib/libvcc/vmodtool.py @@ -115,6 +115,7 @@ CTYPES = { 'STRANDS': "VCL_STRANDS", 'STRING': "VCL_STRING", 'STRING_LIST': "const char *, ...", + 'SUB': "VCL_SUB", 'TIME': "VCL_TIME", 'VOID': "VCL_VOID", } From nils.goroll at uplex.de Mon Feb 8 17:52:04 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:04 +0000 (UTC) Subject: [master] 9046707cb Add m00053.vtc: Test dynamic calls Message-ID: <20210208175204.BE2E3114FE4@lists.varnish-cache.org> commit 9046707cb701819fa85d145f24cd5a203f06471c Author: Nils Goroll Date: Sat Feb 6 14:10:01 2021 +0100 Add m00053.vtc: Test dynamic calls This test case checks dynamic calls, and, in particular, the runtime context checks and recursion detection. Recursions have to be caught at the first instance. Also test interop with the PRIV_TOP compile time restriction Ref #3498 Ref 6d49b18f1a7ad612b3c9ba6b3a8a5704fe84ea61 The test has been manually annotated with information regarding the results expted from VCCs call tree walk. Explanation: .called == call, but every walk counts (for instance, barbarbar can be reached twice, via bar and barbar) .nref == sum(refs): Each VCL ref gains a ref, and each call from a sub which is itself dynamic (has nref > called). diff --git a/bin/varnishtest/tests/m00053.vtc b/bin/varnishtest/tests/m00053.vtc new file mode 100644 index 000000000..68034edbc --- /dev/null +++ b/bin/varnishtest/tests/m00053.vtc @@ -0,0 +1,194 @@ +varnishtest "VCL_SUB type basics" + +varnish v1 -vcl { + import std; + import debug; + + backend dummy None; + + # call: 1 ref: 5 + 1 + sub foo { + set resp.http.it = "works"; + } + # call: 1 ref: 1 + 1 (from bar walk) + sub barbar { + # called from bar only, must be marked dynamic + call barbarbar; + } + # call: 2 (1 from bar walk, 1 from barbar walk) + # ref: 2 + 1 + sub barbarbar { + # 2nd level call from dynamic + } + # call: 0 ref: 1 + sub bar { + set beresp.http.it = "works"; + call barbar; + } + # call: 0 ref: 1 + sub indirect { + debug.call(foo); + } + # call: 0 ref: 1 + sub direct { + call foo; + } + # call: 0 ref: 2 + sub recursive { + std.log("recursive called"); + debug.call(recursive); + } + # call: 1 ref: 1 + sub recursive_indirect { + std.log("recursive_indirect called"); + debug.call(recursive_indirect); + } + # call: 1 ref: 1 + sub rollback { + std.rollback(req); + } + # call: 0 ref: 1 + sub priv_top { + debug.test_priv_top("only works on client side"); + } + + sub vcl_recv { + if (req.url == "/wrong") { + debug.call(foo); + } + if (req.url == "/recursive") { + debug.call(recursive); + } + if (req.url == "/recursive_indirect") { + call recursive_indirect; + } + if (req.url == "/priv_top") { + return (pass); + } + return (synth(200)); + } + sub vcl_synth { + if (req.url == "/foo") { + debug.call(foo); + } else if (req.url == "/direct") { + debug.call(direct); + } else if (req.url == "/indirect") { + debug.call(indirect); + } else if (req.url == "/rollback") { + debug.call(rollback); + } else if (req.url == "/callthenrollback") { + debug.call(foo); + call rollback; + if (! resp.http.it) { + set resp.http.rolledback = true; + } + debug.call(foo); + } else if (req.url == "/checkwrong") { + synthetic(debug.check_call(bar)); + set resp.status = 500; + } + return (deliver); + } + sub vcl_backend_fetch { + debug.call(priv_top); + } + sub vcl_backend_error { + # falling through to None backend would be success + set beresp.status = 200; + return (deliver); + } +} -start + +client c1 { + txreq -url "/foo" + rxresp + expect resp.status == 200 + expect resp.http.it == "works" + + txreq -url "/direct" + rxresp + expect resp.status == 200 + expect resp.http.it == "works" + + txreq -url "/indirect" + rxresp + expect resp.status == 200 + expect resp.http.it == "works" + + txreq -url "/callthenrollback" + rxresp + expect resp.status == 200 + expect resp.http.rolledback == "true" + expect resp.http.it == "works" + + txreq -url "/wrong" + rxresp + expect resp.status == 503 +} -start +logexpect l2 -v v1 -g vxid -q {ReqURL ~ "^/recursive$"} { + expect * * VCL_Log "^recursive called" + fail add * VCL_Log "^recursive called" + expect 0 = VCL_Error {^Recursive call to "sub recursive..} + expect 0 = VCL_return "^fail" + expect * = End + fail clear +} -start +client c2 { + txreq -url "/recursive" + rxresp + expect resp.status == 503 +} -start +logexpect l3 -v v1 -g vxid -q {ReqURL ~ "^/recursive_indirect$"} { + expect * * VCL_Log "^recursive_indirect called" + fail add * VCL_Log "^recursive_indirect called" + expect 0 = VCL_Error {^Recursive call to "sub recursive_indirect..} + expect 0 = VCL_return "^fail" + expect * = End + fail clear +} -start +client c3 { + txreq -url "/recursive_indirect" + rxresp + expect resp.status == 503 +} -start +client c4 { + txreq -url "/rollback" + rxresp + expect resp.status == 200 +} -start +client c5 { + txreq -url "/checkwrong" + rxresp + expect resp.status == 500 + expect resp.body == {Dynamic call to "sub bar{}" not allowed from here} +} -start +client c6 { + txreq -url "/priv_top" + rxresp + expect resp.status == 503 +} -start + +varnish v1 -errvcl {Impossible Subroutine('' Line 8 Pos 13)} { + import std; + import debug; + + backend dummy None; + + sub impossible { + set req.http.impossible = beresp.reason; + } + sub vcl_recv { + if (req.url == "/impossible") { + debug.call(impossible); + } + } +} + +client c1 -wait +client c2 -wait +logexpect l2 -wait +client c3 -wait +logexpect l3 -wait +client c4 -wait +client c5 -wait +client c6 -wait diff --git a/vmod/vmod_debug.c b/vmod/vmod_debug.c index 49dd3276c..9d2866de0 100644 --- a/vmod/vmod_debug.c +++ b/vmod/vmod_debug.c @@ -1295,3 +1295,17 @@ xyzzy_just_return_regex(VRT_CTX, VCL_REGEX r) AN(r); return (r); } + +/*---------------------------------------------------------------------*/ + +VCL_VOID v_matchproto_(td_xyzzy_call) +xyzzy_call(VRT_CTX, VCL_SUB sub) +{ + VRT_call(ctx, sub); +} + +VCL_STRING v_matchproto_(td_xyzzy_check_call) +xyzzy_check_call(VRT_CTX, VCL_SUB sub) +{ + return (VRT_check_call(ctx, sub)); +} diff --git a/vmod/vmod_debug.vcc b/vmod/vmod_debug.vcc index 8ee1f27cd..cff0a8867 100644 --- a/vmod/vmod_debug.vcc +++ b/vmod/vmod_debug.vcc @@ -323,3 +323,12 @@ Test if the argument is a valid header according to RFC7230 section 3.2. $Function REGEX just_return_regex(REGEX) Take a REGEX argument and return it. + +$Function STRING check_call(SUB) + +Check if a sub can be called. Returns the NULL string if yes, or a +string saying why not. + +$Function VOID call(SUB) + +Call a sub From nils.goroll at uplex.de Mon Feb 8 17:52:04 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 17:52:04 +0000 (UTC) Subject: [master] af8894525 Add m00054.vtc: panic when calling sub from a wrong vcl Message-ID: <20210208175204.D8332114FE9@lists.varnish-cache.org> commit af8894525e778adb343847de99c00fa23869a5c9 Author: Nils Goroll Date: Sat Feb 6 14:10:30 2021 +0100 Add m00054.vtc: panic when calling sub from a wrong vcl VMODs must not use SUB references across VCLs. This test checks for a panic if they do. diff --git a/bin/varnishtest/tests/m00054.vtc b/bin/varnishtest/tests/m00054.vtc new file mode 100644 index 000000000..87b53f591 --- /dev/null +++ b/bin/varnishtest/tests/m00054.vtc @@ -0,0 +1,36 @@ +varnishtest "VCL_SUB wrong vmod behavior" + +varnish v1 -arg "-p feature=+no_coredump" -vcl { + import debug; + + backend dummy None; + + sub foo { + set resp.http.it = "works"; + } + + sub vcl_init { + debug.bad_memory(foo); + } +} -start + +varnish v1 -vcl { + import debug; + backend dummy None; + + sub vcl_recv { + debug.call(debug.total_recall()); + } + +} + +client c1 { + txreq -url "/foo" + expect_close +} -run + +varnish v1 -wait-stopped +varnish v1 -cliexpect "Assert error in VPI_Call_Check" "panic.show" +varnish v1 -cliok "panic.clear" +varnish v1 -expect MGT.child_panic == 1 +varnish v1 -expectexit 0x40 diff --git a/vmod/vmod_debug.c b/vmod/vmod_debug.c index 9d2866de0..25ce2f76e 100644 --- a/vmod/vmod_debug.c +++ b/vmod/vmod_debug.c @@ -1309,3 +1309,25 @@ xyzzy_check_call(VRT_CTX, VCL_SUB sub) { return (VRT_check_call(ctx, sub)); } + +/* the next two are to test WRONG vmod behavior: + * holding a VCL_SUB reference across vcls + */ + +static VCL_SUB wrong = NULL; + +VCL_VOID v_matchproto_(td_xyzzy_bad_memory) +xyzzy_bad_memory(VRT_CTX, VCL_SUB sub) +{ + (void) ctx; + + wrong = sub; +} + +VCL_SUB v_matchproto_(td_xyzzy_total_recall) +xyzzy_total_recall(VRT_CTX) +{ + (void) ctx; + + return (wrong); +} diff --git a/vmod/vmod_debug.vcc b/vmod/vmod_debug.vcc index cff0a8867..45fc1fdee 100644 --- a/vmod/vmod_debug.vcc +++ b/vmod/vmod_debug.vcc @@ -332,3 +332,11 @@ string saying why not. $Function VOID call(SUB) Call a sub + +$Function VOID bad_memory(SUB) + +To test *WRONG* behavior + +$Function SUB total_recall() + +To test *WRONG* behavior From nils.goroll at uplex.de Mon Feb 8 18:37:06 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 18:37:06 +0000 (UTC) Subject: [master] cdadc4be8 flexelint bba4b145df403f12731a8670cbdd1d38555fad19 Message-ID: <20210208183706.DB83911779A@lists.varnish-cache.org> commit cdadc4be849e737c953e2df8339bd120660ef313 Author: Nils Goroll Date: Mon Feb 8 19:28:54 2021 +0100 flexelint bba4b145df403f12731a8670cbdd1d38555fad19 diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index 4a7ee7de2..160aa9acb 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -332,11 +332,12 @@ vcc_act_return(struct vcc *tl, struct token *t, struct symbol *sym) hand = VCL_RET_MAX; h = NULL; + mask = 0; #define VCL_RET_MAC(l, U, B) \ if (vcc_IdIs(tl->t, #l)) { \ hand = VCL_RET_ ## U; \ h = #U; \ - mask = B; \ + mask = (B); \ } #include "tbl/vcl_returns.h" if (h == NULL) { @@ -345,6 +346,7 @@ vcc_act_return(struct vcc *tl, struct token *t, struct symbol *sym) ERRCHK(tl); } assert(hand < VCL_RET_MAX); + AN(mask); vcc_ProcAction(tl->curproc, hand, mask, tl->t); vcc_NextToken(tl); diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index df20b6e45..cec471f16 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -59,7 +59,6 @@ #include #include #include -#include #include "vcc_compile.h" From nils.goroll at uplex.de Mon Feb 8 18:37:06 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 18:37:06 +0000 (UTC) Subject: [master] 3aff2257e Polish 59034c0101047c86756d3f97c3734162a740da3a Message-ID: <20210208183706.EE78411779D@lists.varnish-cache.org> commit 3aff2257e25ef836fed8446d0e6b30a05b3b4e93 Author: Nils Goroll Date: Mon Feb 8 19:29:15 2021 +0100 Polish 59034c0101047c86756d3f97c3734162a740da3a Based on feedback from Dridi diff --git a/lib/libvcc/vcc_symb.c b/lib/libvcc/vcc_symb.c index 2f8632359..872a8bd47 100644 --- a/lib/libvcc/vcc_symb.c +++ b/lib/libvcc/vcc_symb.c @@ -472,6 +472,7 @@ VCC_GlobalSymbol(struct symbol *sym, vcc_type_t type, const char *pfx) VCC_PrintCName(vsb, sym->name, NULL); AZ(VSB_finish(vsb)); sym->lname = strdup(VSB_data(vsb)); + AN(sym->lname); if (type == SUB) { VSB_destroy(&vsb); vsb = VSB_new_auto(); From nils.goroll at uplex.de Mon Feb 8 19:42:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 19:42:07 +0000 (UTC) Subject: [master] ff18a3c5b Add VRT_handled(), use it in VRT_call() and add red tape... Message-ID: <20210208194207.2850B119638@lists.varnish-cache.org> commit ff18a3c5bf7cf02acaa5bc5672cc90c8bb805336 Author: Nils Goroll Date: Mon Feb 8 20:37:57 2021 +0100 Add VRT_handled(), use it in VRT_call() and add red tape... ... regarding multiple VRT_call()s from vmods. Dridi noticed that we need to consider the handling for VRT_call(), thank you! diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c index aab4b72e9..d674b728a 100644 --- a/bin/varnishd/cache/cache_vrt.c +++ b/bin/varnishd/cache/cache_vrt.c @@ -648,6 +648,14 @@ VRT_handling(VRT_CTX, unsigned hand) *ctx->handling = hand; } +unsigned +VRT_handled(VRT_CTX) +{ + CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); + AN(ctx->handling); + return (*ctx->handling); +} + /*--------------------------------------------------------------------*/ VCL_VOID diff --git a/bin/varnishd/cache/cache_vrt_vcl.c b/bin/varnishd/cache/cache_vrt_vcl.c index 8d20c7848..cda736eaa 100644 --- a/bin/varnishd/cache/cache_vrt_vcl.c +++ b/bin/varnishd/cache/cache_vrt_vcl.c @@ -562,6 +562,7 @@ VRT_call(VRT_CTX, VCL_SUB sub) CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(sub, VCL_SUB_MAGIC); + AZ(VRT_handled(ctx)); AN(sub->func); sub->func(ctx, VSUB_DYNAMIC, NULL); } diff --git a/doc/changes.rst b/doc/changes.rst index e98abd650..ceee8cd1d 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -62,6 +62,8 @@ Varnish Cache Next (2021-03-15) subroutine accessing ``req`` from the backend side) and recursive calls fail the VCL. + See :ref:`ref-vmod` for details. + * ``VRT_check_call()`` can be used to check if a ``VRT_call()`` would succeed in order to avoid the potential VCL failure in case it would not. diff --git a/doc/sphinx/reference/vmod.rst b/doc/sphinx/reference/vmod.rst index 8eb6baa8a..44499496a 100644 --- a/doc/sphinx/reference/vmod.rst +++ b/doc/sphinx/reference/vmod.rst @@ -475,6 +475,14 @@ VCL_SUB (e.g. calling a subroutine accessing ``req`` from the backend side). + For more than one invocation of ``VRT_call()``, VMODs *must* + check if ``VRT_handled()`` returns non-zero inbetween calls: + The called SUB may have returned with an action (any + ``return(x)`` other than plain ``return``) or may have failed + the VCL, and in both cases the calling VMOD *must* return + also, possibly after having conducted some cleanup. Note that + undoing the handling through ``VRT_handling()`` is a bug. + ``VRT_check_call()`` can be used to check if a ``VRT_call()`` would succeed in order to avoid the potential VCL failure. It returns ``NULL`` if ``VRT_call()`` would make the call or an diff --git a/include/vrt.h b/include/vrt.h index 4071756a7..08d217dd8 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -72,6 +72,7 @@ * VRT_regsub signature changed * VRT_call() added * VRT_check_call() added + * VRT_handled() added * 12.0 (2020-09-15) * Added VRT_DirectorResolve() * Added VCL_STRING VRT_BLOB_string(VRT_CTX, VCL_BLOB) @@ -566,6 +567,7 @@ VCL_VOID VRT_hit_for_pass(VRT_CTX, VCL_DURATION); VCL_BOOL VRT_ValidHdr(VRT_CTX, VCL_STRANDS); VCL_VOID VRT_SetHdr(VRT_CTX, VCL_HEADER, const char *, ...); VCL_VOID VRT_handling(VRT_CTX, unsigned hand); +unsigned VRT_handled(VRT_CTX); VCL_VOID VRT_fail(VRT_CTX, const char *fmt, ...) v_printflike_(2,3); VCL_VOID VRT_hashdata(VRT_CTX, VCL_STRANDS); From nils.goroll at uplex.de Mon Feb 8 19:48:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 8 Feb 2021 19:48:07 +0000 (UTC) Subject: [master] 8cddd051b fix changelog oops Message-ID: <20210208194807.BA1F7119A13@lists.varnish-cache.org> commit 8cddd051b483ad17aff0a925b696cca370e17f01 Author: Nils Goroll Date: Mon Feb 8 20:46:46 2021 +0100 fix changelog oops We cannot :ref: the rest of the online documentation from here diff --git a/doc/changes.rst b/doc/changes.rst index ceee8cd1d..a21ad8580 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -62,7 +62,9 @@ Varnish Cache Next (2021-03-15) subroutine accessing ``req`` from the backend side) and recursive calls fail the VCL. - See :ref:`ref-vmod` for details. + See `VMOD - Varnish Modules`_ in the Reference Manual. + +.. _VMOD - Varnish Modules: https://varnish-cache.org/docs/trunk/reference/vmod.html * ``VRT_check_call()`` can be used to check if a ``VRT_call()`` would succeed in order to avoid the potential VCL failure in case it would From nils.goroll at uplex.de Tue Feb 9 16:15:09 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 9 Feb 2021 16:15:09 +0000 (UTC) Subject: [master] a865c773b Start a semantic patch archive Message-ID: <20210209161509.7BE61113EE2@lists.varnish-cache.org> commit a865c773b343cf48d7147594d3beb4c84c5f0278 Author: Nils Goroll Date: Tue Feb 9 16:54:03 2021 +0100 Start a semantic patch archive Move patches there which are not intended to be applied again, but which we used once and want to keep for reference. Also another coccinelle script which I found useful at one point. diff --git a/tools/coccinelle/README.rst b/tools/coccinelle/README.rst index 0c9c06d9e..e51e5741d 100644 --- a/tools/coccinelle/README.rst +++ b/tools/coccinelle/README.rst @@ -10,4 +10,7 @@ Unless noted otherwise, all patches should work when invoked as:: -I include/ -I bin/varnishd/ --dir . --in-place \ --sp-file $COCCI +The ``archive/`` directory contains patches which we used once and +should not need again, but want to retain for reference. + .. _coccinelle: http://coccinelle.lip6.fr/ diff --git a/tools/coccinelle/archive/vdp.cocci b/tools/coccinelle/archive/vdp.cocci new file mode 100644 index 000000000..6351ded3d --- /dev/null +++ b/tools/coccinelle/archive/vdp.cocci @@ -0,0 +1,31 @@ +/* + * facilitate second half of phks vdp signature overhaul + */ + +@@ +expression req; +@@ + +-VDP_Close(req) ++VDP_Close(req->vdc) + +@@ +expression req; +@@ + +-VDP_DeliverObj(req) ++VDP_DeliverObj(req->vdc, req->objcore) + +@@ +expression req, vdp, priv; +@@ + +-VDP_Push(req, vdp, priv) ++VDP_Push(req->vdc, req->ws, vdp, priv) + +@@ +expression req, vdp, priv; +@@ + +-VDP_Push(req, &vdp, priv) ++VDP_Push(req->vdc, req->ws, &vdp, priv) diff --git a/tools/coccinelle/vsb_tofile.cocci b/tools/coccinelle/archive/vsb_tofile.cocci similarity index 100% rename from tools/coccinelle/vsb_tofile.cocci rename to tools/coccinelle/archive/vsb_tofile.cocci diff --git a/tools/coccinelle/ws_reserve.cocci b/tools/coccinelle/archive/ws_reserve.cocci similarity index 100% rename from tools/coccinelle/ws_reserve.cocci rename to tools/coccinelle/archive/ws_reserve.cocci From nils.goroll at uplex.de Tue Feb 9 16:15:09 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 9 Feb 2021 16:15:09 +0000 (UTC) Subject: [master] c108e6031 Re-apply tools/coccinelle/check_obj.cocci Message-ID: <20210209161509.B8D9D113EE6@lists.varnish-cache.org> commit c108e603141bd8270090a91fec880d1a2805d56c Author: Nils Goroll Date: Tue Feb 9 16:51:27 2021 +0100 Re-apply tools/coccinelle/check_obj.cocci After edb0ca9863431dc8ccc6c37e779c179fc29f53cf, the ladybug understands our code better. diff --git a/bin/varnishd/cache/cache_mempool.c b/bin/varnishd/cache/cache_mempool.c index abd5d5daa..b6d69bd61 100644 --- a/bin/varnishd/cache/cache_mempool.c +++ b/bin/varnishd/cache/cache_mempool.c @@ -191,7 +191,7 @@ mpl_guard(void *priv) if (mi == NULL) { mi = VTAILQ_FIRST(&mpl->surplus); if (mi != NULL) { - CHECK_OBJ_NOTNULL(mi, MEMITEM_MAGIC); + CHECK_OBJ(mi, MEMITEM_MAGIC); VTAILQ_REMOVE(&mpl->surplus, mi, list); mpl_slp = .01; // random } diff --git a/bin/varnishd/cache/cache_vrt_priv.c b/bin/varnishd/cache/cache_vrt_priv.c index 3aa166514..02ba46bdd 100644 --- a/bin/varnishd/cache/cache_vrt_priv.c +++ b/bin/varnishd/cache/cache_vrt_priv.c @@ -166,11 +166,11 @@ vrt_priv_task_context(VRT_CTX) ctx->method == VCL_MET_PIPE || ctx->method == 0); if (ctx->req) { - CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); + CHECK_OBJ(ctx->req, REQ_MAGIC); return (ctx->req->privs); } if (ctx->bo) { - CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC); + CHECK_OBJ(ctx->bo, BUSYOBJ_MAGIC); return (ctx->bo->privs); } ASSERT_CLI(); diff --git a/bin/varnishd/cache/cache_vrt_vcl.c b/bin/varnishd/cache/cache_vrt_vcl.c index cda736eaa..b7ecdd7ff 100644 --- a/bin/varnishd/cache/cache_vrt_vcl.c +++ b/bin/varnishd/cache/cache_vrt_vcl.c @@ -457,7 +457,7 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo, CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); INIT_OBJ(&ctx, VRT_CTX_MAGIC); if (bo != NULL) { - CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); + CHECK_OBJ(bo, BUSYOBJ_MAGIC); CHECK_OBJ_NOTNULL(bo->vcl, VCL_MAGIC); VCL_Bo2Ctx(&ctx, bo); } diff --git a/vmod/vmod_std.c b/vmod/vmod_std.c index 1cf60162c..bb24e04ce 100644 --- a/vmod/vmod_std.c +++ b/vmod/vmod_std.c @@ -224,7 +224,7 @@ vmod_timestamp(VRT_CTX, VCL_STRING label) VSLb_ts_busyobj(ctx->bo, label, VTIM_real()); } else if (ctx->req != NULL) { /* Called from request vcl methods */ - CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); + CHECK_OBJ(ctx->req, REQ_MAGIC); VSLb_ts_req(ctx->req, label, VTIM_real()); } } From nils.goroll at uplex.de Tue Feb 9 16:15:09 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 9 Feb 2021 16:15:09 +0000 (UTC) Subject: [master] bca23a016 re-apply tools/coccinelle/free_obj.cocci Message-ID: <20210209161509.DC6E6113EE9@lists.varnish-cache.org> commit bca23a0160b1d09daa9ed4a6bf045d7f4223cd14 Author: Nils Goroll Date: Tue Feb 9 17:01:44 2021 +0100 re-apply tools/coccinelle/free_obj.cocci Missing include for REPLACE() / memset() added manually. diff --git a/bin/varnishd/cache/cache_conn_pool.c b/bin/varnishd/cache/cache_conn_pool.c index 23b8d4912..21fcab862 100644 --- a/bin/varnishd/cache/cache_conn_pool.c +++ b/bin/varnishd/cache/cache_conn_pool.c @@ -247,7 +247,7 @@ VCP_Rel(struct conn_pool **cpp) AZ(cp->n_conn); AZ(cp->n_kill); free(cp->endpoint); - free(cp); + FREE_OBJ(cp); } /*-------------------------------------------------------------------- diff --git a/bin/varnishd/storage/storage_malloc.c b/bin/varnishd/storage/storage_malloc.c index b04f7bf64..ec99c1738 100644 --- a/bin/varnishd/storage/storage_malloc.c +++ b/bin/varnishd/storage/storage_malloc.c @@ -150,7 +150,7 @@ sma_free(struct storage *s) sma_sc->stats->g_space += sma->sz; Lck_Unlock(&sma_sc->sma_mtx); free(sma->s.ptr); - free(sma); + FREE_OBJ(sma); } static VCL_BYTES v_matchproto_(stv_var_used_space) diff --git a/lib/libvarnish/vbh.c b/lib/libvarnish/vbh.c index b8417eb87..073de5e0a 100644 --- a/lib/libvarnish/vbh.c +++ b/lib/libvarnish/vbh.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "miniobj.h" #include "vdef.h" @@ -256,7 +257,7 @@ VBH_destroy(struct vbh **bhp) for (u = 0; u < bh->length; u += ROW_WIDTH) free(ROW(bh, u)); free(bh->array); - free(bh); + FREE_OBJ(bh); } static void From nils.goroll at uplex.de Tue Feb 9 16:15:10 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 9 Feb 2021 16:15:10 +0000 (UTC) Subject: [master] 008e2eaf6 re-apply tools/coccinelle/printf_nofmt.cocci Message-ID: <20210209161510.21244113EEF@lists.varnish-cache.org> commit 008e2eaf6d097d2482a2de304c296363888b4303 Author: Nils Goroll Date: Tue Feb 9 17:01:47 2021 +0100 re-apply tools/coccinelle/printf_nofmt.cocci diff --git a/bin/varnishd/cache/cache_conn_pool.c b/bin/varnishd/cache/cache_conn_pool.c index 21fcab862..c8d39e21d 100644 --- a/bin/varnishd/cache/cache_conn_pool.c +++ b/bin/varnishd/cache/cache_conn_pool.c @@ -558,9 +558,9 @@ VCP_Panic(struct vsb *vsb, struct conn_pool *cp) if (PAN_dump_struct(vsb, cp, CONN_POOL_MAGIC, "conn_pool")) return; - VSB_printf(vsb, "ident = "); + VSB_cat(vsb, "ident = "); VSB_quote(vsb, cp->ident, VSHA256_DIGEST_LENGTH, VSB_QUOTE_HEX); - VSB_printf(vsb, ",\n"); + VSB_cat(vsb, ",\n"); vcp_panic_endpoint(vsb, cp->endpoint); VSB_indent(vsb, -2); VSB_cat(vsb, "},\n"); diff --git a/bin/varnishd/cache/cache_director.c b/bin/varnishd/cache/cache_director.c index 595265f55..c6fd40d96 100644 --- a/bin/varnishd/cache/cache_director.c +++ b/bin/varnishd/cache/cache_director.c @@ -354,7 +354,7 @@ do_list(struct cli *cli, struct director *d, void *priv) if (la->p && d->vdir->methods->list != NULL) d->vdir->methods->list(ctx, d, la->vsb, la->p, 0); - VSB_printf(la->vsb, "\n"); + VSB_cat(la->vsb, "\n"); AZ(VCL_Rel_CliCtx(&ctx)); AZ(ctx); diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c index 8331d5f23..63f605a05 100644 --- a/bin/varnishd/cache/cache_panic.c +++ b/bin/varnishd/cache/cache_panic.c @@ -122,7 +122,7 @@ PAN_dump_struct2(struct vsb *vsb, int block, const void *ptr, VSB_vprintf(vsb, fmt, ap); va_end(ap); if (ptr == NULL) { - VSB_printf(vsb, " = NULL\n"); + VSB_cat(vsb, " = NULL\n"); return (-1); } VSB_printf(vsb, " = %p {", ptr); @@ -145,7 +145,7 @@ PAN_dump_struct2(struct vsb *vsb, int block, const void *ptr, VSB_printf(vsb, " EXPECTED: %s=0x%08x", smagic, magic); if (block) VSB_putc(vsb, '\n'); - VSB_printf(vsb, "}\n"); + VSB_cat(vsb, "}\n"); return (-3); } if (block) @@ -692,7 +692,7 @@ pan_argv(struct vsb *vsb) { int i; - VSB_printf(pan_vsb, "argv = {\n"); + VSB_cat(pan_vsb, "argv = {\n"); VSB_indent(vsb, 2); for (i = 0; i < heritage.argc; i++) { VSB_printf(vsb, "[%d] = ", i); diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c index 7cc42b0cd..1bab08f36 100644 --- a/bin/varnishd/cache/cache_pool.c +++ b/bin/varnishd/cache/cache_pool.c @@ -245,7 +245,7 @@ pan_pool(struct vsb *vsb) { struct pool *pp; - VSB_printf(vsb, "pools = {\n"); + VSB_cat(vsb, "pools = {\n"); VSB_indent(vsb, 2); VTAILQ_FOREACH(pp, &pools, list) { if (PAN_dump_struct(vsb, pp, POOL_MAGIC, "pool")) @@ -254,10 +254,10 @@ pan_pool(struct vsb *vsb) VSB_printf(vsb, "nthr = %u,\n", pp->nthr); VSB_printf(vsb, "lqueue = %u\n", pp->lqueue); VSB_indent(vsb, -2); - VSB_printf(vsb, "},\n"); + VSB_cat(vsb, "},\n"); } VSB_indent(vsb, -2); - VSB_printf(vsb, "},\n"); + VSB_cat(vsb, "},\n"); } /*--------------------------------------------------------------------*/ diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c index abc41de2c..2ecbc8c3c 100644 --- a/bin/varnishd/cache/cache_vcl.c +++ b/bin/varnishd/cache/cache_vcl.c @@ -783,7 +783,7 @@ vcl_cli_list(struct cli *cli, const char * const *av, void *priv) VSB_printf(vsb, "\t<-\t(%d label%s)", vcl->nlabels, vcl->nlabels > 1 ? "s" : ""); } - VSB_printf(vsb, "\n"); + VSB_cat(vsb, "\n"); } VCLI_VTE(cli, &vsb, 80); } diff --git a/bin/varnishd/cache/cache_vrt_priv.c b/bin/varnishd/cache/cache_vrt_priv.c index 02ba46bdd..99c67c7dc 100644 --- a/bin/varnishd/cache/cache_vrt_priv.c +++ b/bin/varnishd/cache/cache_vrt_priv.c @@ -65,7 +65,7 @@ pan_privs(struct vsb *vsb, const struct vrt_privs *privs) const struct vmod_priv_methods *m; if (privs == NULL) { - VSB_printf(vsb, "privs = NULL\n"); + VSB_cat(vsb, "privs = NULL\n"); return; } VSB_printf(vsb, "privs = %p {\n", privs); diff --git a/bin/varnishd/mgt/mgt_vcl.c b/bin/varnishd/mgt/mgt_vcl.c index f4f7f7f23..3e978661b 100644 --- a/bin/varnishd/mgt/mgt_vcl.c +++ b/bin/varnishd/mgt/mgt_vcl.c @@ -841,7 +841,7 @@ mcf_vcl_list(struct cli *cli, const char * const *av, void *priv) VSB_printf(vsb, "\t<-\t(%d label%s)", vp->nto, vp->nto > 1 ? "s" : ""); } - VSB_printf(vsb, "\n"); + VSB_cat(vsb, "\n"); } VCLI_VTE(cli, &vsb, 80); } diff --git a/lib/libvcc/vcc_acl.c b/lib/libvcc/vcc_acl.c index 35573eb3f..b8e5d90d5 100644 --- a/lib/libvcc/vcc_acl.c +++ b/lib/libvcc/vcc_acl.c @@ -138,7 +138,7 @@ vcc_acl_chk(struct vcc *tl, const struct acl_e *ae, const int l, AN(sa); VTCP_name(sa, h, sizeof h, NULL, 0); bprintf(t, "%s/%d", h, ae->mask); - VSB_printf(tl->sb, "Address/Netmask mismatch, "); + VSB_cat(tl->sb, "Address/Netmask mismatch, "); if (tl->acl_pedantic != 0) VSB_printf(tl->sb, "need be %s\n", t); else diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index 160aa9acb..95c565d87 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -168,7 +168,7 @@ vcc_act_unset(struct vcc *tl, struct token *t, struct symbol *sym) AN(sym); if (sym->u_methods == 0) { vcc_ErrWhere2(tl, t, tl->t); - VSB_printf(tl->sb, "Variable cannot be unset.\n"); + VSB_cat(tl->sb, "Variable cannot be unset.\n"); return; } vcc_AddUses(tl, t, tl->t, sym, XREF_UNSET); @@ -341,7 +341,7 @@ vcc_act_return(struct vcc *tl, struct token *t, struct symbol *sym) } #include "tbl/vcl_returns.h" if (h == NULL) { - VSB_printf(tl->sb, "Expected return action name.\n"); + VSB_cat(tl->sb, "Expected return action name.\n"); vcc_ErrWhere(tl, tl->t); ERRCHK(tl); } @@ -360,12 +360,12 @@ vcc_act_return(struct vcc *tl, struct token *t, struct symbol *sym) else if (hand == VCL_RET_FAIL) vcc_act_return_fail(tl); else { - VSB_printf(tl->sb, "Arguments not allowed.\n"); + VSB_cat(tl->sb, "Arguments not allowed.\n"); vcc_ErrWhere(tl, tl->t); } } else { if (hand == VCL_RET_SYNTH || hand == VCL_RET_VCL) { - VSB_printf(tl->sb, "Missing argument.\n"); + VSB_cat(tl->sb, "Missing argument.\n"); vcc_ErrWhere(tl, tl->t); } } diff --git a/lib/libvcc/vcc_backend.c b/lib/libvcc/vcc_backend.c index d61e973d9..e776f794c 100644 --- a/lib/libvcc/vcc_backend.c +++ b/lib/libvcc/vcc_backend.c @@ -83,7 +83,7 @@ Emit_Sockaddr(struct vcc *tl, struct vsb *vsb1, const struct token *t_host, "\t.ipv6 = (const struct suckaddr *)%s,\n", ipv6); } - VSB_printf(vsb1, "\t.uds_path = (void *) 0,\n"); + VSB_cat(vsb1, "\t.uds_path = (void *) 0,\n"); } /* @@ -122,8 +122,8 @@ Emit_UDS_Path(struct vcc *tl, struct vsb *vsb1, return; } VSB_printf(vsb1, "\t.uds_path = \"%s\",\n", t_path->dec); - VSB_printf(vsb1, "\t.ipv4 = (void *) 0,\n"); - VSB_printf(vsb1, "\t.ipv6 = (void *) 0,\n"); + VSB_cat(vsb1, "\t.ipv4 = (void *) 0,\n"); + VSB_cat(vsb1, "\t.ipv6 = (void *) 0,\n"); } /*-------------------------------------------------------------------- @@ -530,7 +530,7 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be, const char *vgcname) VSB_printf(vsb1, "\nstatic const struct vrt_endpoint vgc_dir_ep_%s = {\n", vgcname); - VSB_printf(vsb1, "\t.magic = VRT_ENDPOINT_MAGIC,\n"); + VSB_cat(vsb1, "\t.magic = VRT_ENDPOINT_MAGIC,\n"); assert(t_host != NULL || t_path != NULL); if (t_host != NULL) @@ -544,7 +544,7 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be, const char *vgcname) if (t_preamble != NULL) VSB_printf(vsb1, "\t.preamble = %s,\n", t_preamble->dec); - VSB_printf(vsb1, "};\n"); + VSB_cat(vsb1, "};\n"); AZ(VSB_finish(vsb1)); Fh(tl, 0, "%s", VSB_data(vsb1)); VSB_destroy(&vsb1); diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c index f44a868ab..c15203caf 100644 --- a/lib/libvcc/vcc_expr.c +++ b/lib/libvcc/vcc_expr.c @@ -1433,7 +1433,7 @@ vcc_Act_Call(struct vcc *tl, struct token *t, struct symbol *sym) SkipToken(tl, ';'); VSB_cat(tl->fb, ";\n"); } else if (t != tl->t) { - VSB_printf(tl->sb, "While compiling function call:\n\n"); + VSB_cat(tl->sb, "While compiling function call:\n\n"); vcc_ErrWhere2(tl, t, tl->t); } vcc_delete_expr(e); @@ -1518,8 +1518,7 @@ vcc_Eval_Default(struct vcc *tl, struct expr **e, struct token *t, else if (fmt == BACKEND) *e = vcc_mk_expr(BACKEND, "*(VCL_conf.default_director)"); else { - VSB_printf(tl->sb, - "Symbol 'default' is a reserved word.\n"); + VSB_cat(tl->sb, "Symbol 'default' is a reserved word.\n"); vcc_ErrWhere(tl, t); } } diff --git a/lib/libvcc/vcc_xref.c b/lib/libvcc/vcc_xref.c index 83dec7461..105f45698 100644 --- a/lib/libvcc/vcc_xref.c +++ b/lib/libvcc/vcc_xref.c @@ -275,7 +275,7 @@ vcc_illegal_write(struct vcc *tl, struct procuse *pu, const struct method *m) if (pu->sym->r_methods == 0) { vcc_ErrWhere2(tl, pu->t1, pu->t2); - VSB_printf(tl->sb, "Variable cannot be set.\n"); + VSB_cat(tl->sb, "Variable cannot be set.\n"); return (NULL); } @@ -285,7 +285,7 @@ vcc_illegal_write(struct vcc *tl, struct procuse *pu, const struct method *m) } vcc_ErrWhere2(tl, pu->t1, pu->t2); - VSB_printf(tl->sb, "Variable is read only.\n"); + VSB_cat(tl->sb, "Variable is read only.\n"); return (NULL); } From nils.goroll at uplex.de Tue Feb 9 16:15:10 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 9 Feb 2021 16:15:10 +0000 (UTC) Subject: [master] 6f4d0ec16 re-apply tools/coccinelle/replace.cocci Message-ID: <20210209161510.447B5113EF2@lists.varnish-cache.org> commit 6f4d0ec16741468e6ff1842cc6dcfcdcfc36c3cf Author: Nils Goroll Date: Tue Feb 9 17:01:50 2021 +0100 re-apply tools/coccinelle/replace.cocci diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c index 017c53950..87c58e7f5 100644 --- a/bin/varnishtest/vtc.c +++ b/bin/varnishtest/vtc.c @@ -111,13 +111,11 @@ macro_def_int(const char *name, const char *fmt, va_list ap) ALLOC_OBJ(m, MACRO_MAGIC); AN(m); REPLACE(m->name, name); - AN(m->name); VTAILQ_INSERT_TAIL(¯o_list, m, list); } AN(m); vbprintf(buf, fmt, ap); REPLACE(m->val, buf); - AN(m->val); return (m); } diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c index dc286066a..81c5c516a 100644 --- a/bin/varnishtest/vtc_http.c +++ b/bin/varnishtest/vtc_http.c @@ -807,7 +807,6 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp, assert(body == nullbody); REPLACE(body, av[1]); - AN(body); av++; bodylen = strlen(body); for (b = body; *b != '\0'; b++) { diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c index f2deff037..b37ae0874 100644 --- a/bin/varnishtest/vtc_http2.c +++ b/bin/varnishtest/vtc_http2.c @@ -1548,7 +1548,6 @@ cmd_tx11obj(CMD_ARGS) if (AV_IS("-body")) { AZ(body); REPLACE(body, av[1]); - AN(body); bodylen = strlen(body); f.flags &= ~END_STREAM; av++; @@ -2580,7 +2579,6 @@ stream_new(const char *name, struct http *h) AN(s); AZ(pthread_cond_init(&s->cond, NULL)); REPLACE(s->name, name); - AN(s->name); VTAILQ_INIT(&s->fq); s->ws = h->iws; s->vl = vtc_logopen("%s.%s", h->sess->name, name); From nils.goroll at uplex.de Tue Feb 9 16:15:10 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 9 Feb 2021 16:15:10 +0000 (UTC) Subject: [master] 697999c1e re-apply tools/coccinelle/vcc_skip_token.cocci Message-ID: <20210209161510.5EAF9113EF6@lists.varnish-cache.org> commit 697999c1e84fbf585743015dbbf2195719aa234d Author: Nils Goroll Date: Tue Feb 9 17:02:15 2021 +0100 re-apply tools/coccinelle/vcc_skip_token.cocci diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index 95c565d87..eb0458bc3 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -185,8 +185,7 @@ vcc_act_ban(struct vcc *tl, struct token *t, struct symbol *sym) (void)t; (void)sym; - ExpectErr(tl, '('); - vcc_NextToken(tl); + SkipToken(tl, '('); Fb(tl, 1, "(void) VRT_ban_string(ctx, \n"); tl->indent += INDENT; From nils.goroll at uplex.de Tue Feb 9 16:27:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 9 Feb 2021 16:27:07 +0000 (UTC) Subject: [master] e763385e5 Add an ipv6 bogo ip by the name bogo_ip6 Message-ID: <20210209162707.51EB8114CB6@lists.varnish-cache.org> commit e763385e5786d3b2ff58864835162e922c25af53 Author: Nils Goroll Date: Sat Mar 23 16:10:47 2019 +0100 Add an ipv6 bogo ip by the name bogo_ip6 to slim down one of my PRs with a trivial addition which, I hope, will not be controversial. diff --git a/include/vsa.h b/include/vsa.h index e9fd9108a..7b7ffb55e 100644 --- a/include/vsa.h +++ b/include/vsa.h @@ -35,6 +35,7 @@ struct suckaddr; extern const size_t vsa_suckaddr_len; extern const struct suckaddr *bogo_ip; +extern const struct suckaddr *bogo_ip6; void VSA_Init(void); int VSA_Sane(const struct suckaddr *); diff --git a/lib/libvarnish/vsa.c b/lib/libvarnish/vsa.c index 85a3e6785..57287b60d 100644 --- a/lib/libvarnish/vsa.c +++ b/lib/libvarnish/vsa.c @@ -183,11 +183,15 @@ const size_t vsa_suckaddr_len = sizeof(struct suckaddr); */ static struct suckaddr bogo_ip_vsa; const struct suckaddr *bogo_ip = &bogo_ip_vsa; +/* same in IPv6 */ +static struct suckaddr bogo_ip6_vsa; +const struct suckaddr *bogo_ip6 = &bogo_ip6_vsa; void VSA_Init() { AN(VSA_BuildFAP(&bogo_ip_vsa, PF_INET, NULL, 0, NULL, 0)); + AN(VSA_BuildFAP(&bogo_ip6_vsa, PF_INET6, NULL, 0, NULL, 0)); } /* From nils.goroll at uplex.de Tue Feb 9 16:36:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 9 Feb 2021 16:36:07 +0000 (UTC) Subject: [master] 98e43c049 Polish Message-ID: <20210209163607.D24E31151E8@lists.varnish-cache.org> commit 98e43c049ccd9259d0ea6afd68d8ca6851a1fd8e Author: Nils Goroll Date: Tue Feb 9 17:32:55 2021 +0100 Polish diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c index 16e7a1258..1d29817c9 100644 --- a/bin/varnishd/cache/cache_backend.c +++ b/bin/varnishd/cache/cache_backend.c @@ -589,8 +589,7 @@ VRT_new_backend_clustered(VRT_CTX, struct vsmw_cluster *vc, return (NULL); Lck_New(&be->mtx, lck_backend); - be->endpoint = VRT_Endpoint_Clone(vrt->endpoint); - vep = be->endpoint; + vep = be->endpoint = VRT_Endpoint_Clone(vep); #define DA(x) do { if (vrt->x != NULL) REPLACE((be->x), (vrt->x)); } while (0) #define DN(x) do { be->x = vrt->x; } while (0) VRT_BACKEND_HANDLE(); From nils.goroll at uplex.de Tue Feb 9 18:40:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 9 Feb 2021 18:40:07 +0000 (UTC) Subject: [master] 897e5313a flexelint 6f4d0ec16741468e6ff1842cc6dcfcdcfc36c3cf Message-ID: <20210209184007.D1D4C1188C9@lists.varnish-cache.org> commit 897e5313ac1615d65ed51b6419995ecb926c3f49 Author: Nils Goroll Date: Tue Feb 9 19:39:04 2021 +0100 flexelint 6f4d0ec16741468e6ff1842cc6dcfcdcfc36c3cf diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c index 81c5c516a..a5f32a4cf 100644 --- a/bin/varnishtest/vtc_http.c +++ b/bin/varnishtest/vtc_http.c @@ -805,6 +805,7 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp, for (; *av != NULL; av++) { if (!strcmp(*av, "-body")) { assert(body == nullbody); + AN(av[1]); REPLACE(body, av[1]); av++; diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c index b37ae0874..0d6d4b5bd 100644 --- a/bin/varnishtest/vtc_http2.c +++ b/bin/varnishtest/vtc_http2.c @@ -1547,6 +1547,7 @@ cmd_tx11obj(CMD_ARGS) else if (CMD_IS("txreq") || CMD_IS("txresp")) { if (AV_IS("-body")) { AZ(body); + AN(av[1]); REPLACE(body, av[1]); bodylen = strlen(body); f.flags &= ~END_STREAM; From nils.goroll at uplex.de Wed Feb 10 08:32:08 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 10 Feb 2021 08:32:08 +0000 (UTC) Subject: [master] cb95b6af4 Revert "re-apply tools/coccinelle/replace.cocci" Message-ID: <20210210083208.99975106A52@lists.varnish-cache.org> commit cb95b6af4a99e7cc185f171835ade80ed4374ea0 Author: Nils Goroll Date: Wed Feb 10 09:28:36 2021 +0100 Revert "re-apply tools/coccinelle/replace.cocci" Either flexelint or me, probabbly the latter, do not understand the code. As far as I am concerned, I would have thought that flexelint could follow for AN(y); REPLACE(x, y); x being guranteed to be non-NULL This reverts commit 897e5313ac1615d65ed51b6419995ecb926c3f49. This reverts commit 6f4d0ec16741468e6ff1842cc6dcfcdcfc36c3cf. diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c index 87c58e7f5..017c53950 100644 --- a/bin/varnishtest/vtc.c +++ b/bin/varnishtest/vtc.c @@ -111,11 +111,13 @@ macro_def_int(const char *name, const char *fmt, va_list ap) ALLOC_OBJ(m, MACRO_MAGIC); AN(m); REPLACE(m->name, name); + AN(m->name); VTAILQ_INSERT_TAIL(¯o_list, m, list); } AN(m); vbprintf(buf, fmt, ap); REPLACE(m->val, buf); + AN(m->val); return (m); } diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c index a5f32a4cf..dc286066a 100644 --- a/bin/varnishtest/vtc_http.c +++ b/bin/varnishtest/vtc_http.c @@ -805,9 +805,9 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp, for (; *av != NULL; av++) { if (!strcmp(*av, "-body")) { assert(body == nullbody); - AN(av[1]); REPLACE(body, av[1]); + AN(body); av++; bodylen = strlen(body); for (b = body; *b != '\0'; b++) { diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c index 0d6d4b5bd..f2deff037 100644 --- a/bin/varnishtest/vtc_http2.c +++ b/bin/varnishtest/vtc_http2.c @@ -1547,8 +1547,8 @@ cmd_tx11obj(CMD_ARGS) else if (CMD_IS("txreq") || CMD_IS("txresp")) { if (AV_IS("-body")) { AZ(body); - AN(av[1]); REPLACE(body, av[1]); + AN(body); bodylen = strlen(body); f.flags &= ~END_STREAM; av++; @@ -2580,6 +2580,7 @@ stream_new(const char *name, struct http *h) AN(s); AZ(pthread_cond_init(&s->cond, NULL)); REPLACE(s->name, name); + AN(s->name); VTAILQ_INIT(&s->fq); s->ws = h->iws; s->vl = vtc_logopen("%s.%s", h->sess->name, name); From nils.goroll at uplex.de Wed Feb 10 09:06:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 10 Feb 2021 09:06:07 +0000 (UTC) Subject: [master] 030ce0a00 Rein replace.cocci Message-ID: <20210210090608.0B046107920@lists.varnish-cache.org> commit 030ce0a0047c735bebb5a013d51a813c0be94f90 Author: Nils Goroll Date: Wed Feb 10 09:34:13 2021 +0100 Rein replace.cocci diff --git a/tools/coccinelle/replace.cocci b/tools/coccinelle/replace.cocci index 706b28482..f70b7aeb8 100644 --- a/tools/coccinelle/replace.cocci +++ b/tools/coccinelle/replace.cocci @@ -10,10 +10,3 @@ expression ptr, val; - ptr = strdup(val); - AN(ptr); + REPLACE(ptr, val); - -@@ -expression ptr, val; -@@ - -REPLACE(ptr, val); -- AN(ptr); From nils.goroll at uplex.de Wed Feb 10 09:06:08 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 10 Feb 2021 09:06:08 +0000 (UTC) Subject: [master] c40d55571 re-apply tools/coccinelle/return.cocci Message-ID: <20210210090608.2AC3B107923@lists.varnish-cache.org> commit c40d555710336c78436e3da300936f4fcf6bce4e Author: Nils Goroll Date: Wed Feb 10 09:34:57 2021 +0100 re-apply tools/coccinelle/return.cocci with manual polish for cstyle and un-doing some return ((x)). diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c index 1d29817c9..4c5255d37 100644 --- a/bin/varnishd/cache/cache_backend.c +++ b/bin/varnishd/cache/cache_backend.c @@ -509,7 +509,7 @@ vbe_healthy(VRT_CTX, VCL_BACKEND d, VCL_TIME *t) if (t != NULL) *t = bp->changed; - return (! bp->sick); + return (!bp->sick); } diff --git a/bin/varnishd/cache/cache_ban_build.c b/bin/varnishd/cache/cache_ban_build.c index 5f479504c..1d6e3d06a 100644 --- a/bin/varnishd/cache/cache_ban_build.c +++ b/bin/varnishd/cache/cache_ban_build.c @@ -258,8 +258,7 @@ BAN_AddTest(struct ban_proto *bp, ((1U << BAN_OPERIDX(op)) & arg_opervalid[BAN_ARGIDX(pv->tag)]) == 0) return (ban_error(bp, "expected conditional (%s) got \"%s\"", - arg_operhelp[BAN_ARGIDX(pv->tag)], - a2)); + arg_operhelp[BAN_ARGIDX(pv->tag)], a2)); if ((pv->flag & BANS_FLAG_DURATION) == 0) { assert(! BANS_HAS_ARG2_DOUBLE(pv->tag)); diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c index 87cb9d03d..68ae73268 100644 --- a/bin/varnishd/cache/cache_esi_deliver.c +++ b/bin/varnishd/cache/cache_esi_deliver.c @@ -668,7 +668,7 @@ ved_gzgz_bytes(struct vdp_ctx *vdx, enum vdp_action act, void **priv, if (dl > len) dl = len; if (ved_bytes(foo->ecx, act, pp, dl)) - return(-1); + return (-1); foo->ll += dl; len -= dl; pp += dl; diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c index ae9cb2314..a415fce59 100644 --- a/bin/varnishd/cache/cache_expire.c +++ b/bin/varnishd/cache/cache_expire.c @@ -324,7 +324,7 @@ exp_expire(struct exp_priv *ep, vtim_real now) oc = VBH_root(ep->heap); if (oc == NULL) - return (now + 355./113.); + return (now + 355. / 113.); VSLb(&ep->vsl, SLT_ExpKill, "EXP_expire p=%p e=%.6f f=0x%x", oc, oc->timer_when - now, oc->flags); diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c index 7e98ff4d9..e4d23de51 100644 --- a/bin/varnishd/cache/cache_gzip.c +++ b/bin/varnishd/cache/cache_gzip.c @@ -560,7 +560,7 @@ vfp_gunzip_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p, if (!VGZ_IbufEmpty(vg) || vp == VFP_END) { vr = VGZ_Gunzip(vg, &dp, &dl); if (vr == VGZ_END && !VGZ_IbufEmpty(vg)) - return(VFP_Error(vc, "Junk after gzip data")); + return (VFP_Error(vc, "Junk after gzip data")); if (vr < VGZ_OK) return (VFP_Error(vc, "Invalid Gzip data: %s", vgz_msg(vg))); @@ -573,7 +573,7 @@ vfp_gunzip_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p, AN(VGZ_IbufEmpty(vg)); } while (vp == VFP_OK); if (vr != VGZ_END) - return(VFP_Error(vc, "Gunzip error at the very end")); + return (VFP_Error(vc, "Gunzip error at the very end")); return (vp); } @@ -664,7 +664,7 @@ vfp_testgunzip_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p, VGZ_Obuf(vg, vg->m_buf, vg->m_sz); vr = VGZ_Gunzip(vg, &dp, &dl); if (vr == VGZ_END && !VGZ_IbufEmpty(vg)) - return(VFP_Error(vc, "Junk after gzip data")); + return (VFP_Error(vc, "Junk after gzip data")); if (vr < VGZ_OK) return (VFP_Error(vc, "Invalid Gzip data: %s", vgz_msg(vg))); diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index f7d378a78..9b5a4b8a5 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -171,7 +171,7 @@ Resp_Setup_Deliver(struct req *req) ObjCheckFlag(req->wrk, oc, OF_GZIPED) && !RFC2616_Req_Gzip(req->http)) RFC2616_Weaken_Etag(h); - return(0); + return (0); } void diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c index d674b728a..0a729c0e4 100644 --- a/bin/varnishd/cache/cache_vrt.c +++ b/bin/varnishd/cache/cache_vrt.c @@ -1037,7 +1037,7 @@ VRT_ipcmp(VRT_CTX, VCL_IP sua1, VCL_IP sua2) if (sua1 == NULL || sua2 == NULL) { VRT_fail(ctx, "%s: Illegal IP", __func__); - return(1); + return (1); } return (VSA_Compare_IP(sua1, sua2)); } diff --git a/bin/varnishd/cache/cache_vrt_vcl.c b/bin/varnishd/cache/cache_vrt_vcl.c index b7ecdd7ff..023ba0022 100644 --- a/bin/varnishd/cache/cache_vrt_vcl.c +++ b/bin/varnishd/cache/cache_vrt_vcl.c @@ -358,7 +358,7 @@ VRT_VCL_Prevent_Cold(VRT_CTX, const char *desc) VTAILQ_INSERT_TAIL(&ctx->vcl->ref_list, ref, list); Lck_Unlock(&vcl_mtx); - return(ref); + return (ref); } void diff --git a/bin/varnishd/mgt/mgt_acceptor.c b/bin/varnishd/mgt/mgt_acceptor.c index dd00d77bc..1af17f365 100644 --- a/bin/varnishd/mgt/mgt_acceptor.c +++ b/bin/varnishd/mgt/mgt_acceptor.c @@ -191,7 +191,7 @@ mac_tcp(void *priv, const struct suckaddr *sa) } ls = mk_listen_sock(la, sa); if (ls == NULL) - return(0); + return (0); AZ(ls->uds); if (VSA_Port(ls->addr) == 0) { /* @@ -226,7 +226,7 @@ mac_uds(void *priv, const struct sockaddr_un *uds) } ls = mk_listen_sock(la, bogo_ip); if (ls == NULL) - return(0); + return (0); AN(ls->uds); VTAILQ_INSERT_TAIL(&la->socks, ls, arglist); VTAILQ_INSERT_TAIL(&heritage.socks, ls, list); diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c index 6be347d92..e55e6ca5d 100644 --- a/bin/varnishd/mgt/mgt_child.c +++ b/bin/varnishd/mgt/mgt_child.c @@ -283,7 +283,7 @@ child_poker(const struct vev *e, int what) MCH_Cli_Fail(); } free(r); - return 0; + return (0); } /*===================================================================== diff --git a/bin/varnishd/mgt/mgt_cli.c b/bin/varnishd/mgt/mgt_cli.c index 18b6202b2..11cff7889 100644 --- a/bin/varnishd/mgt/mgt_cli.c +++ b/bin/varnishd/mgt/mgt_cli.c @@ -576,7 +576,7 @@ Marg_closer(void *priv) (void)priv; M_fd = -1; - return(0); + return (0); } static int v_matchproto_(vev_cb_f) @@ -651,7 +651,7 @@ marg_cb(void *priv, const struct suckaddr *sa) AN(ma); ma->sa = VSA_Clone(sa); VTAILQ_INSERT_TAIL(&m_addr_list, ma, list); - return(0); + return (0); } void diff --git a/bin/varnishd/mgt/mgt_param_bits.c b/bin/varnishd/mgt/mgt_param_bits.c index 756db4159..d6a9c3fd2 100644 --- a/bin/varnishd/mgt/mgt_param_bits.c +++ b/bin/varnishd/mgt/mgt_param_bits.c @@ -141,8 +141,7 @@ tweak_vsl_mask(struct vsb *vsb, const struct parspec *par, const char *arg) (void)bit(mgt_param.vsl_mask, SLT_ExpKill, BSET); } else { return (bit_tweak(vsb, mgt_param.vsl_mask, - SLT__Reserved, arg, VSL_tags, - "VSL tag", "-")); + SLT__Reserved, arg, VSL_tags, "VSL tag", "-")); } } else { if (arg == JSON_FMT) diff --git a/bin/varnishd/mgt/mgt_param_tweak.c b/bin/varnishd/mgt/mgt_param_tweak.c index 8e378df04..b6d97797b 100644 --- a/bin/varnishd/mgt/mgt_param_tweak.c +++ b/bin/varnishd/mgt/mgt_param_tweak.c @@ -115,8 +115,7 @@ tweak_double(struct vsb *vsb, const struct parspec *par, const char *arg) volatile double *dest; dest = par->priv; - return (tweak_generic_double(vsb, dest, arg, - par->min, par->max, "%g")); + return (tweak_generic_double(vsb, dest, arg, par->min, par->max, "%g")); } /*--------------------------------------------------------------------*/ diff --git a/bin/varnishd/mgt/mgt_vcl.c b/bin/varnishd/mgt/mgt_vcl.c index 3e978661b..c6c78de21 100644 --- a/bin/varnishd/mgt/mgt_vcl.c +++ b/bin/varnishd/mgt/mgt_vcl.c @@ -921,7 +921,7 @@ mcf_vcl_check_dag(struct cli *cli, struct vclprog *tree, struct vclprog *target) tree->name, vd->to->name); return (1); } - return(0); + return (0); } static void v_matchproto_(cli_func_t) diff --git a/bin/varnishd/waiter/cache_waiter_epoll.c b/bin/varnishd/waiter/cache_waiter_epoll.c index 53fa4be3b..b53e48e15 100644 --- a/bin/varnishd/waiter/cache_waiter_epoll.c +++ b/bin/varnishd/waiter/cache_waiter_epoll.c @@ -177,7 +177,7 @@ vwe_enter(void *priv, struct waited *wp) if (Wait_When(wp) < vwe->next) assert(write(vwe->pipe[1], "X", 1) == 1); Lck_Unlock(&vwe->mtx); - return(0); + return (0); } /*--------------------------------------------------------------------*/ diff --git a/bin/varnishd/waiter/cache_waiter_kqueue.c b/bin/varnishd/waiter/cache_waiter_kqueue.c index 33429b19b..27ff1cca6 100644 --- a/bin/varnishd/waiter/cache_waiter_kqueue.c +++ b/bin/varnishd/waiter/cache_waiter_kqueue.c @@ -156,7 +156,7 @@ vwk_enter(void *priv, struct waited *wp) assert(write(vwk->pipe[1], "X", 1) == 1); Lck_Unlock(&vwk->mtx); - return(0); + return (0); } /*--------------------------------------------------------------------*/ diff --git a/bin/varnishtest/vtc_client.c b/bin/varnishtest/vtc_client.c index 3ef81a0a8..178aa1335 100644 --- a/bin/varnishtest/vtc_client.c +++ b/bin/varnishtest/vtc_client.c @@ -141,7 +141,7 @@ uds_open(void *priv, const struct sockaddr_un *uds) VTCP_nonblocking(s); i = connect(s, (const void*)uds, sl); if (i == 0) - return(s); + return (s); if (errno != EINPROGRESS) { closefd(&s); return (-1); diff --git a/bin/varnishtest/vtc_haproxy.c b/bin/varnishtest/vtc_haproxy.c index c345ef42d..89be37b43 100644 --- a/bin/varnishtest/vtc_haproxy.c +++ b/bin/varnishtest/vtc_haproxy.c @@ -541,7 +541,7 @@ haproxy_create_mcli(struct haproxy *h) macro_def(h->vl, buf, "addr", "%s", addr); macro_def(h->vl, buf, "port", "%s", port); - return sock; + return (sock); } static void diff --git a/bin/varnishtest/vtc_misc.c b/bin/varnishtest/vtc_misc.c index 75a4b7c38..be7236b7e 100644 --- a/bin/varnishtest/vtc_misc.c +++ b/bin/varnishtest/vtc_misc.c @@ -384,7 +384,7 @@ ipvx_works(const char *target) VTCP_close(&fd); return (1); } - return(0); + return (0); } /* SECTION: feature feature diff --git a/lib/libvarnish/vrnd.c b/lib/libvarnish/vrnd.c index 891c40f27..8e189f771 100644 --- a/lib/libvarnish/vrnd.c +++ b/lib/libvarnish/vrnd.c @@ -159,8 +159,8 @@ double VRND_RandomTestableDouble(void) { return ( - ldexp((double)VRND_RandomTestable(), -31) + - ldexp((double)VRND_RandomTestable(), -62) + ldexp((double)VRND_RandomTestable(), -31) + + ldexp((double)VRND_RandomTestable(), -62) ); } diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c index 1c4996b21..087938bef 100644 --- a/lib/libvarnish/vtcp.c +++ b/lib/libvarnish/vtcp.c @@ -194,8 +194,7 @@ VTCP_filter_http(int sock) int VTCP_fastopen(int sock, int depth) { - return (setsockopt(sock, SOL_TCP, TCP_FASTOPEN, - &depth, sizeof depth)); + return (setsockopt(sock, SOL_TCP, TCP_FASTOPEN, &depth, sizeof depth)); } #else diff --git a/lib/libvarnishapi/vsl_arg.c b/lib/libvarnishapi/vsl_arg.c index 0ec414164..4a8ee9a06 100644 --- a/lib/libvarnishapi/vsl_arg.c +++ b/lib/libvarnishapi/vsl_arg.c @@ -335,8 +335,7 @@ vsl_R_arg(struct VSL_data *vsl, const char *arg) strcat(buf, p); vsl->R_opt_p = VNUM_duration(buf); if (isnan(vsl->R_opt_p) || vsl->R_opt_p <= 0.0) - return (vsl_diag(vsl, - "-R: Syntax error: Invalid duration")); + return (vsl_diag(vsl, "-R: Syntax error: Invalid duration")); return (1); } diff --git a/lib/libvarnishapi/vsm.c b/lib/libvarnishapi/vsm.c index d9e67ef32..401f278dd 100644 --- a/lib/libvarnishapi/vsm.c +++ b/lib/libvarnishapi/vsm.c @@ -516,7 +516,7 @@ vsm_vlu_plus(struct vsm *vd, struct vsm_set *vs, const char *line) (void)(vsm_diag(vd, "vsm_vlu_plus: bad index (%d/%s)", ac, av[0])); VAV_Free(av); - return(-1); + return (-1); } vg = vs->vg; @@ -564,7 +564,7 @@ vsm_vlu_minus(struct vsm *vd, const struct vsm_set *vs, const char *line) (void)(vsm_diag(vd, "vsm_vlu_minus: bad index (%d/%s)", ac, av[0])); VAV_Free(av); - return(-1); + return (-1); } /* Clustered segments cannot come before their cluster */ @@ -683,7 +683,7 @@ vsm_refresh_set(struct vsm *vd, struct vsm_set *vs) vs->vg = VTAILQ_FIRST(&vs->segs); vs->fd = openat(vs->dfd, "_.index", O_RDONLY); if (vs->fd < 0) - return (vs->retval|vs->flag_restarted); + return (vs->retval | vs->flag_restarted); VLU_Reset(vs->vlu); AZ(fstat(vs->fd, &vs->fst)); vsm_readlines(vs); diff --git a/lib/libvcc/vcc_symb.c b/lib/libvcc/vcc_symb.c index 872a8bd47..59c74228f 100644 --- a/lib/libvcc/vcc_symb.c +++ b/lib/libvcc/vcc_symb.c @@ -232,17 +232,17 @@ vcc_sym_in_tab(struct vcc *tl, struct symtab *st, } pst = st->parent; if (pst == NULL) - return(sym); + return (sym); psym = VTAILQ_FIRST(&pst->symbols); if (psym == NULL) - return(sym); + return (sym); if (psym->wildcard == NULL) - return(sym); + return (sym); sym = vcc_new_symbol(tl, st, kind, vlo, vhi); psym->wildcard(tl, psym, sym); if (tl->err) - return(NULL); + return (NULL); return (sym); } diff --git a/lib/libvgz/adler32.c b/lib/libvgz/adler32.c index 5f5e0decd..436252be4 100644 --- a/lib/libvgz/adler32.c +++ b/lib/libvgz/adler32.c @@ -137,7 +137,7 @@ uLong ZEXPORT adler32(adler, buf, len) const Bytef *buf; uInt len; { - return adler32_z(adler, buf, len); + return (adler32_z(adler, buf, len)); } /* ========================================================================= */ @@ -152,7 +152,7 @@ local uLong adler32_combine_(adler1, adler2, len2) /* for negative len, return invalid adler32 as a clue for debugging */ if (len2 < 0) - return 0xffffffffUL; + return (0xffffffffUL); /* the derivation of this formula is left as an exercise for the reader */ MOD63(len2); /* assumes len2 >= 0 */ @@ -166,7 +166,7 @@ local uLong adler32_combine_(adler1, adler2, len2) if (sum1 >= BASE) sum1 -= BASE; if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1); if (sum2 >= BASE) sum2 -= BASE; - return sum1 | (sum2 << 16); + return (sum1 | (sum2 << 16)); } /* ========================================================================= */ @@ -175,7 +175,7 @@ uLong ZEXPORT adler32_combine(adler1, adler2, len2) uLong adler2; z_off_t len2; { - return adler32_combine_(adler1, adler2, len2); + return (adler32_combine_(adler1, adler2, len2)); } uLong ZEXPORT adler32_combine64(adler1, adler2, len2) @@ -183,7 +183,7 @@ uLong ZEXPORT adler32_combine64(adler1, adler2, len2) uLong adler2; z_off64_t len2; { - return adler32_combine_(adler1, adler2, len2); + return (adler32_combine_(adler1, adler2, len2)); } #else uLong ZEXPORT adler32(adler, buf, len) diff --git a/lib/libvgz/crc32.c b/lib/libvgz/crc32.c index 9580440c0..9ec56fc34 100644 --- a/lib/libvgz/crc32.c +++ b/lib/libvgz/crc32.c @@ -191,7 +191,7 @@ const z_crc_t FAR * ZEXPORT get_crc_table() if (crc_table_empty) make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ - return (const z_crc_t FAR *)crc_table; + return ((const z_crc_t FAR *)crc_table); } /* ========================================================================= */ @@ -204,7 +204,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) const unsigned char FAR *buf; z_size_t len; { - if (buf == Z_NULL) return 0UL; + if (buf == Z_NULL) return (0UL); #ifdef DYNAMIC_CRC_TABLE if (crc_table_empty) @@ -217,9 +217,9 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) endian = 1; if (*((unsigned char *)(&endian))) - return crc32_little(crc, buf, len); + return (crc32_little(crc, buf, len)); else - return crc32_big(crc, buf, len); + return (crc32_big(crc, buf, len)); } #endif /* BYFOUR */ crc = crc ^ 0xffffffffUL; @@ -230,7 +230,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) if (len) do { DO1; } while (--len); - return crc ^ 0xffffffffUL; + return (crc ^ 0xffffffffUL); } /* ========================================================================= */ @@ -239,7 +239,7 @@ unsigned long ZEXPORT crc32(crc, buf, len) const unsigned char FAR *buf; uInt len; { - return crc32_z(crc, buf, len); + return (crc32_z(crc, buf, len)); } #ifdef BYFOUR @@ -381,7 +381,7 @@ local uLong crc32_combine_(crc1, crc2, len2) /* degenerate case (also disallow negative lengths) */ if (len2 <= 0) - return crc1; + return (crc1); /* put operator for one zero bit in odd */ odd[0] = 0xedb88320UL; /* CRC-32 polynomial */ @@ -421,7 +421,7 @@ local uLong crc32_combine_(crc1, crc2, len2) /* return combined crc */ crc1 ^= crc2; - return crc1; + return (crc1); } /* ========================================================================= */ @@ -430,7 +430,7 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2) uLong crc2; z_off_t len2; { - return crc32_combine_(crc1, crc2, len2); + return (crc32_combine_(crc1, crc2, len2)); } uLong ZEXPORT crc32_combine64(crc1, crc2, len2) @@ -438,5 +438,5 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2) uLong crc2; z_off64_t len2; { - return crc32_combine_(crc1, crc2, len2); + return (crc32_combine_(crc1, crc2, len2)); } diff --git a/lib/libvgz/inflate.c b/lib/libvgz/inflate.c index ca7b6086d..93730905a 100644 --- a/lib/libvgz/inflate.c +++ b/lib/libvgz/inflate.c @@ -246,7 +246,7 @@ z_streamp strm; const char *version; int stream_size; { - return inflateInit2_(strm, DEF_WBITS, version, stream_size); + return (inflateInit2_(strm, DEF_WBITS, version, stream_size)); } int ZEXPORT inflatePrime(strm, bits, value) diff --git a/lib/libvgz/trees.c b/lib/libvgz/trees.c index a11cd0d48..a08b09da3 100644 --- a/lib/libvgz/trees.c +++ b/lib/libvgz/trees.c @@ -823,7 +823,7 @@ local int build_bl_tree(s) Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", s->opt_len, s->static_len)); - return max_blindex; + return (max_blindex); } /* =========================================================================== @@ -1062,10 +1062,10 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc) Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", s->last_lit, in_length, out_length, 100L - out_length*100L/in_length)); - if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; + if (s->matches < s->last_lit/2 && out_length < in_length/2) return (1); } #endif - return (s->last_lit == s->lit_bufsize-1); + return (s->last_lit == s->lit_bufsize - 1); /* We avoid equality with lit_bufsize because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. @@ -1148,20 +1148,20 @@ local int detect_data_type(s) /* Check for non-textual ("black-listed") bytes. */ for (n = 0; n <= 31; n++, black_mask >>= 1) if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0)) - return Z_BINARY; + return (Z_BINARY); /* Check for textual ("white-listed") bytes. */ if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 || s->dyn_ltree[13].Freq != 0) - return Z_TEXT; + return (Z_TEXT); for (n = 32; n < LITERALS; n++) if (s->dyn_ltree[n].Freq != 0) - return Z_TEXT; + return (Z_TEXT); /* There are no "black-listed" or "white-listed" bytes: * this stream either is empty or has tolerated ("gray-listed") bytes only. */ - return Z_BINARY; + return (Z_BINARY); } /* =========================================================================== diff --git a/lib/libvgz/zutil.c b/lib/libvgz/zutil.c index 5b21eceda..e65fd04b8 100644 --- a/lib/libvgz/zutil.c +++ b/lib/libvgz/zutil.c @@ -27,7 +27,7 @@ z_const char * const z_errmsg[10] = { const char * ZEXPORT zlibVersion() { - return ZLIB_VERSION; + return (ZLIB_VERSION); } uLong ZEXPORT zlibCompileFlags() @@ -110,7 +110,7 @@ uLong ZEXPORT zlibCompileFlags() # endif # endif #endif - return flags; + return (flags); } #ifdef ZLIB_DEBUG @@ -134,7 +134,7 @@ void ZLIB_INTERNAL z_error (m) const char * ZEXPORT zError(err) int err; { - return ERR_MSG(err); + return (ERR_MSG(err)); } #if defined(_WIN32_WCE) @@ -166,9 +166,9 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len) uInt j; for (j = 0; j < len; j++) { - if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; + if (s1[j] != s2[j]) return (2 * (s1[j] > s2[j]) - 1); } - return 0; + return (0); } void ZLIB_INTERNAL zmemzero(dest, len) @@ -229,18 +229,18 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) */ if (bsize < 65520L) { buf = farmalloc(bsize); - if (*(ush*)&buf != 0) return buf; + if (*(ush*)&buf != 0) return (buf); } else { buf = farmalloc(bsize + 16L); } - if (buf == NULL || next_ptr >= MAX_PTR) return NULL; + if (buf == NULL || next_ptr >= MAX_PTR) return (NULL); table[next_ptr].org_ptr = buf; /* Normalize the pointer to seg:0 */ *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; *(ush*)&buf = 0; table[next_ptr++].new_ptr = buf; - return buf; + return (buf); } void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) @@ -283,7 +283,7 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) { (void)opaque; - return _halloc((long)items, size); + return (_halloc((long)items, size)); } void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) diff --git a/vmod/vmod_proxy.c b/vmod/vmod_proxy.c index b877d5bc1..099f64a0b 100644 --- a/vmod/vmod_proxy.c +++ b/vmod/vmod_proxy.c @@ -68,19 +68,19 @@ tlv_ssl_flag(VRT_CTX, int flag) VCL_BOOL v_matchproto_(td_proxy_is_ssl) vmod_is_ssl(VRT_CTX) { - return tlv_ssl_flag(ctx, PP2_CLIENT_SSL); + return (tlv_ssl_flag(ctx, PP2_CLIENT_SSL)); } VCL_BOOL v_matchproto_(td_proxy_client_has_cert_sess) vmod_client_has_cert_sess(VRT_CTX) { - return tlv_ssl_flag(ctx, PP2_CLIENT_CERT_SESS); + return (tlv_ssl_flag(ctx, PP2_CLIENT_CERT_SESS)); } VCL_BOOL v_matchproto_(td_proxy_client_has_cert_conn) vmod_client_has_cert_conn(VRT_CTX) { - return tlv_ssl_flag(ctx, PP2_CLIENT_CERT_CONN); + return (tlv_ssl_flag(ctx, PP2_CLIENT_CERT_CONN)); } /* return come from SSL_get_verify_result */ @@ -120,41 +120,41 @@ tlv_string(VRT_CTX, int tlv) VCL_STRING v_matchproto_(td_proxy_alpn) vmod_alpn(VRT_CTX) { - return tlv_string(ctx, PP2_TYPE_ALPN); + return (tlv_string(ctx, PP2_TYPE_ALPN)); } VCL_STRING v_matchproto_(td_proxy_authority) vmod_authority(VRT_CTX) { - return tlv_string(ctx, PP2_TYPE_AUTHORITY); + return (tlv_string(ctx, PP2_TYPE_AUTHORITY)); } VCL_STRING v_matchproto_(td_proxy_ssl_version) vmod_ssl_version(VRT_CTX) { - return tlv_string(ctx, PP2_SUBTYPE_SSL_VERSION); + return (tlv_string(ctx, PP2_SUBTYPE_SSL_VERSION)); } VCL_STRING v_matchproto_(td_proxy_ssl_cipher) vmod_ssl_cipher(VRT_CTX) { - return tlv_string(ctx, PP2_SUBTYPE_SSL_CIPHER); + return (tlv_string(ctx, PP2_SUBTYPE_SSL_CIPHER)); } VCL_STRING v_matchproto_(td_proxy_cert_sign) vmod_cert_sign(VRT_CTX) { - return tlv_string(ctx, PP2_SUBTYPE_SSL_SIG_ALG); + return (tlv_string(ctx, PP2_SUBTYPE_SSL_SIG_ALG)); } VCL_STRING v_matchproto_(td_proxy_cert_key) vmod_cert_key(VRT_CTX) { - return tlv_string(ctx, PP2_SUBTYPE_SSL_KEY_ALG); + return (tlv_string(ctx, PP2_SUBTYPE_SSL_KEY_ALG)); } VCL_STRING v_matchproto_(td_proxy_client_cert_cn) vmod_client_cert_cn(VRT_CTX) { - return tlv_string(ctx, PP2_SUBTYPE_SSL_CN); + return (tlv_string(ctx, PP2_SUBTYPE_SSL_CN)); } diff --git a/vmod/vmod_std_conversions.c b/vmod/vmod_std_conversions.c index 84ee9e14a..accc57f9d 100644 --- a/vmod/vmod_std_conversions.c +++ b/vmod/vmod_std_conversions.c @@ -124,16 +124,16 @@ vmod_bytes(VRT_CTX, struct VARGS(bytes) *a) if (a->valid_s && VNUM_2bytes(a->s, &r, 0) == NULL && r <= VCL_BYTES_MAX) - return((VCL_BYTES)r); + return ((VCL_BYTES)r); if (a->valid_real && !isnan(a->real) && a->real >= 0) { rr = trunc(a->real); if (rr <= (VCL_REAL)VCL_BYTES_MAX) - return((VCL_BYTES)rr); + return ((VCL_BYTES)rr); } if (a->valid_integer && a->integer >= 0) - return((VCL_BYTES)a->integer); + return ((VCL_BYTES)a->integer); if (a->valid_fallback) return (a->fallback); @@ -325,7 +325,7 @@ vmod_real2integer(VRT_CTX, VCL_REAL r, VCL_INT i) return (i); r = round(r); if (r > VCL_INT_MAX || r < VCL_INT_MIN) - return(i); + return (i); return ((VCL_INT)r); } @@ -349,7 +349,7 @@ vmod_time2integer(VRT_CTX, VCL_TIME t, VCL_INT i) return (i); t = round(t); if (t > VCL_INT_MAX || t < VCL_INT_MIN) - return(i); + return (i); return ((VCL_INT)t); } @@ -363,4 +363,3 @@ vmod_time2real(VRT_CTX, VCL_TIME t, VCL_REAL r) return (t); } - diff --git a/vmod/vmod_vtc.c b/vmod/vmod_vtc.c index bc95fcb84..2b445d82b 100644 --- a/vmod/vmod_vtc.c +++ b/vmod/vmod_vtc.c @@ -208,7 +208,7 @@ vmod_workspace_free(VRT_CTX, VCL_ENUM which) ws = vtc_ws_find(ctx, which); if (ws == NULL) - return(-1); + return (-1); WS_Assert(ws); u = WS_ReserveAll(ws); From nils.goroll at uplex.de Wed Feb 10 13:19:06 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 10 Feb 2021 13:19:06 +0000 (UTC) Subject: [master] 82a07a262 h2: Explode include/tbl/h2_error.h Message-ID: <20210210131906.57E53110294@lists.varnish-cache.org> commit 82a07a26275f33014ccd4d1101cd93157431ae28 Author: Dridi Boukelmoune Date: Mon Jan 25 09:37:49 2021 +0100 h2: Explode include/tbl/h2_error.h In the same fashion as include/tbl/params.h for legibility. diff --git a/include/tbl/h2_error.h b/include/tbl/h2_error.h index 88b2337e7..4d397922c 100644 --- a/include/tbl/h2_error.h +++ b/include/tbl/h2_error.h @@ -29,25 +29,108 @@ * * RFC7540 section 11.4 * - * Fields: Upper, value, conn=1|stream=2, description + * Types: conn=1|stream=2 */ /*lint -save -e525 -e539 */ -H2_ERROR(NO_ERROR, 0,3, "Graceful shutdown") -H2_ERROR(PROTOCOL_ERROR, 1,3, "Protocol error detected") -H2_ERROR(INTERNAL_ERROR, 2,3, "Implementation fault") -H2_ERROR(FLOW_CONTROL_ERROR, 3,3, "Flow-control limits exceeded") -H2_ERROR(SETTINGS_TIMEOUT, 4,1, "Settings not acknowledged") -H2_ERROR(STREAM_CLOSED, 5,2, "Frame received for closed stream") -H2_ERROR(FRAME_SIZE_ERROR, 6,3, "Frame size incorrect") -H2_ERROR(REFUSED_STREAM, 7,2, "Stream not processed") -H2_ERROR(CANCEL, 8,2, "Stream cancelled") -H2_ERROR(COMPRESSION_ERROR, 9,1, "Compression state not updated") -H2_ERROR(CONNECT_ERROR, 10,2, "TCP connection error for CONNECT method") -H2_ERROR(ENHANCE_YOUR_CALM, 11,3, "Processing capacity exceeded") -H2_ERROR(INADEQUATE_SECURITY, 12,1, "Negotiated TLS parameters not acceptable") -H2_ERROR(HTTP_1_1_REQUIRED, 13,1, "Use HTTP/1.1 for the request") -#undef H2_ERROR +H2_ERROR( + /* name */ NO_ERROR, + /* val */ 0, + /* types */ 3, + /* descr */ "Graceful shutdown" +) + +H2_ERROR( + /* name */ PROTOCOL_ERROR, + /* val */ 1, + /* types */ 3, + /* descr */ "Protocol error detected" +) + +H2_ERROR( + /* name */ INTERNAL_ERROR, + /* val */ 2, + /* types */ 3, + /* descr */ "Implementation fault" +) + +H2_ERROR( + /* name */ FLOW_CONTROL_ERROR, + /* val */ 3, + /* types */ 3, + /* descr */ "Flow-control limits exceeded" +) + +H2_ERROR( + /* name */ SETTINGS_TIMEOUT, + /* val */ 4, + /* types */ 1, + /* descr */ "Settings not acknowledged" +) + +H2_ERROR( + /* name */ STREAM_CLOSED, + /* val */ 5, + /* types */ 2, + /* descr */ "Frame received for closed stream" +) + +H2_ERROR( + /* name */ FRAME_SIZE_ERROR, + /* val */ 6, + /* types */ 3, + /* descr */ "Frame size incorrect" +) + +H2_ERROR( + /* name */ REFUSED_STREAM, + /* val */ 7, + /* types */ 2, + /* descr */ "Stream not processed" +) +H2_ERROR( + /* name */ CANCEL, + /* val */ 8, + /* types */ 2, + /* descr */ "Stream cancelled" +) + +H2_ERROR( + /* name */ COMPRESSION_ERROR, + /* val */ 9, + /* types */ 1, + /* descr */ "Compression state not updated" +) + +H2_ERROR( + /* name */ CONNECT_ERROR, + /* val */ 10, + /* types */ 2, + /* descr */ "TCP connection error for CONNECT method" +) + +H2_ERROR( + /* name */ ENHANCE_YOUR_CALM, + /* val */ 11, + /* types */ 3, + /* descr */ "Processing capacity exceeded" +) + +H2_ERROR( + /* name */ INADEQUATE_SECURITY, + /* val */ 12, + /* types */ 1, + /* descr */ "Negotiated TLS parameters not acceptable" +) + +H2_ERROR( + /* name */ HTTP_1_1_REQUIRED, + /* val */ 13, + /* types */ 1, + /* descr */ "Use HTTP/1.1 for the request" +) + +#undef H2_ERROR /*lint -restore */ From nils.goroll at uplex.de Wed Feb 10 13:19:06 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 10 Feb 2021 13:19:06 +0000 (UTC) Subject: [master] 5c1d08263 h2: Add a sess_close reason to h2 connection errors Message-ID: <20210210131906.78E46110297@lists.varnish-cache.org> commit 5c1d08263a8d161b7318cca13c1778ac955bdb3d Author: Dridi Boukelmoune Date: Mon Jan 25 12:26:47 2021 +0100 h2: Add a sess_close reason to h2 connection errors And use that for logging purposes when a successfully opened h2 session ends. RX_JUNK is still the default session close reason when existing reasons aren't accurate enough. Fixes #3393 diff --git a/bin/varnishd/http2/cache_http2.h b/bin/varnishd/http2/cache_http2.h index 270306d15..782845209 100644 --- a/bin/varnishd/http2/cache_http2.h +++ b/bin/varnishd/http2/cache_http2.h @@ -44,15 +44,15 @@ struct h2_error_s { uint32_t val; int stream; int connection; + enum sess_close reason; }; typedef const struct h2_error_s *h2_error; -#define H2EC0(U,v,d) -#define H2EC1(U,v,d) extern const struct h2_error_s H2CE_##U[1]; -#define H2EC2(U,v,d) extern const struct h2_error_s H2SE_##U[1]; -#define H2EC3(U,v,d) H2EC1(U,v,d) H2EC2(U,v,d) -#define H2_ERROR(NAME, val, sc, desc) H2EC##sc(NAME, val, desc) +#define H2EC1(U,v,r,d) extern const struct h2_error_s H2CE_##U[1]; +#define H2EC2(U,v,r,d) extern const struct h2_error_s H2SE_##U[1]; +#define H2EC3(U,v,r,d) H2EC1(U,v,r,d) H2EC2(U,v,r,d) +#define H2_ERROR(NAME, val, sc, reason, desc) H2EC##sc(NAME, val, reason, desc) #include "tbl/h2_error.h" #undef H2EC1 #undef H2EC2 diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c index 614d13781..cc894950e 100644 --- a/bin/varnishd/http2/cache_http2_proto.c +++ b/bin/varnishd/http2/cache_http2_proto.c @@ -45,10 +45,10 @@ #include "vtcp.h" #include "vtim.h" -#define H2EC1(U,v,d) const struct h2_error_s H2CE_##U[1] = {{#U,d,v,0,1}}; -#define H2EC2(U,v,d) const struct h2_error_s H2SE_##U[1] = {{#U,d,v,1,0}}; -#define H2EC3(U,v,d) H2EC1(U,v,d) H2EC2(U,v,d) -#define H2_ERROR(NAME, val, sc, desc) H2EC##sc(NAME, val, desc) +#define H2EC1(U,v,r,d) const struct h2_error_s H2CE_##U[1] = {{#U,d,v,0,1,r}}; +#define H2EC2(U,v,r,d) const struct h2_error_s H2SE_##U[1] = {{#U,d,v,1,0,r}}; +#define H2EC3(U,v,r,d) H2EC1(U,v,r,d) H2EC2(U,v,r,d) +#define H2_ERROR(NAME, val, sc, reason, desc) H2EC##sc(NAME, val, reason, desc) #include "tbl/h2_error.h" #undef H2EC1 #undef H2EC2 @@ -59,7 +59,8 @@ static const struct h2_error_s H2NN_ERROR[1] = {{ "Unknown error number", 0xffffffff, 1, - 1 + 1, + SC_RX_JUNK }}; enum h2frame { @@ -86,10 +87,10 @@ h2_framename(enum h2frame h2f) */ static const h2_error stream_errors[] = { -#define H2EC1(U,v,d) -#define H2EC2(U,v,d) [v] = H2SE_##U, -#define H2EC3(U,v,d) H2EC1(U,v,d) H2EC2(U,v,d) -#define H2_ERROR(NAME, val, sc, desc) H2EC##sc(NAME, val, desc) +#define H2EC1(U,v,r,d) +#define H2EC2(U,v,r,d) [v] = H2SE_##U, +#define H2EC3(U,v,r,d) H2EC1(U,v,r,d) H2EC2(U,v,r,d) +#define H2_ERROR(NAME, val, sc, reason, desc) H2EC##sc(NAME, val, reason, desc) #include "tbl/h2_error.h" #undef H2EC1 #undef H2EC2 @@ -111,10 +112,10 @@ h2_streamerror(uint32_t u) */ static const h2_error conn_errors[] = { -#define H2EC1(U,v,d) [v] = H2CE_##U, -#define H2EC2(U,v,d) -#define H2EC3(U,v,d) H2EC1(U,v,d) H2EC2(U,v,d) -#define H2_ERROR(NAME, val, sc, desc) H2EC##sc(NAME, val, desc) +#define H2EC1(U,v,r,d) [v] = H2CE_##U, +#define H2EC2(U,v,r,d) +#define H2EC3(U,v,r,d) H2EC1(U,v,r,d) H2EC2(U,v,r,d) +#define H2_ERROR(NAME, val, sc, reason, desc) H2EC##sc(NAME, val, reason, desc) #include "tbl/h2_error.h" #undef H2EC1 #undef H2EC2 diff --git a/bin/varnishd/http2/cache_http2_session.c b/bin/varnishd/http2/cache_http2_session.c index cc1816f54..36d4a1c0e 100644 --- a/bin/varnishd/http2/cache_http2_session.c +++ b/bin/varnishd/http2/cache_http2_session.c @@ -145,6 +145,7 @@ h2_del_sess(struct worker *wrk, struct h2_sess *h2, enum sess_close reason) CHECK_OBJ_NOTNULL(h2, H2_SESS_MAGIC); AZ(h2->refcnt); assert(VTAILQ_EMPTY(&h2->streams)); + AN(reason); VHT_Fini(h2->dectbl); AZ(pthread_cond_destroy(h2->winupd_cond)); @@ -432,8 +433,7 @@ h2_new_session(struct worker *wrk, void *arg) h2->cond = NULL; assert(h2->refcnt == 1); h2_del_req(wrk, h2->req0); - /* TODO: proper sess close reason */ - h2_del_sess(wrk, h2, SC_RX_JUNK); + h2_del_sess(wrk, h2, h2->error->reason); } struct transport H2_transport = { diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c index f2deff037..cb1c6b5f5 100644 --- a/bin/varnishtest/vtc_http2.c +++ b/bin/varnishtest/vtc_http2.c @@ -52,7 +52,7 @@ #define BUF_SIZE (1024*2048) static const char *const h2_errs[] = { -#define H2_ERROR(n,v,sc,t) [v] = #n, +#define H2_ERROR(n,v,sc,r,t) [v] = #n, #include NULL }; @@ -1228,7 +1228,7 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) else return (NULL); } -#define H2_ERROR(U,v,sc,t) \ +#define H2_ERROR(U,v,sc,r,t) \ if (!strcmp(spec, #U)) { return (#v); } #include "tbl/h2_error.h" return (spec); diff --git a/include/tbl/h2_error.h b/include/tbl/h2_error.h index 4d397922c..d8b1df3ab 100644 --- a/include/tbl/h2_error.h +++ b/include/tbl/h2_error.h @@ -30,6 +30,7 @@ * RFC7540 section 11.4 * * Types: conn=1|stream=2 + * Reason: enum sess_close */ /*lint -save -e525 -e539 */ @@ -38,6 +39,7 @@ H2_ERROR( /* name */ NO_ERROR, /* val */ 0, /* types */ 3, + /* reason */ SC_REM_CLOSE, /* descr */ "Graceful shutdown" ) @@ -45,6 +47,7 @@ H2_ERROR( /* name */ PROTOCOL_ERROR, /* val */ 1, /* types */ 3, + /* reason */ SC_RX_JUNK, /* descr */ "Protocol error detected" ) @@ -52,6 +55,7 @@ H2_ERROR( /* name */ INTERNAL_ERROR, /* val */ 2, /* types */ 3, + /* reason */ SC_VCL_FAILURE, /* descr */ "Implementation fault" ) @@ -59,6 +63,7 @@ H2_ERROR( /* name */ FLOW_CONTROL_ERROR, /* val */ 3, /* types */ 3, + /* reason */ SC_OVERLOAD, /* descr */ "Flow-control limits exceeded" ) @@ -66,6 +71,7 @@ H2_ERROR( /* name */ SETTINGS_TIMEOUT, /* val */ 4, /* types */ 1, + /* reason */ SC_RX_TIMEOUT, /* descr */ "Settings not acknowledged" ) @@ -73,6 +79,7 @@ H2_ERROR( /* name */ STREAM_CLOSED, /* val */ 5, /* types */ 2, + /* reason */ SC_NULL, /* descr */ "Frame received for closed stream" ) @@ -80,6 +87,7 @@ H2_ERROR( /* name */ FRAME_SIZE_ERROR, /* val */ 6, /* types */ 3, + /* reason */ SC_RX_JUNK, /* descr */ "Frame size incorrect" ) @@ -87,6 +95,7 @@ H2_ERROR( /* name */ REFUSED_STREAM, /* val */ 7, /* types */ 2, + /* reason */ SC_NULL, /* descr */ "Stream not processed" ) @@ -94,6 +103,7 @@ H2_ERROR( /* name */ CANCEL, /* val */ 8, /* types */ 2, + /* reason */ SC_NULL, /* descr */ "Stream cancelled" ) @@ -101,6 +111,7 @@ H2_ERROR( /* name */ COMPRESSION_ERROR, /* val */ 9, /* types */ 1, + /* reason */ SC_RX_JUNK, /* descr */ "Compression state not updated" ) @@ -108,6 +119,7 @@ H2_ERROR( /* name */ CONNECT_ERROR, /* val */ 10, /* types */ 2, + /* reason */ SC_NULL, /* descr */ "TCP connection error for CONNECT method" ) @@ -115,6 +127,7 @@ H2_ERROR( /* name */ ENHANCE_YOUR_CALM, /* val */ 11, /* types */ 3, + /* reason */ SC_OVERLOAD, /* descr */ "Processing capacity exceeded" ) @@ -122,6 +135,7 @@ H2_ERROR( /* name */ INADEQUATE_SECURITY, /* val */ 12, /* types */ 1, + /* reason */ SC_RX_JUNK, /* descr */ "Negotiated TLS parameters not acceptable" ) @@ -129,6 +143,7 @@ H2_ERROR( /* name */ HTTP_1_1_REQUIRED, /* val */ 13, /* types */ 1, + /* reason */ SC_REQ_HTTP20, /* descr */ "Use HTTP/1.1 for the request" ) From phk at FreeBSD.org Thu Feb 11 12:41:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 11 Feb 2021 12:41:08 +0000 (UTC) Subject: [master] 831ca47f8 Add numeric comparisons for HTTP headers: -lt, -le, -eq, -ne, -ge, -gt Message-ID: <20210211124108.A5F0D10E164@lists.varnish-cache.org> commit 831ca47f8dae4abd9c6174a4339e86252d13288e Author: Poul-Henning Kamp Date: Thu Feb 11 12:38:25 2021 +0000 Add numeric comparisons for HTTP headers: -lt, -le, -eq, -ne, -ge, -gt expect resp.http.content-length -le 1024 diff --git a/bin/varnishtest/vtc_subr.c b/bin/varnishtest/vtc_subr.c index fe5fe2008..3eb60c100 100644 --- a/bin/varnishtest/vtc_subr.c +++ b/bin/varnishtest/vtc_subr.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -109,6 +110,18 @@ vtc_expect(struct vtclog *vl, retval = strcmp(lhs, rhs) == 0; } else if (!strcmp(cmp, "!=")) { retval = strcmp(lhs, rhs) != 0; + } else if (!strcmp(cmp, "-lt")) { + retval = strtoul(lhs, NULL, 0) < strtoul(rhs, NULL, 0); + } else if (!strcmp(cmp, "-le")) { + retval = strtoul(lhs, NULL, 0) <= strtoul(rhs, NULL, 0); + } else if (!strcmp(cmp, "-eq")) { + retval = strtoul(lhs, NULL, 0) == strtoul(rhs, NULL, 0); + } else if (!strcmp(cmp, "-ne")) { + retval = strtoul(lhs, NULL, 0) != strtoul(rhs, NULL, 0); + } else if (!strcmp(cmp, "-ge")) { + retval = strtoul(lhs, NULL, 0) >= strtoul(rhs, NULL, 0); + } else if (!strcmp(cmp, "-gt")) { + retval = strtoul(lhs, NULL, 0) > strtoul(rhs, NULL, 0); } else if (j) { // fail inequality comparisons if either side is undef'ed retval = 0; From phk at FreeBSD.org Thu Feb 11 12:41:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 11 Feb 2021 12:41:08 +0000 (UTC) Subject: [master] 19a1f7459 Simplify this test by using numeric comparisons Message-ID: <20210211124108.BBDBA10E167@lists.varnish-cache.org> commit 19a1f7459f415742618b424dba36e9e3b6c2362f Author: Poul-Henning Kamp Date: Thu Feb 11 12:39:52 2021 +0000 Simplify this test by using numeric comparisons diff --git a/bin/varnishtest/tests/d00020.vtc b/bin/varnishtest/tests/d00020.vtc index 877672f06..0c42285d7 100644 --- a/bin/varnishtest/tests/d00020.vtc +++ b/bin/varnishtest/tests/d00020.vtc @@ -220,8 +220,7 @@ client c2 { rxresp expect resp.http.hash == "93d1c4ad76396c91dd97fa310f7f26445332662c89393dbeeb77fe49f9111ee4" expect resp.http.by == "HASH" - # == 0x93d1c4ad - expect resp.http.key == 2479998125 + expect resp.http.key -eq 0x93d1c4ad expect resp.http.alt == 0 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "true" @@ -231,8 +230,7 @@ client c2 { rxresp expect resp.http.hash == "e47da20ea4db49d4f22acdadc69f02f445002be520a2865cd3351272add62540" expect resp.http.by == "HASH" - # == 0xe47da20e - expect resp.http.key == 3833438734 + expect resp.http.key -eq 0xe47da20e expect resp.http.alt == 1 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "true" @@ -272,8 +270,7 @@ client c3 { rxresp expect resp.http.hash == "df9a465f8a0455c334b24c1638d3adda0f6e64fbe759029ab83602e3b9138884" expect resp.http.by == "HASH" - # == 0xdf9a465f - expect resp.http.key == 3751429727 + expect resp.http.key -eq 0xdf9a465f expect resp.http.alt == 7 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "true" @@ -283,8 +280,7 @@ client c3 { rxresp expect resp.http.hash == "0eb35bc1fab5aad5902fd1bac86540bd13d43aa31c6c46f54e776b43392e66e6" expect resp.http.by == "HASH" - # == 0x0eb35bc1 - expect resp.http.key == 246635457 + expect resp.http.key -eq 0x0eb35bc1 expect resp.http.alt == 8 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "true" @@ -294,8 +290,7 @@ client c3 { rxresp expect resp.http.hash == "1eb67b701ea07151cac5bea1f11b6267b9de15a3ff83cec995590480cbc2c750" expect resp.http.by == "HASH" - # == 0x1eb67b70 - expect resp.http.key == 515275632 + expect resp.http.key -eq 0x1eb67b70 expect resp.http.alt == 9 expect resp.http.warmup == "0.500" expect resp.http.rampup == "true" @@ -305,8 +300,7 @@ client c3 { rxresp expect resp.http.hash == "a11b617e21aa7db22b6205d7612002e595b1b00d8c11602017f65456a1be3a35" expect resp.http.by == "HASH" - # == 0xa11b617e - expect resp.http.key == 2702926206 + expect resp.http.key -eq 0xa11b617e expect resp.http.alt == 10 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "false" @@ -316,8 +310,7 @@ client c3 { rxresp expect resp.http.hash == "d7eecc0ac83e1727332dcd8c7c8ae9f3114123abb2bf7e3fb15ecea8c84bb239" expect resp.http.by == "HASH" - # == 0xd7eecc0a - expect resp.http.key == 3622751242 + expect resp.http.key -eq 0xd7eecc0a expect resp.http.alt == 11 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "true" From phk at FreeBSD.org Thu Feb 11 12:48:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 11 Feb 2021 12:48:06 +0000 (UTC) Subject: [master] 5ba17b5ad Test-coverage of new numeric comparisons Message-ID: <20210211124806.D8F0D10E6BA@lists.varnish-cache.org> commit 5ba17b5ad9ed473cda0a09a91ad72d716c6bf1de Author: Poul-Henning Kamp Date: Thu Feb 11 12:47:02 2021 +0000 Test-coverage of new numeric comparisons diff --git a/bin/varnishtest/tests/a00002.vtc b/bin/varnishtest/tests/a00002.vtc index 56bb068f5..0fb81d94e 100644 --- a/bin/varnishtest/tests/a00002.vtc +++ b/bin/varnishtest/tests/a00002.vtc @@ -16,6 +16,11 @@ client c1 -connect ${s1_sock} { expect resp.proto == HTTP/1.2 expect resp.status == 201 expect resp.reason == Foo + expect resp.status -lt 202 + expect resp.status -le 201 + expect resp.status -eq 201 + expect resp.status -ge 201 + expect resp.status -gt 0xc8 } client c1 -run From phk at FreeBSD.org Thu Feb 11 13:34:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 11 Feb 2021 13:34:07 +0000 (UTC) Subject: [master] 6143ab4f2 VSL log the hash input in this hash-input-test Message-ID: <20210211133407.530C910FB4E@lists.varnish-cache.org> commit 6143ab4f221ae68f2ffc7429d5653b9d746e3e58 Author: Poul-Henning Kamp Date: Thu Feb 11 13:29:24 2021 +0000 VSL log the hash input in this hash-input-test diff --git a/bin/varnishtest/tests/r01296.vtc b/bin/varnishtest/tests/r01296.vtc index 1683d926a..cac08bdd1 100644 --- a/bin/varnishtest/tests/r01296.vtc +++ b/bin/varnishtest/tests/r01296.vtc @@ -19,6 +19,8 @@ varnish v1 -vcl+backend { } } -start +varnish v1 -cliok "param.set vsl_mask +Hash" + client c1 { txreq -hdr "foo: 1" rxresp From phk at FreeBSD.org Thu Feb 11 13:34:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 11 Feb 2021 13:34:07 +0000 (UTC) Subject: [master] d6ad52f5f Change the way we calculate the hash key for the cache. Message-ID: <20210211133407.6A8C110FB51@lists.varnish-cache.org> commit d6ad52f5ff95daa3668fdad28b4c97e59b4c49d3 Author: Poul-Henning Kamp Date: Thu Feb 11 13:31:10 2021 +0000 Change the way we calculate the hash key for the cache. This lifts internal restrictions on the hashkey production, but does not change how things work from a VCL perspective. diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c index daf8a9cf7..a5dae200d 100644 --- a/bin/varnishd/cache/cache_hash.c +++ b/bin/varnishd/cache/cache_hash.c @@ -183,19 +183,6 @@ HSH_DeleteObjHead(const struct worker *wrk, struct objhead *oh) FREE_OBJ(oh); } -void -HSH_AddString(struct req *req, void *ctx, const char *str) -{ - - CHECK_OBJ_NOTNULL(req, REQ_MAGIC); - AN(ctx); - if (str != NULL) { - VSHA256_Update(ctx, str, strlen(str)); - VSLb(req->vsl, SLT_Hash, "%s", str); - } else - VSHA256_Update(ctx, &str, 1); -} - /*--------------------------------------------------------------------- * This is a debugging hack to enable testing of boundary conditions * in the hash algorithm. diff --git a/bin/varnishd/cache/cache_objhead.h b/bin/varnishd/cache/cache_objhead.h index bc1782379..af1797462 100644 --- a/bin/varnishd/cache/cache_objhead.h +++ b/bin/varnishd/cache/cache_objhead.h @@ -71,7 +71,6 @@ int HSH_DerefObjCore(struct worker *, struct objcore **, int rushmax); enum lookup_e HSH_Lookup(struct req *, struct objcore **, struct objcore **); void HSH_Ref(struct objcore *o); -void HSH_AddString(struct req *, void *ctx, const char *str); unsigned HSH_Purge(struct worker *, struct objhead *, vtim_real ttl_now, vtim_dur ttl, vtim_dur grace, vtim_dur keep); struct objcore *HSH_Private(const struct worker *wrk); diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index 9b5a4b8a5..d82955a96 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -50,7 +50,6 @@ #include "storage/storage.h" #include "common/heritage.h" #include "vcl.h" -#include "vsha256.h" #include "vtim.h" #define REQ_STEPS \ @@ -886,7 +885,6 @@ static enum req_fsm_nxt v_matchproto_(req_state_f) cnt_recv(struct worker *wrk, struct req *req) { unsigned recv_handling; - struct VSHA256Context sha256ctx; const char *ci, *cp, *endpname; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); @@ -957,13 +955,12 @@ cnt_recv(struct worker *wrk, struct req *req) } } - VSHA256_Init(&sha256ctx); - VCL_hash_method(req->vcl, wrk, req, NULL, &sha256ctx); + memset(req->digest, 0, sizeof req->digest); + VCL_hash_method(req->vcl, wrk, req, NULL, NULL); if (wrk->handling == VCL_RET_FAIL) recv_handling = wrk->handling; else assert(wrk->handling == VCL_RET_LOOKUP); - VSHA256_Final(req->digest, &sha256ctx); switch (recv_handling) { case VCL_RET_VCL: diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c index 0a729c0e4..6d323a22c 100644 --- a/bin/varnishd/cache/cache_vrt.c +++ b/bin/varnishd/cache/cache_vrt.c @@ -689,19 +689,29 @@ VRT_fail(VRT_CTX, const char *fmt, ...) VCL_VOID VRT_hashdata(VRT_CTX, VCL_STRANDS s) { + struct VSHA256Context sha256ctx; int i; CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); - AN(ctx->specific); + AZ(ctx->specific); + VSHA256_Init(&sha256ctx); + VSHA256_Update(&sha256ctx, ctx->req->digest, sizeof ctx->req->digest); AN(s); - for (i = 0; i < s->n; i++) - HSH_AddString(ctx->req, ctx->specific, s->p[i]); + for (i = 0; i < s->n; i++) { + if (s->p[i] != NULL) { + VSHA256_Update(&sha256ctx, s->p[i], strlen(s->p[i])); + VSLb(ctx->req->vsl, SLT_Hash, "%s", s->p[i]); + } else { + VSHA256_Update(&sha256ctx, "", 1); + } + } /* * Add a 'field-separator' to make it more difficult to * manipulate the hash. */ - HSH_AddString(ctx->req, ctx->specific, NULL); + VSHA256_Update(&sha256ctx, "", 1); + VSHA256_Final(ctx->req->digest, &sha256ctx); } /*--------------------------------------------------------------------*/ diff --git a/bin/varnishtest/tests/b00051.vtc b/bin/varnishtest/tests/b00051.vtc index 3681ad2b3..8119dc6b5 100644 --- a/bin/varnishtest/tests/b00051.vtc +++ b/bin/varnishtest/tests/b00051.vtc @@ -22,5 +22,5 @@ client c1 { rxresp expect resp.http.req_hash ~ "[[:xdigit:]]{64}" expect resp.http.req_hash == resp.http.bereq_hash - expect resp.http.req_hash-sf == ":3k0f0yRKtKt7akzkyNsTGSDOJAZOQowTwKWhu5+kIu0=:" + expect resp.http.req_hash-sf == ":0jkH41nfmD0PRFsKpM1m7ucOApnxFc62B//mQWxOnmQ=:" } -run diff --git a/bin/varnishtest/tests/d00020.vtc b/bin/varnishtest/tests/d00020.vtc index 0c42285d7..9f70ff2d3 100644 --- a/bin/varnishtest/tests/d00020.vtc +++ b/bin/varnishtest/tests/d00020.vtc @@ -218,9 +218,9 @@ client c1 { client c2 { txreq -url /b/def rxresp - expect resp.http.hash == "93d1c4ad76396c91dd97fa310f7f26445332662c89393dbeeb77fe49f9111ee4" + expect resp.http.hash == "2e03d4fee2722154a84036faa3e4b6851e003830eadbe0d2874e3df09c8efe55" expect resp.http.by == "HASH" - expect resp.http.key -eq 0x93d1c4ad + expect resp.http.key -eq 0x2e03d4fe expect resp.http.alt == 0 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "true" @@ -228,9 +228,9 @@ client c2 { txreq -url /b/hash rxresp - expect resp.http.hash == "e47da20ea4db49d4f22acdadc69f02f445002be520a2865cd3351272add62540" + expect resp.http.hash == "49f33e9019891091d3dcf6edab6d9433b756678bdf5202dd41b8a667c89887b1" expect resp.http.by == "HASH" - expect resp.http.key -eq 0xe47da20e + expect resp.http.key -eq 0x49f33e90 expect resp.http.alt == 1 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "true" @@ -268,9 +268,9 @@ client c2 { client c3 { txreq -url /b/c/hash/def rxresp - expect resp.http.hash == "df9a465f8a0455c334b24c1638d3adda0f6e64fbe759029ab83602e3b9138884" + expect resp.http.hash == "dd70dcbbf385c398ee3b53a849f12d0d846fc21292349fb45d37b2d9d8eca25e" expect resp.http.by == "HASH" - expect resp.http.key -eq 0xdf9a465f + expect resp.http.key -eq 0xdd70dcbb expect resp.http.alt == 7 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "true" @@ -278,9 +278,9 @@ client c3 { txreq -url /b/c/hash/hash rxresp - expect resp.http.hash == "0eb35bc1fab5aad5902fd1bac86540bd13d43aa31c6c46f54e776b43392e66e6" + expect resp.http.hash == "41d09b9877cd0ac0eab888359b0ad54f0bf41da0ac03dc1b8ae12aff18465a8d" expect resp.http.by == "HASH" - expect resp.http.key -eq 0x0eb35bc1 + expect resp.http.key -eq 0x41d09b98 expect resp.http.alt == 8 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "true" @@ -288,9 +288,9 @@ client c3 { txreq -url /b/c/hash/url rxresp - expect resp.http.hash == "1eb67b701ea07151cac5bea1f11b6267b9de15a3ff83cec995590480cbc2c750" + expect resp.http.hash == "dcac849e02b3322f5fd3dddf9b9f5fc26d295733e6f1c51b190dfb7239a56e28" expect resp.http.by == "HASH" - expect resp.http.key -eq 0x1eb67b70 + expect resp.http.key -eq 0xdcac849e expect resp.http.alt == 9 expect resp.http.warmup == "0.500" expect resp.http.rampup == "true" @@ -298,9 +298,9 @@ client c3 { txreq -url /b/c/hash/key rxresp - expect resp.http.hash == "a11b617e21aa7db22b6205d7612002e595b1b00d8c11602017f65456a1be3a35" + expect resp.http.hash == "112393761506e85f0c700a5d669a48b54001c870eb2e8d95f4d2f6fdccbe80a3" expect resp.http.by == "HASH" - expect resp.http.key -eq 0xa11b617e + expect resp.http.key -eq 0x11239376 expect resp.http.alt == 10 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "false" @@ -308,9 +308,9 @@ client c3 { txreq -url /b/c/hash/blob rxresp - expect resp.http.hash == "d7eecc0ac83e1727332dcd8c7c8ae9f3114123abb2bf7e3fb15ecea8c84bb239" + expect resp.http.hash == "5ef050c1185ac02a66d9f79703b8cd5f0636abf3b1f15b9f22e0fe64df985d28" expect resp.http.by == "HASH" - expect resp.http.key -eq 0xd7eecc0a + expect resp.http.key -eq 0x5ef050c1 expect resp.http.alt == 11 expect resp.http.warmup == "-1.000" expect resp.http.rampup == "true" diff --git a/include/vrt.h b/include/vrt.h index 08d217dd8..64b400068 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -53,6 +53,7 @@ * binary/load-time compatible, increment MAJOR version * * 13.0 (2021-03-15) + * VRT_hashdata() produces different hash-keys. * Move VRT_synth_page() to deprecated status * Add VRT_synth_strands() and VRT_synth_blob() * struct vrt_type now produced by generate.py From phk at FreeBSD.org Fri Feb 12 08:11:09 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Fri, 12 Feb 2021 08:11:09 +0000 (UTC) Subject: [master] 4ebc3cfec Make it possible to override the initial digest, and explain in a comment why it is not necessary. Message-ID: <20210212081109.0E8F2105A4A@lists.varnish-cache.org> commit 4ebc3cfec133586cd8c4a715d8de18efb76402f1 Author: Poul-Henning Kamp Date: Fri Feb 12 08:03:12 2021 +0000 Make it possible to override the initial digest, and explain in a comment why it is not necessary. Only call vcl_hash{} if the initial hash is still intact when we get there. diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index d82955a96..df1a674cf 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -76,6 +76,14 @@ REQ_STEPS #undef REQ_STEP +/* + * In this specific context we use SHA256 only as a very good + * hashing function. That renders most of the normal concerns + * about salting & seeding moot. However, if for some reason + * you want to salt your hashes, this is where you do it. + */ +static const uint8_t initial_digest[DIGEST_LEN]; + /*-------------------------------------------------------------------- * Handle "Expect:" and "Connection:" on incoming request */ @@ -914,6 +922,8 @@ cnt_recv(struct worker *wrk, struct req *req) return (REQ_FSM_DONE); } + memcpy(req->digest, initial_digest, sizeof req->digest); + VCL_recv_method(req->vcl, wrk, req, NULL, NULL); if (wrk->handling == VCL_RET_FAIL) { @@ -955,12 +965,13 @@ cnt_recv(struct worker *wrk, struct req *req) } } - memset(req->digest, 0, sizeof req->digest); - VCL_hash_method(req->vcl, wrk, req, NULL, NULL); - if (wrk->handling == VCL_RET_FAIL) - recv_handling = wrk->handling; - else - assert(wrk->handling == VCL_RET_LOOKUP); + if (!memcmp(req->digest, initial_digest, sizeof req->digest)) { + VCL_hash_method(req->vcl, wrk, req, NULL, NULL); + if (wrk->handling == VCL_RET_FAIL) + recv_handling = wrk->handling; + else + assert(wrk->handling == VCL_RET_LOOKUP); + } switch (recv_handling) { case VCL_RET_VCL: From phk at FreeBSD.org Fri Feb 12 08:11:09 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Fri, 12 Feb 2021 08:11:09 +0000 (UTC) Subject: [master] 03fe0cee1 Allow hash_data() in vcl_recv{} Message-ID: <20210212081109.23CF8105A4D@lists.varnish-cache.org> commit 03fe0cee1abc3741a7652ba2cf9c1bf822d65ab1 Author: Poul-Henning Kamp Date: Fri Feb 12 08:09:46 2021 +0000 Allow hash_data() in vcl_recv{} diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index eb0458bc3..42d5cf1ae 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -420,7 +420,7 @@ vcc_Action_Init(struct vcc *tl) ACT(ban, vcc_act_ban, 0); ACT(call, vcc_act_call, 0); ACT(hash_data, vcc_act_hash_data, - VCL_MET_HASH); + VCL_MET_RECV | VCL_MET_HASH); ACT(if, vcc_Act_If, 0); ACT(new, vcc_Act_New, VCL_MET_INIT); From phk at FreeBSD.org Fri Feb 12 10:33:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Fri, 12 Feb 2021 10:33:06 +0000 (UTC) Subject: [master] e36573e25 Add a test-case for hash_data() in vcl_recv{} Message-ID: <20210212103306.D279910953F@lists.varnish-cache.org> commit e36573e255af2aa1ed40fb367fcb5257ef7e0288 Author: Poul-Henning Kamp Date: Fri Feb 12 08:19:31 2021 +0000 Add a test-case for hash_data() in vcl_recv{} diff --git a/bin/varnishtest/tests/b00076.vtc b/bin/varnishtest/tests/b00076.vtc new file mode 100644 index 000000000..971c7774e --- /dev/null +++ b/bin/varnishtest/tests/b00076.vtc @@ -0,0 +1,31 @@ +varnishtest "hash_data() in vcl_recv{}" + +server s1 { + rxreq + txresp -hdr "Same: One" +} -start + +varnish v1 -vcl+backend { + sub vcl_recv { + if (req.url == "/2") { + hash_data(req.http.foo); + } + } + sub vcl_hash { + hash_data(req.url); + return (lookup); + } +} -start + +varnish v1 -cliok "param.set vsl_mask +Hash" + +client c1 { + txreq -url /1 + rxresp + expect resp.status == 200 + expect resp.http.same == One + txreq -url /2 -hdr "foo: /1" + rxresp + expect resp.status == 200 + expect resp.http.same == One +} -run From phk at FreeBSD.org Fri Feb 12 10:33:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Fri, 12 Feb 2021 10:33:06 +0000 (UTC) Subject: [master] 001279ebd Document proper design pattern for using hash_data() in vcl_recv, and protect this pattern in the test-case. Message-ID: <20210212103306.E8B6E109542@lists.varnish-cache.org> commit 001279ebd6ee83fafbc7fc1d1805bf2224361dd9 Author: Poul-Henning Kamp Date: Fri Feb 12 10:31:36 2021 +0000 Document proper design pattern for using hash_data() in vcl_recv, and protect this pattern in the test-case. diff --git a/bin/varnishtest/tests/b00076.vtc b/bin/varnishtest/tests/b00076.vtc index 971c7774e..120339275 100644 --- a/bin/varnishtest/tests/b00076.vtc +++ b/bin/varnishtest/tests/b00076.vtc @@ -29,3 +29,39 @@ client c1 { expect resp.status == 200 expect resp.http.same == One } -run + +server s1 { + rxreq + txresp -hdr "Second: One" +} -start + +varnish v1 -vcl+backend { + sub make_hash_key { + hash_data("Documented Design Pattern"); + hash_data(req.url); + } + + sub vcl_hash { + call make_hash_key; + return (lookup); + } + + sub vcl_recv { + if (req.http.early) { + call make_hash_key; + } + } +} + +client c1 { + txreq + rxresp + expect resp.status == 200 + expect resp.http.second == One + + txreq -hdr "early: yes" + rxresp + expect resp.status == 200 + expect resp.http.second == One +} -run + diff --git a/doc/sphinx/reference/dp_vcl_recv_hash.rst b/doc/sphinx/reference/dp_vcl_recv_hash.rst new file mode 100644 index 000000000..a44e07006 --- /dev/null +++ b/doc/sphinx/reference/dp_vcl_recv_hash.rst @@ -0,0 +1,24 @@ +.. _db_vcl_recv_hash: + +Hashing in `vcl_recv{}` +======================= + +Calculating the `hash` used for cache lookup already in `vcl_recv{}` +makes it possible for certain directors to offer targeted health status. + +To ensure consistent hashing, use this design pattern:: + + sub make_hash_key { + hash_data([?]); + } + + sub vcl_hash { + call make_hash_key; + return (lookup); + } + + sub vcl_recv { + [?] + call make_hash_key; + [?] + } diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst index 5cda7e77a..b9bd82c12 100644 --- a/doc/sphinx/reference/index.rst +++ b/doc/sphinx/reference/index.rst @@ -13,6 +13,14 @@ The VCL language VCL - Varnish Configuration Language states.rst +VCL Design Patterns +------------------- + +.. toctree:: + :maxdepth: 1 + + dp_vcl_recv_hash.rst + Bundled VMODs ------------- From phk at FreeBSD.org Fri Feb 12 11:14:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Fri, 12 Feb 2021 11:14:06 +0000 (UTC) Subject: [master] e98e8e649 Documentation updates for changed `vcl_hash{}` / `hash_data()` Message-ID: <20210212111406.8981510A9BC@lists.varnish-cache.org> commit e98e8e6497b9bbcca3e709a5ea0e094f2ec4b930 Author: Poul-Henning Kamp Date: Fri Feb 12 11:12:36 2021 +0000 Documentation updates for changed `vcl_hash{}` / `hash_data()` diff --git a/doc/changes.rst b/doc/changes.rst index a21ad8580..f23a79f70 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -30,6 +30,15 @@ release process. Varnish Cache Next (2021-03-15) ================================ +* `hash_data()` can be called from `vcl_recv`, in which case + `vcl_hash` is not called. This allows `vcl_recv` and + backends to take the object identity into account, for + instance when choosing backend and grace periods. + +* `hash_data()` calculates the hash-key differently than previously. + This means that persistent storage will be lost, and it may break + very specific `*.vtc` test-scripts. + * counters MAIN.s_req_bodybytes and VBE.*.tools.beresp_bodybytes are now always the number of bodybytes moved on the wire. diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst index 9dc04d6ca..d6f468e04 100644 --- a/doc/sphinx/reference/vcl.rst +++ b/doc/sphinx/reference/vcl.rst @@ -478,7 +478,9 @@ hash_data(input) ~~~~~~~~~~~~~~~~ Adds an input to the hash input. In the built-in VCL ``hash_data()`` - is called on the host and URL of the request. Available in ``vcl_hash``. + is called on the host and URL of the request. + Available in ``vcl_hash`` or ``vcl_recv``. If used in ``vcl_recv`` + ``vcl_hash`` will not be called. synthetic(STRING) ~~~~~~~~~~~~~~~~~ diff --git a/doc/sphinx/users-guide/vcl-built-in-subs.rst b/doc/sphinx/users-guide/vcl-built-in-subs.rst index c6755ee96..bb3673687 100644 --- a/doc/sphinx/users-guide/vcl-built-in-subs.rst +++ b/doc/sphinx/users-guide/vcl-built-in-subs.rst @@ -129,8 +129,9 @@ of the following keywords: vcl_hash ~~~~~~~~ -Called after `vcl_recv` to create a hash value for the request. This is -used as a key to look up the object in Varnish. +Called after `vcl_recv` to create a hash value for the request, +unless `vcl_recv` already did that. +This is used as the key to store and look up objects in the cache. The `vcl_hash` subroutine may terminate with calling ``return()`` with one of the following keywords: diff --git a/doc/sphinx/users-guide/vcl-hashing.rst b/doc/sphinx/users-guide/vcl-hashing.rst index bdc47b0bb..5d960a6d0 100644 --- a/doc/sphinx/users-guide/vcl-hashing.rst +++ b/doc/sphinx/users-guide/vcl-hashing.rst @@ -1,12 +1,10 @@ Hashing ------- -Internally, when Varnish stores content in the cache it stores the object -together with a hash key to find the object again. In the default setup -this key is calculated based on the content of the *Host* header or the -IP address of the server and the URL. - -Behold the `default vcl`:: +Internally, when Varnish stores content in the cache indexed by a hash +key used to find the object again. In the default setup +this key is calculated based on `URL`, the `Host:` header, or +if there is none, the IP address of the server:: sub vcl_hash { hash_data(req.url); @@ -18,7 +16,7 @@ Behold the `default vcl`:: return (lookup); } -As you can see it first checks in `req.url` then `req.http.host` if +As you can see it first hashes `req.url` and then `req.http.host` if it exists. It is worth pointing out that Varnish doesn't lowercase the hostname or the URL before hashing it so in theory having "Varnish.org/" and "varnish.org/" would result in different cache entries. Browsers @@ -42,7 +40,16 @@ And then add a `vcl_hash`:: hash_data(req.http.X-Country-Code); } -As the default VCL will take care of adding the host and URL to the hash -we don't have to do anything else. Be careful calling ``return (lookup)`` -as this will abort the execution of the default VCL and Varnish can end -up returning data based on more or less random inputs. +Because there is no `return(lookup)`, the builtin VCL will take care +of adding the URL, `Host:` or server IP# to the hash as usual. + +If `vcl_hash` did return, ie:: + + sub vcl_hash { + hash_data(req.http.X-Country-Code); + return(lookup); + } + +then *only* the country-code would matter, and Varnish would return +seemingly random objects, ignoring the URL, (but they would always +have the correct `X-Country-Code`). From phk at FreeBSD.org Mon Feb 15 13:43:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 15 Feb 2021 13:43:08 +0000 (UTC) Subject: [master] e7ad1e46a Give `varnishadm` a `-p` to disable libreadline and get VCLI compliance. Message-ID: <20210215134308.8942311C2D5@lists.varnish-cache.org> commit e7ad1e46a0f51a78db8df431deb07b7282e09a5c Author: Poul-Henning Kamp Date: Mon Feb 15 13:41:52 2021 +0000 Give `varnishadm` a `-p` to disable libreadline and get VCLI compliance. diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c index e3e76efa3..b9023eb97 100644 --- a/bin/varnishadm/varnishadm.c +++ b/bin/varnishadm/varnishadm.c @@ -75,6 +75,7 @@ static const double timeout = 5; // XXX should be settable by arg ? +static int p_arg = 0; static void cli_write(int sock, const char *s) @@ -254,7 +255,10 @@ pass_answer(int fd) RL_EXIT(1); } - printf("%u\n", status); + if (p_arg) + printf("%-3u %-8zu\n", status, strlen(answer)); + else + printf("%u\n", status); if (answer) { printf("%s\n", answer); free(answer); @@ -441,7 +445,7 @@ main(int argc, char * const *argv) * The '+' stops that from happening * See #1496 */ - while ((opt = getopt(argc, argv, "+hn:S:T:t:")) != -1) { + while ((opt = getopt(argc, argv, "+hn:pS:T:t:")) != -1) { switch (opt) { case 'h': /* Usage help */ @@ -449,6 +453,9 @@ main(int argc, char * const *argv) case 'n': n_arg = optarg; break; + case 'p': + p_arg = 1; + break; case 'S': S_arg = optarg; break; @@ -485,7 +492,7 @@ main(int argc, char * const *argv) NEEDLESS(exit(0)); } - if (isatty(0)) + if (isatty(0) && !p_arg) interactive(sock); else pass(sock); diff --git a/bin/varnishtest/tests/u00012.vtc b/bin/varnishtest/tests/u00012.vtc index 2744ae40a..4770e0fc9 100644 --- a/bin/varnishtest/tests/u00012.vtc +++ b/bin/varnishtest/tests/u00012.vtc @@ -14,15 +14,17 @@ client c1 { varnish v1 -vsl_catchup -process p1 -log {cat | varnishadm -n ${v1_name}} -start +process p1 -log {cat | varnishadm -p -n ${v1_name}} -start process p1 -write "ping\r" +process p1 -expect-text 0 1 "200 19" + process p1 -expect-text 0 1 "PONG" process p1 -write "vcl.list\r" -process p1 -expect-text 0 0 "auto warm" +process p1 -expect-text 0 0 "auto warm" process p1 -write "vcl.show vcl1\r" diff --git a/doc/sphinx/reference/varnishadm.rst b/doc/sphinx/reference/varnishadm.rst index e503671d9..aa7f3d4a4 100644 --- a/doc/sphinx/reference/varnishadm.rst +++ b/doc/sphinx/reference/varnishadm.rst @@ -38,6 +38,11 @@ OPTIONS -h Print program usage and exit. +-p + Force `pass` mode and make the output follow the VCLI protocol. + This disables command-history/command-completion and makes it + easier for programs to parse the response(s). + -n ident Connect to the instance of `varnishd` with this name. From dridi.boukelmoune at gmail.com Mon Feb 15 14:26:07 2021 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Mon, 15 Feb 2021 14:26:07 +0000 (UTC) Subject: [master] ce9fbe44d lookup: Add a notice for high numbers of variants Message-ID: <20210215142607.197C7659F@lists.varnish-cache.org> commit ce9fbe44dae592c7ea38339f3653eca782c2ece6 Author: Dridi Boukelmoune Date: Mon Feb 15 07:50:54 2021 +0100 lookup: Add a notice for high numbers of variants As a recurring pitfall sometimes hard to identify, it deserves its own notice. The accounting of variants reuses the worker's strangelove field since it doesn't conflict where other parts of the code base use it. diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c index a5dae200d..25beaf3d8 100644 --- a/bin/varnishd/cache/cache_hash.c +++ b/bin/varnishd/cache/cache_hash.c @@ -397,6 +397,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp) busy_found = 0; exp_oc = NULL; exp_t_origin = 0.0; + wrk->strangelove = 0; VTAILQ_FOREACH(oc, &oh->objcs, hsh_list) { /* Must be at least our own ref + the objcore we examine */ assert(oh->refcnt > 1); @@ -415,8 +416,10 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp) continue; if (oc->boc && oc->boc->vary != NULL && - !VRY_Match(req, oc->boc->vary)) + !VRY_Match(req, oc->boc->vary)) { + wrk->strangelove++; continue; + } busy_found = 1; continue; @@ -434,8 +437,10 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp) if (ObjHasAttr(wrk, oc, OA_VARY)) { vary = ObjGetAttr(wrk, oc, OA_VARY, NULL); AN(vary); - if (!VRY_Match(req, vary)) + if (!VRY_Match(req, vary)) { + wrk->strangelove++; continue; + } } if (req->vcf != NULL) { diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index df1a674cf..b8bb8b97b 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -543,6 +543,9 @@ cnt_lookup(struct worker *wrk, struct req *req) if (req->hash_objhead) had_objhead = 1; lr = HSH_Lookup(req, &oc, &busy); + if (wrk->strangelove >= 10) + VSLb(req->vsl, SLT_Notice, "vsl: High number of variants (%d)", + wrk->strangelove); if (lr == HSH_BUSY) { /* * We lost the session to a busy object, disembark the diff --git a/bin/varnishtest/tests/r02372.vtc b/bin/varnishtest/tests/r02372.vtc index 0df38cb79..d624d1141 100644 --- a/bin/varnishtest/tests/r02372.vtc +++ b/bin/varnishtest/tests/r02372.vtc @@ -13,11 +13,17 @@ varnish v1 -arg "-p workspace_thread=512" -vcl+backend { } } -start +logexpect l1 -v v1 { + expect * * Notice "High number of variants .71." +} -start + client c1 -repeat 72 -keepalive { txreq rxresp } -run +logexpect l1 -wait + client c2 { txreq -req "PURGE" rxresp diff --git a/doc/sphinx/reference/vsl.rst b/doc/sphinx/reference/vsl.rst index e1d608edb..5835f5a0d 100644 --- a/doc/sphinx/reference/vsl.rst +++ b/doc/sphinx/reference/vsl.rst @@ -134,6 +134,19 @@ it. The fetch is halted until the stale object is fully fetched, upon which the new object is created as normal. While waiting, any grace time on the stale object will be in effect. +High number of variants +~~~~~~~~~~~~~~~~~~~~~~~ + +Objects are primarily looked up from an index using the hash key computed from +the ``hash_data()`` VCL function. When variants are involved, that is to say +when a backend response was stored with a ``Vary`` header, a secondary lookup +is performed but it is not indexed. As the number of variants for a given key +increases, this can slow cache lookups down, and since this happens under a +lock, this can greatly increase lock contention, even more so for frequently +requested objects. Variants should therefore be used sparingly on cacheable +responses, but since they can originate from either VCL or origin servers, +this notice should help identify problematic resources. + HISTORY ======= From dridi.boukelmoune at gmail.com Mon Feb 15 14:26:07 2021 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Mon, 15 Feb 2021 14:26:07 +0000 (UTC) Subject: [master] e74abf895 param: New vary_notice parameter Message-ID: <20210215142607.3160E65A2@lists.varnish-cache.org> commit e74abf895d2e1147ab474e0490cbf7dd33ce2454 Author: Dridi Boukelmoune Date: Mon Feb 15 11:48:15 2021 +0100 param: New vary_notice parameter To control the threshold used to warn. diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index b8bb8b97b..eb40fa98f 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -543,7 +543,7 @@ cnt_lookup(struct worker *wrk, struct req *req) if (req->hash_objhead) had_objhead = 1; lr = HSH_Lookup(req, &oc, &busy); - if (wrk->strangelove >= 10) + if (wrk->strangelove >= cache_param->vary_notice) VSLb(req->vsl, SLT_Notice, "vsl: High number of variants (%d)", wrk->strangelove); if (lr == HSH_BUSY) { diff --git a/include/tbl/params.h b/include/tbl/params.h index 6f4b6ad8b..fe4d2a293 100644 --- a/include/tbl/params.h +++ b/include/tbl/params.h @@ -944,6 +944,18 @@ PARAM_SIMPLE( /* flags */ EXPERIMENTAL ) +PARAM_SIMPLE( + /* name */ vary_notice, + /* type */ uint, + /* min */ "1", + /* max */ NULL, + /* def */ "10", + /* units */ "variants", + /* descr */ + "How many variants need to be evaluated to log a Notice that there " + "might be too many variants." +) + PARAM_SIMPLE( /* name */ vcl_cooldown, /* type */ timeout, From nils.goroll at uplex.de Mon Feb 15 15:03:04 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 15 Feb 2021 15:03:04 +0000 (UTC) Subject: [master] 7ec28f1ae Enable calling a dynamic sub Message-ID: <20210215150304.1883D7B6A@lists.varnish-cache.org> commit 7ec28f1ae91bd39e6e89beb7dffd4248c5054414 Author: Nils Goroll Date: Tue Feb 2 17:53:44 2021 +0100 Enable calling a dynamic sub that is, call vmod.returning_sub(); in VCL. Background: The existing call sub; is special in that it instantiates "sub", if it does not exist already, enabling use-before-definition semantics. The doctrine of this change is to preserve this behaviour and to not make existing, static calls any less efficient. Implementation: To support calling both literal SUBs as well as SUB expressions, we peek into the symbol table to check if the called expression is a function, based on the knowledge that, as of now, only functions can have a non-literal SUB return. We also know that no other expression can yield a SUB. So if peeking ahead tells us that a function follows, we call into expression evaluation. Otherwise, we expect a literal SUB as before. Null check: For dynamic SUB calls from vmods via VRT_call(), we require the SUB argument be non-NULL. But we can not for call: To signal error with a SUB return, a vmod function needs to be allowed to return NULL, otherwise it would need to have a dummy return value available for the VRT_fail() case. So we need to check for NULL in VGC. Alternatives considered: - We could make expression evaluation return SUB also for literal SUB symbols, turning all calls into sub->func(ctx, ...) C statements. I tried this path and it resulted in a change of behaviour with cc_command="clang -g -O2 ...": Where, previously, sub code was inlined, it would now generate an explicit C function call always, despite the fact that the C function is known at compile time (because all named VCL_SUB structs are). So this option was dismissed for violating the doctrine. - The null check could go to VPI, via a VPI_call(), basically identical to VRT_call(), but checking for NULL. This option was dismissed because it would foreclose the requirement to allow for SUB arguments in the future. Acknowledgements: reza mentioned the idea of call SUB at one point, and I can not remember if I had it before or not, so when in doubt, it was his idea. Dridi helped with ideas on the implementation and spotted a bug. diff --git a/bin/varnishtest/tests/m00054.vtc b/bin/varnishtest/tests/m00054.vtc index 87b53f591..3cda1eeb5 100644 --- a/bin/varnishtest/tests/m00054.vtc +++ b/bin/varnishtest/tests/m00054.vtc @@ -19,7 +19,7 @@ varnish v1 -vcl { backend dummy None; sub vcl_recv { - debug.call(debug.total_recall()); + call debug.total_recall(); } } diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index 42d5cf1ae..cc99c8537 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -45,10 +45,38 @@ static void v_matchproto_(sym_act_f) vcc_act_call(struct vcc *tl, struct token *t, struct symbol *sym) { struct token *t0; + unsigned u; (void)t; ExpectErr(tl, ID); t0 = tl->t; + sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_NONE, SYMTAB_NOERR, XREF_NONE); + tl->t = t0; + // only functions/methods may evaluate to SUB + if (sym != NULL && (sym->kind == SYM_FUNC || sym->kind == SYM_METHOD)) { + u = tl->unique++; + + Fb(tl, 1, "{\n"); + tl->indent += INDENT; + Fb(tl, 2, "VCL_SUB call_%u =\n", u); + tl->indent += INDENT; + vcc_Expr(tl, SUB); + Fb(tl, 2, ";\n\n"); + SkipToken(tl, ';'); + tl->indent -= INDENT; + Fb(tl, 2, "if (call_%u == NULL) {\n", u); + Fb(tl, 2, " VRT_fail(ctx, \"Tried to call NULL SUB near" + " source %%u line %%u\",\n"); + Fb(tl, 2, " VGC_ref[%u].source,\n", tl->cnt); + Fb(tl, 2, " VGC_ref[%u].line);\n", tl->cnt); + Fb(tl, 2, " END_;\n"); + Fb(tl, 2, "}\n"); + Fb(tl, 2, "call_%u->func(ctx, VSUB_STATIC, NULL);\n", u); + tl->indent -= INDENT; + Fb(tl, 1, "}\n"); + return; + } + sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_SUB, SYMTAB_CREATE, XREF_REF); if (sym != NULL) { vcc_AddCall(tl, t0, sym); From guillaume at varnish-software.com Mon Feb 15 15:42:07 2021 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Mon, 15 Feb 2021 15:42:07 +0000 (UTC) Subject: [master] 1d5c0aae4 [cci] work around glibc bug Message-ID: <20210215154207.93E759E79@lists.varnish-cache.org> commit 1d5c0aae4236a22006317415553705665ad7dade Author: Guillaume Quintard Date: Mon Feb 15 07:41:11 2021 -0800 [cci] work around glibc bug diff --git a/.circleci/config.yml b/.circleci/config.yml index 9a10465cc..eb89904c0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -206,6 +206,8 @@ jobs: tar \ sudo elif [ << parameters.dist >> = archlinux ]; then + # XXX: TEMPORARY fix for https://bugs.archlinux.org/task/69563 + patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && bsdtar -C / -xvf "$patched_glibc" pacman -Sy --noconfirm \ base-devel \ ca-certificates \ From phk at FreeBSD.org Mon Feb 15 15:49:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 15 Feb 2021 15:49:07 +0000 (UTC) Subject: [master] eb3c0e11e Extend -p(ass) mode also to argv mode. Message-ID: <20210215154907.36E386057F@lists.varnish-cache.org> commit eb3c0e11e0e829ff6f23fda43f817d9f04e8cfaa Author: Poul-Henning Kamp Date: Mon Feb 15 15:42:10 2021 +0000 Extend -p(ass) mode also to argv mode. diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c index b9023eb97..76b19e775 100644 --- a/bin/varnishadm/varnishadm.c +++ b/bin/varnishadm/varnishadm.c @@ -156,12 +156,42 @@ cli_sock(const char *T_arg, const char *S_arg) return (sock); } +static unsigned +pass_answer(int fd) +{ + unsigned u, status; + char *answer = NULL; + + u = VCLI_ReadResult(fd, &status, &answer, timeout); + if (u) { + if (status == CLIS_COMMS) + RL_EXIT(0); + if (answer) + fprintf(stderr, "%s\n", answer); + RL_EXIT(1); + } + + if (p_arg && answer != NULL) { + printf("%-3u %-8zu\n%s", status, strlen(answer), answer); + } else if (p_arg) { + printf("%-3u %-8u\n", status, 0U); + } else { + printf("%u\n", status); + if (answer != NULL) + printf("%s\n", answer); + if (status == CLIS_TRUNCATED) + printf("[response was truncated]\n"); + } + free(answer); + (void)fflush(stdout); + return (status); +} + static void v_noreturn_ do_args(int sock, int argc, char * const *argv) { int i; unsigned status; - char *answer = NULL; for (i = 0; i < argc; i++) { /* XXX: We should really CLI-quote these */ @@ -170,20 +200,12 @@ do_args(int sock, int argc, char * const *argv) cli_write(sock, argv[i]); } cli_write(sock, "\n"); - - (void)VCLI_ReadResult(sock, &status, &answer, 2000); - - /* XXX: AZ() ? */ - (void)close(sock); - - printf("%s\n", answer); - if (status == CLIS_OK) - exit(0); - if (status == CLIS_TRUNCATED) { - printf("[response was truncated]\n"); + status = pass_answer(sock); + closefd(&sock); + if (status == CLIS_OK || status == CLIS_TRUNCATED) exit(0); - } - fprintf(stderr, "Command failed with error code %u\n", status); + if (!p_arg) + fprintf(stderr, "Command failed with error code %u\n", status); exit(1); } @@ -240,33 +262,6 @@ varnishadm_completion (const char *text, int start, int end) return (matches); } -static void -pass_answer(int fd) -{ - unsigned u, status; - char *answer = NULL; - - u = VCLI_ReadResult(fd, &status, &answer, timeout); - if (u) { - if (status == CLIS_COMMS) - RL_EXIT(0); - if (answer) - fprintf(stderr, "%s\n", answer); - RL_EXIT(1); - } - - if (p_arg) - printf("%-3u %-8zu\n", status, strlen(answer)); - else - printf("%u\n", status); - if (answer) { - printf("%s\n", answer); - free(answer); - } - if (status == CLIS_TRUNCATED) - printf("[response was truncated]\n"); - (void)fflush(stdout); -} /* * No arguments given, simply pass bytes on stdin/stdout and CLI socket @@ -327,7 +322,7 @@ interactive(int sock) if (fds[0].revents & POLLIN) { /* Get rid of the prompt, kinda hackish */ printf("\r \r"); - pass_answer(fds[0].fd); + (void)pass_answer(fds[0].fd); rl_forced_update_display(); } if (fds[1].revents & POLLIN) { @@ -358,7 +353,7 @@ pass(int sock) } assert(i > 0); if (fds[0].revents & POLLIN) - pass_answer(fds[0].fd); + (void)pass_answer(fds[0].fd); if (fds[1].revents & POLLIN || fds[1].revents & POLLHUP) { n = read(fds[1].fd, buf, sizeof buf - 1); if (n == 0) { From phk at FreeBSD.org Mon Feb 15 15:49:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 15 Feb 2021 15:49:07 +0000 (UTC) Subject: [master] 49f4f916a We no longer need `cat |` to disable libreadline Message-ID: <20210215154907.4FB7960583@lists.varnish-cache.org> commit 49f4f916a32af04784da353ad9a14d93129afa89 Author: Poul-Henning Kamp Date: Mon Feb 15 15:43:05 2021 +0000 We no longer need `cat |` to disable libreadline diff --git a/bin/varnishtest/tests/u00012.vtc b/bin/varnishtest/tests/u00012.vtc index 4770e0fc9..5dc3fcb9e 100644 --- a/bin/varnishtest/tests/u00012.vtc +++ b/bin/varnishtest/tests/u00012.vtc @@ -14,7 +14,7 @@ client c1 { varnish v1 -vsl_catchup -process p1 -log {cat | varnishadm -p -n ${v1_name}} -start +process p1 -log {varnishadm -p -n ${v1_name}} -start process p1 -write "ping\r" From phk at FreeBSD.org Mon Feb 15 15:49:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 15 Feb 2021 15:49:07 +0000 (UTC) Subject: [master] a5bfbaba6 Move the API aspects of VCLI to the reference manual. Message-ID: <20210215154907.6C50A60587@lists.varnish-cache.org> commit a5bfbaba60150a37b21d05973a4a8687f9abc7ea Author: Poul-Henning Kamp Date: Mon Feb 15 15:47:52 2021 +0000 Move the API aspects of VCLI to the reference manual. diff --git a/doc/sphinx/reference/cli_protocol.rst b/doc/sphinx/reference/cli_protocol.rst new file mode 100644 index 000000000..2d40eb79a --- /dev/null +++ b/doc/sphinx/reference/cli_protocol.rst @@ -0,0 +1,126 @@ +.. role:: ref(emphasis) + +.. _ref_cli_api: + +=========================================== +VCLI protocol - Scripting the CLI interface +=========================================== + +The Varnish CLI has a few bells&whistles when used as an API. + +First: `vcli.h` contains magic numbers. + +Second: If you use `varnishadm` to connect to `varnishd` use the +`-p` argument to get "pass" mode. + +In "pass" mode, or with direct CLI connections (more below), the +first line of responses is always exactly 13 bytes long, including +the NL, and it contains two numbers: The status code and the count +of bytes in the remainder of the response:: + + 200?19? + PONG?1613397488?1.0 + +This makes parsing the response unambiguous, even in cases like this +where the response does not end with a NL. + +The varnishapi library contains functions to implement the basics of +the CLI protocol, for more, see the `vcli.h` include file. + +.. _ref_psk_auth: + +Authentication CLI connections +------------------------------ + +CLI connections to `varnishd` are authenticated with a "pre-shared-key" +authentication scheme, where the other end must prove they know the +contents of a particular file, either by being able to access it on +the machine `varnishd` runs on, usually via information in `VSM` or +by having a local copy of the file on another machine. + +The precise filename can be configured with the `-S` option to `varnishd` +and regular file system permissions control access to it. + +The file is only read at the time the `auth` CLI command is issued +and the contents is not cached in `varnishd`, so it is possible to +change the contents of the file while `varnishd` is running. + +An authenticated session looks like this: + +.. code-block:: text + + critter phk> telnet localhost 1234 + Trying ::1... + Trying 127.0.0.1... + Connected to localhost. + Escape character is '^]'. + 107 59 + ixslvvxrgkjptxmcgnnsdxsvdmvfympg + + Authentication required. + + auth 455ce847f0073c7ab3b1465f74507b75d3dc064c1e7de3b71e00de9092fdc89a + 200 279 + ----------------------------- + Varnish Cache CLI 1.0 + ----------------------------- + FreeBSD,13.0-CURRENT,amd64,-jnone,-sdefault,-sdefault,-hcritbit + varnish-trunk revision 89a558e56390d425c52732a6c94087eec9083115 + + Type 'help' for command list. + Type 'quit' to close CLI session. + Type 'start' to launch worker process. + +The CLI status of 107 indicates that authentication is necessary. The +first 32 characters of the response text is the challenge +"ixsl...mpg". The challenge is randomly generated for each CLI +connection, and changes each time a 107 is emitted. + +The most recently emitted challenge must be used for calculating the +authenticator "455c...c89a". + +The authenticator is calculated by applying the SHA256 function to the +following byte sequence: + +* Challenge string +* Newline (0x0a) character. +* Contents of the secret file +* Challenge string +* Newline (0x0a) character. + +and dumping the resulting digest in lower-case hex. + +In the above example, the secret file contains ``foo\n`` and thus: + +.. code-block:: text + + critter phk> hexdump secret + 00000000 66 6f 6f 0a |foo.| + 00000004 + critter phk> cat > tmpfile + ixslvvxrgkjptxmcgnnsdxsvdmvfympg + foo + ixslvvxrgkjptxmcgnnsdxsvdmvfympg + ^D + critter phk> hexdump -C tmpfile + 00000000 69 78 73 6c 76 76 78 72 67 6b 6a 70 74 78 6d 63 |ixslvvxrgkjptxmc| + 00000010 67 6e 6e 73 64 78 73 76 64 6d 76 66 79 6d 70 67 |gnnsdxsvdmvfympg| + 00000020 0a 66 6f 6f 0a 69 78 73 6c 76 76 78 72 67 6b 6a |.foo.ixslvvxrgkj| + 00000030 70 74 78 6d 63 67 6e 6e 73 64 78 73 76 64 6d 76 |ptxmcgnnsdxsvdmv| + 00000040 66 79 6d 70 67 0a |fympg.| + 00000046 + critter phk> sha256 tmpfile + SHA256 (_) = 455ce847f0073c7ab3b1465f74507b75d3dc064c1e7de3b71e00de9092fdc89a + critter phk> openssl dgst -sha256 < tmpfile + 455ce847f0073c7ab3b1465f74507b75d3dc064c1e7de3b71e00de9092fdc89a + +The sourcefile `lib/libvarnish/cli_auth.c` contains a useful function +which calculates the response, given an open filedescriptor to the +secret file, and the challenge string. + +See also: +--------- + +* :ref:`varnishadm(1)` +* :ref:`varnishd(1)` +* :ref:`vcl(7)` diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst index b9bd82c12..335c1d00f 100644 --- a/doc/sphinx/reference/index.rst +++ b/doc/sphinx/reference/index.rst @@ -42,7 +42,7 @@ The CLI interface :maxdepth: 1 VarnishAdm - Control program for Varnish - VCLI - The commands varnish understands + CLI - The commands varnish understands Logging and monitoring ---------------------- @@ -93,6 +93,7 @@ For Developers VMODS - Extensions to VCL VSM - Shared memory use VDIR - Backends & Directors + VCLI - CLI protocol API .. Vmod_debug ? diff --git a/doc/sphinx/reference/varnish-cli.rst b/doc/sphinx/reference/varnish-cli.rst index 2b425c220..6b7cfaf28 100644 --- a/doc/sphinx/reference/varnish-cli.rst +++ b/doc/sphinx/reference/varnish-cli.rst @@ -317,108 +317,6 @@ that can be be later reacquired. You can manually set the temperature of a VCL or let varnish automatically handle it. - -Scripting ---------- - -If you are going to write a script that talks CLI to varnishd, the -include/cli.h contains the relevant magic numbers. - -One particular magic number to know, is that the line with the status -code and length field always is exactly 13 characters long, including -the NL character. - -The varnishapi library contains functions to implement the basics of -the CLI protocol, see the `vcli.h` include file. - -.. _ref_psk_auth: - -Authentication with -S ----------------------- - -If the -S secret-file is given as argument to varnishd, all network -CLI connections must authenticate, by proving they know the contents -of that file. - -The file is read at the time the auth command is issued and the -contents is not cached in varnishd, so it is possible to update the -file on the fly. - -Use the unix file permissions to control access to the file. - -An authenticated session looks like this: - -.. code-block:: text - - critter phk> telnet localhost 1234 - Trying ::1... - Trying 127.0.0.1... - Connected to localhost. - Escape character is '^]'. - 107 59 - ixslvvxrgkjptxmcgnnsdxsvdmvfympg - - Authentication required. - - auth 455ce847f0073c7ab3b1465f74507b75d3dc064c1e7de3b71e00de9092fdc89a - 200 279 - ----------------------------- - Varnish Cache CLI 1.0 - ----------------------------- - FreeBSD,13.0-CURRENT,amd64,-jnone,-sdefault,-sdefault,-hcritbit - varnish-trunk revision 89a558e56390d425c52732a6c94087eec9083115 - - Type 'help' for command list. - Type 'quit' to close CLI session. - Type 'start' to launch worker process. - -The CLI status of 107 indicates that authentication is necessary. The -first 32 characters of the response text is the challenge -"ixsl...mpg". The challenge is randomly generated for each CLI -connection, and changes each time a 107 is emitted. - -The most recently emitted challenge must be used for calculating the -authenticator "455c...c89a". - -The authenticator is calculated by applying the SHA256 function to the -following byte sequence: - -* Challenge string -* Newline (0x0a) character. -* Contents of the secret file -* Challenge string -* Newline (0x0a) character. - -and dumping the resulting digest in lower-case hex. - -In the above example, the secret file contains ``foo\n`` and thus: - -.. code-block:: text - - critter phk> hexdump secret - 00000000 66 6f 6f 0a |foo.| - 00000004 - critter phk> cat > tmpfile - ixslvvxrgkjptxmcgnnsdxsvdmvfympg - foo - ixslvvxrgkjptxmcgnnsdxsvdmvfympg - ^D - critter phk> hexdump -C tmpfile - 00000000 69 78 73 6c 76 76 78 72 67 6b 6a 70 74 78 6d 63 |ixslvvxrgkjptxmc| - 00000010 67 6e 6e 73 64 78 73 76 64 6d 76 66 79 6d 70 67 |gnnsdxsvdmvfympg| - 00000020 0a 66 6f 6f 0a 69 78 73 6c 76 76 78 72 67 6b 6a |.foo.ixslvvxrgkj| - 00000030 70 74 78 6d 63 67 6e 6e 73 64 78 73 76 64 6d 76 |ptxmcgnnsdxsvdmv| - 00000040 66 79 6d 70 67 0a |fympg.| - 00000046 - critter phk> sha256 tmpfile - SHA256 (_) = 455ce847f0073c7ab3b1465f74507b75d3dc064c1e7de3b71e00de9092fdc89a - critter phk> openssl dgst -sha256 < tmpfile - 455ce847f0073c7ab3b1465f74507b75d3dc064c1e7de3b71e00de9092fdc89a - -The sourcefile lib/libvarnish/cli_auth.c contains a useful function -which calculates the response, given an open filedescriptor to the -secret file, and the challenge string. - EXAMPLES ======== @@ -456,3 +354,4 @@ SEE ALSO * :ref:`varnishadm(1)` * :ref:`varnishd(1)` * :ref:`vcl(7)` +* For API use of the CLI: The Reference Manual. From guillaume at varnish-software.com Mon Feb 15 15:56:06 2021 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Mon, 15 Feb 2021 15:56:06 +0000 (UTC) Subject: [master] 47a9ae005 [cci] download fixed package in /tmp Message-ID: <20210215155606.9EC6860CC8@lists.varnish-cache.org> commit 47a9ae00572ad6afa261f29c1dfc0be0b636423e Author: Guillaume Quintard Date: Mon Feb 15 07:55:24 2021 -0800 [cci] download fixed package in /tmp diff --git a/.circleci/config.yml b/.circleci/config.yml index eb89904c0..09d0f2db1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -207,7 +207,9 @@ jobs: sudo elif [ << parameters.dist >> = archlinux ]; then # XXX: TEMPORARY fix for https://bugs.archlinux.org/task/69563 + cd /tmp patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && bsdtar -C / -xvf "$patched_glibc" + cd - pacman -Sy --noconfirm \ base-devel \ ca-certificates \ From nils.goroll at uplex.de Mon Feb 15 17:35:50 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 15 Feb 2021 18:35:50 +0100 Subject: [master] 47a9ae005 [cci] download fixed package in /tmp In-Reply-To: <20210215155606.9EC6860CC8@lists.varnish-cache.org> References: <20210215155606.9EC6860CC8@lists.varnish-cache.org> Message-ID: <4b2f75cb-9e47-b107-5a83-cc51616e2b00@uplex.de> On 15/02/2021 16:56, Guillaume Quintard wrote: > + cd /tmp > patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && bsdtar -C / -xvf "$patched_glibc" > + cd - not important, but FTR: I like pushd / popd for this pattern -- ** * * UPLEX - Nils Goroll Systemoptimierung Scheffelstra?e 32 22301 Hamburg tel +49 40 28805731 mob +49 170 2723133 fax +49 40 42949753 xmpp://slink at jabber.int.uplex.de/ http://uplex.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From nils.goroll at uplex.de Mon Feb 15 17:50:59 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 15 Feb 2021 18:50:59 +0100 Subject: [master] 4ebc3cfec Make it possible to override the initial digest, and explain in a comment why it is not necessary. In-Reply-To: <20210212081109.0E8F2105A4A@lists.varnish-cache.org> References: <20210212081109.0E8F2105A4A@lists.varnish-cache.org> Message-ID: <30e28976-4074-453a-8126-4b06840fe994@uplex.de> Hi, this thing happened when I did not have enough time to reflect, so just two points on the way out: - Do we need a way to fix the hash within vcl_recv? For example, if a backend decision has been made on the basis of the hash, we do not want it to change any more. - Should we bump the vcl version? We have done so for comparably less significant changes (see introduction of UDS), and this definitely falls in the "semantic change without syntactic change" category. Existing VCL could, for example, rely on vcl_hash to be called. Nils -- ** * * UPLEX - Nils Goroll Systemoptimierung Scheffelstra?e 32 22301 Hamburg tel +49 40 28805731 mob +49 170 2723133 fax +49 40 42949753 xmpp://slink at jabber.int.uplex.de/ http://uplex.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From guillaume at varnish-software.com Mon Feb 15 17:59:54 2021 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Mon, 15 Feb 2021 09:59:54 -0800 Subject: [master] 47a9ae005 [cci] download fixed package in /tmp In-Reply-To: <4b2f75cb-9e47-b107-5a83-cc51616e2b00@uplex.de> References: <20210215155606.9EC6860CC8@lists.varnish-cache.org> <4b2f75cb-9e47-b107-5a83-cc51616e2b00@uplex.de> Message-ID: I don't need these new kid toys, "cd -" is good enough! #getoffmylawn More seriously, I don't have the brains to remember further than one level back, so I never felt the need to use popd/pushd, but I'm sure the pointer will be useful to others. -- Guillaume Quintard On Mon, Feb 15, 2021 at 9:35 AM Nils Goroll wrote: > On 15/02/2021 16:56, Guillaume Quintard wrote: > > + cd /tmp > > patched_glibc=glibc-linux4-2.33-4-x86_64.pkg.tar.zst && > curl -LO "https://repo.archlinuxcn.org/x86_64/$patched_glibc" && bsdtar > -C / -xvf "$patched_glibc" > > + cd - > > not important, but FTR: I like pushd / popd for this pattern > > -- > > ** * * UPLEX - Nils Goroll Systemoptimierung > > Scheffelstra?e 32 > 22301 Hamburg > > tel +49 40 28805731 > mob +49 170 2723133 > fax +49 40 42949753 > > xmpp://slink at jabber.int.uplex.de/ > > http://uplex.de/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nils.goroll at uplex.de Tue Feb 16 03:45:37 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 16 Feb 2021 04:45:37 +0100 Subject: [master] 4ebc3cfec Make it possible to override the initial digest, and explain in a comment why it is not necessary. In-Reply-To: <30e28976-4074-453a-8126-4b06840fe994@uplex.de> References: <20210212081109.0E8F2105A4A@lists.varnish-cache.org> <30e28976-4074-453a-8126-4b06840fe994@uplex.de> Message-ID: <5d8f2eb7-3a71-6ba4-36d3-b2d8a65ecefb@uplex.de> On 15/02/2021 18:50, Nils Goroll wrote: > - Should we bump the vcl version? > > We have done so for comparably less significant changes (see introduction of > UDS), and this definitely falls in the "semantic change without syntactic > change" category. > > Existing VCL could, for example, rely on vcl_hash to be called. Also this might contradict or at least complicate Dridis efforts to allow "other version includes": For this vcl... # included.vcl vcl 4.1; sub vcl_hash { hash_data("I rely on it"); } # default.vcl vcl 4.2; include "included.vcl"; sub vcl_recv { hash_data(req.http.foo); } the whole point would be to _not_ silently allow the include: By the structure of the include, the code in "included.vcl" would have precedence over anything else, but with the hash_data change it now does not even get called any more. It seems the hash change would have required more deliberation. Nils -- ** * * UPLEX - Nils Goroll Systemoptimierung Scheffelstra?e 32 22301 Hamburg tel +49 40 28805731 mob +49 170 2723133 fax +49 40 42949753 xmpp://slink at jabber.int.uplex.de/ http://uplex.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From dridi at varni.sh Tue Feb 16 06:09:18 2021 From: dridi at varni.sh (Dridi Boukelmoune) Date: Tue, 16 Feb 2021 06:09:18 +0000 Subject: [master] 4ebc3cfec Make it possible to override the initial digest, and explain in a comment why it is not necessary. In-Reply-To: <5d8f2eb7-3a71-6ba4-36d3-b2d8a65ecefb@uplex.de> References: <20210212081109.0E8F2105A4A@lists.varnish-cache.org> <30e28976-4074-453a-8126-4b06840fe994@uplex.de> <5d8f2eb7-3a71-6ba4-36d3-b2d8a65ecefb@uplex.de> Message-ID: > > Hi, > > > > this thing happened when I did not have enough time to reflect, so just two > > points on the way out: > > > > - Do we need a way to fix the hash within vcl_recv? > > > > For example, if a backend decision has been made on the basis of the hash, we > > do not want it to change any more. This is exactly where this hash_data-from-vcl_recv falls short in our current model. The availability of variables (including read-only vs read-write) is tied to steps today and that allows predictability and consistency. So today we have this: - vcl_recv - vcl_hash - lookup We build req.hash in vcl_hash, after we get a chance to normalize the request in vcl_recv. Here we have clear steps to "fix" req (vcl_recv) and then "fix" req.hash (vcl_hash). I'm aware that req is writeable in vcl_hash, but considering that you could leave vcl_recv from multiple branches, that linear ordering of steps gives you in effect a clear boundary where you can expect req to have been "fixed". With the previous/only consensus we would have: - vcl_recv - vcl_hash - vcl_lookup - lookup And vcl_lookup would be the step where you expect the hash to be consistently "fixed" or "finalized" or "actionable" without having to worry about it. It would be enforced by the type/symbol system, just like any other VCL variable, at compile time. No surprises. > > - Should we bump the vcl version? > > > > We have done so for comparably less significant changes (see introduction of > > UDS), and this definitely falls in the "semantic change without syntactic > > change" category. Not sure about that, but well, more complications. > > Existing VCL could, for example, rely on vcl_hash to be called. > > Also this might contradict or at least complicate Dridis efforts to allow "other > version includes": For this vcl... > > > # included.vcl > vcl 4.1; > > sub vcl_hash { > hash_data("I rely on it"); > } > > # default.vcl > vcl 4.2; > > include "included.vcl"; > > sub vcl_recv { > hash_data(req.http.foo); > } > > the whole point would be to _not_ silently allow the include: By the structure > of the include, the code in "included.vcl" would have precedence over anything > else, but with the hash_data change it now does not even get called any more. I think this is a dead end, like the `new` keyword that can be used in a branch, it would be harder to determine at compile time that hash_data wasn't relied on in both vcl_recv and vcl_hash (and it's always called in the built-in vcl_hash anyway) so that would have to be a runtime check anyway. And this means that "I rely on it" would have to be silently ignored and that in effect you couldn't reliably rely on it feeding your hash. This is the worst possible tradeoff. > It seems the hash change would have required more deliberation. It's not too late to revert. From nils.goroll at uplex.de Tue Feb 16 06:48:57 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 16 Feb 2021 07:48:57 +0100 Subject: [master] 4ebc3cfec Make it possible to override the initial digest, and explain in a comment why it is not necessary. In-Reply-To: References: <20210212081109.0E8F2105A4A@lists.varnish-cache.org> <30e28976-4074-453a-8126-4b06840fe994@uplex.de> <5d8f2eb7-3a71-6ba4-36d3-b2d8a65ecefb@uplex.de> Message-ID: On 16/02/2021 07:09, Dridi Boukelmoune wrote: >> It seems the hash change would have required more deliberation. > It's not too late to revert. I fear we would soon regret it if we did not. -- ** * * UPLEX - Nils Goroll Systemoptimierung Scheffelstra?e 32 22301 Hamburg tel +49 40 28805731 mob +49 170 2723133 fax +49 40 42949753 xmpp://slink at jabber.int.uplex.de/ http://uplex.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From phk at phk.freebsd.dk Tue Feb 16 07:30:12 2021 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Tue, 16 Feb 2021 07:30:12 +0000 Subject: [master] 4ebc3cfec Make it possible to override the initial digest, and explain in a comment why it is not necessary. In-Reply-To: References: <20210212081109.0E8F2105A4A@lists.varnish-cache.org> <30e28976-4074-453a-8126-4b06840fe994@uplex.de> <5d8f2eb7-3a71-6ba4-36d3-b2d8a65ecefb@uplex.de> Message-ID: <97696.1613460612@critter.freebsd.dk> -------- Nils Goroll writes: > Do we need a way to fix the hash within vcl_recv? Strictly speaking no, but wouldn't that just introduce the "leak" where the freeze isn't called either ? > Should we bump the vcl version? Since we are 100% backwards compatible at VCL level, I see no reason. > Existing VCL could, for example, rely on vcl_hash to be called. And it will still be called, *precisely* as it has always been, unless and until people explicitly change their VCL to start calling hash_data() in vcl_recv{} context. But for all I care we can add a feature-flag, so allowing hash_data{} in vcl_recv{} must be explicitly configured, that way nobody uses it by mistake. Dridi Boukelmoune writes: > So today we have this: > > - vcl_recv > - vcl_hash > - lookup Yes, that's what we had before, and that's what we have after my change too, unless and until people start calling hash_data() in vcl_recv{}, *nothing has changed*. Really! If you dont like this new feature, dont use it. If you use it, follow the recipe on the tin: http://varnish-cache.org/docs/trunk/reference/dp_vcl_recv_hash.html > I think this is a dead end, like the `new` keyword that can be used > in a branch, Are there mistakes in VCL ? Ohhh God yes! But never forget that VCL is the foundation of Varnish's success, fuck too much with it, and you will loose users. > [...] it would be harder to determine at compile time that > hash_data wasn't relied on in both vcl_recv and vcl_hash You seem to have a much higher level of ambition for compile-time checks than I have ever harboured for VCC ? If we want to attain _that_ level of ambition, the only realistic way is to make LLVM a mandatory dependency so we can get hold of it's IR. Dridi Boukelmoune writes: > It's not too late to revert. Nils Goroll writes: > I fear we would soon regret it if we did not. Poul-Henning answers: And I'm 100% fine with that. But do not make the mistaken assumption that vcl_lookup{} then automatically goes in! As I said in the original ticket: To add a new vcl_*{} must clear a *very* high barrier of additional benefits and vcl_lookup{} is no where near. If you want vcl_lookup{}, you have to make a *MUCH* stronger use case and come up with *MUCH* more interesting things it can be used for. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From nils.goroll at uplex.de Tue Feb 16 08:21:42 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 16 Feb 2021 09:21:42 +0100 Subject: [master] 4ebc3cfec Make it possible to override the initial digest, and explain in a comment why it is not necessary. In-Reply-To: <97696.1613460612@critter.freebsd.dk> References: <20210212081109.0E8F2105A4A@lists.varnish-cache.org> <30e28976-4074-453a-8126-4b06840fe994@uplex.de> <5d8f2eb7-3a71-6ba4-36d3-b2d8a65ecefb@uplex.de> <97696.1613460612@critter.freebsd.dk> Message-ID: <7f950ae9-9677-8051-49e0-42350615a479@uplex.de> Hi, thank you for the quick answer On 16/02/2021 08:30, Poul-Henning Kamp wrote: > >> Do we need a way to fix the hash within vcl_recv? > > Strictly speaking no, but wouldn't that just introduce the "leak" > where the freeze isn't called either ? Having reflected on it, I am not sure if the "hash_fix()" within vcl_recv {} would be a good solution. I had mentioned the idea in order to salvage the hash_data() change, but I agree with you that it could easily be forgotten and thus would be of limited use. I think Diri has explained nicely how the "demarcation lines" between the fsm states clearly are a superior concept, and with the hash_data change we would have, to some degree, given up on it. So please, for now, please take my question only as indication of an issue we need to address >> Should we bump the vcl version? > > Since we are 100% backwards compatible at VCL level, I see no reason. > >> Existing VCL could, for example, rely on vcl_hash to be called. > > And it will still be called, *precisely* as it has always been, > unless and until people explicitly change their VCL to start calling > hash_data() in vcl_recv{} context. The problem I see here is with the real-world practice of VCL code reuse, where people just do not consider that, once they use hash_data(), they would need to review all their "library VCL". > But for all I care we can add a feature-flag, so allowing hash_data{} in > vcl_recv{} must be explicitly configured, that way nobody uses it by mistake. Hm, that would be a different option. But I thought we had the vcl versioning for exactly that kind of change, where syntax remains compatible despite semantic changes. > Really! If you dont like this new feature, dont use it. If you > use it, follow the recipe on the tin: > > http://varnish-cache.org/docs/trunk/reference/dp_vcl_recv_hash.html I think I understand your commits. But my concern is that, for the "VCL library" case, this would not be practical. > But never forget that VCL is the foundation of Varnish's success, > fuck too much with it, and you will loose users. phk, I am 100% with you, and this thread is _exactly_ about this point. I think the hash_data change falls into the f*ckup category. > (revert) > And I'm 100% fine with that. OK, I think we should do that then and take the time to find whatever we think is the best solution. > But do not make the mistaken assumption that vcl_lookup{} then automatically goes in! Though we had agreed on vcl_lookup already, the only regrets I have about the current situation is that elevated frustration levels could have been avoided. That is to say, I do not question your veto right, no matter how late the hour, and I do not think anyone else does. The situation is unfortunate on the emotional side, but we should all be allowed to change our minds. > If you want vcl_lookup{}, you have to make a *MUCH* stronger use case > and come up with *MUCH* more interesting things it can be used for. In my opinion, vcl_lookup{} is the best proposal for the respective use case I have seen so far. That does not mean it needs to be the best one, I have just not seen a better one yet. In particular, I think the hash_data() change also has unresolved issues. Let's take the time to find the best possible solution and agree on it. Nils -- ** * * UPLEX - Nils Goroll Systemoptimierung Scheffelstra?e 32 22301 Hamburg tel +49 40 28805731 mob +49 170 2723133 fax +49 40 42949753 xmpp://slink at jabber.int.uplex.de/ http://uplex.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From phk at phk.freebsd.dk Tue Feb 16 09:07:02 2021 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Tue, 16 Feb 2021 09:07:02 +0000 Subject: [master] 4ebc3cfec Make it possible to override the initial digest, and explain in a comment why it is not necessary. In-Reply-To: <7f950ae9-9677-8051-49e0-42350615a479@uplex.de> References: <20210212081109.0E8F2105A4A@lists.varnish-cache.org> <30e28976-4074-453a-8126-4b06840fe994@uplex.de> <5d8f2eb7-3a71-6ba4-36d3-b2d8a65ecefb@uplex.de> <97696.1613460612@critter.freebsd.dk> <7f950ae9-9677-8051-49e0-42350615a479@uplex.de> Message-ID: <32564.1613466422@critter.freebsd.dk> -------- Nils Goroll writes: >> But for all I care we can add a feature-flag, so allowing hash_data{} in >> vcl_recv{} must be explicitly configured, that way nobody uses it by mistake. > >Hm, that would be a different option. But I thought we had the vcl versioning >for exactly that kind of change, where syntax remains compatible despite >semantic changes. I dont know why you would think this is a semantic change ? By default nothing happens any differently. If you start using this feature, it has consequences, just like if you start using esi, gzip or other features we offer. Would you also bump the VCL version if we added a brotli VFP ? If we think the risk of unintended consequences from included vcl-library code is too big, controling this behaviour with a feature-flag makes a lot of sense. > Though we had agreed on vcl_lookup already, the only regrets I have about the > current situation is that elevated frustration levels could have been avoided. No! I have *only* ever agreed to look at a suggested implementation and its documentation, and having seen the former has not changed my mind. If you want vcl_lookup{}, you only chance is to do it by writing documentation which makes a compelling argument for it carrying its weight. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From nils.goroll at uplex.de Tue Feb 16 10:15:37 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 16 Feb 2021 11:15:37 +0100 Subject: [master] 4ebc3cfec Make it possible to override the initial digest, and explain in a comment why it is not necessary. In-Reply-To: <32564.1613466422@critter.freebsd.dk> References: <20210212081109.0E8F2105A4A@lists.varnish-cache.org> <30e28976-4074-453a-8126-4b06840fe994@uplex.de> <5d8f2eb7-3a71-6ba4-36d3-b2d8a65ecefb@uplex.de> <97696.1613460612@critter.freebsd.dk> <7f950ae9-9677-8051-49e0-42350615a479@uplex.de> <32564.1613466422@critter.freebsd.dk> Message-ID: <5780263e-d3df-2f76-7734-3c8265267ca3@uplex.de> On 16/02/2021 10:07, Poul-Henning Kamp wrote: >>> But for all I care we can add a feature-flag, so allowing hash_data{} in >>> vcl_recv{} must be explicitly configured, that way nobody uses it by mistake. >> >> Hm, that would be a different option. But I thought we had the vcl versioning >> for exactly that kind of change, where syntax remains compatible despite >> semantic changes. > > I dont know why you would think this is a semantic change ? > > By default nothing happens any differently. > > If you start using this feature, it has consequences, just like if you start > using esi, gzip or other features we offer. > > Would you also bump the VCL version if we added a brotli VFP ? Neither of these stop calling a built-in sub. And exactly that is what I would call a relevant semantic change. I agree that we should only use the vcl version if necessary. As you might remember, there have been a number of proposals for vcl version bumps which I thought would not qualify. > If we think the risk of unintended consequences from included vcl-library code > is too big, controling this behaviour with a feature-flag makes a lot of sense. It does - but, again, I would have thought our mechanism for this kind of change was the vcl version. Anyway, this is one of two issues currently on the table. The other is the problem of "fixing" the hash within vcl_recv. > If you want vcl_lookup{} I do not think I said I would. What I said is that I think it is the least worst solution to #3259 currently on the table. Nils -- ** * * UPLEX - Nils Goroll Systemoptimierung Scheffelstra?e 32 22301 Hamburg tel +49 40 28805731 mob +49 170 2723133 fax +49 40 42949753 xmpp://slink at jabber.int.uplex.de/ http://uplex.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From phk at FreeBSD.org Tue Feb 16 11:08:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 16 Feb 2021 11:08:07 +0000 (UTC) Subject: [master] 6483ae21f Split backend and probe content out of vcl(7) to separate pages. Message-ID: <20210216110807.D2BE311AC75@lists.varnish-cache.org> commit 6483ae21f96fd5f7f9cedae916524a7c619c17a8 Author: Poul-Henning Kamp Date: Tue Feb 16 11:07:12 2021 +0000 Split backend and probe content out of vcl(7) to separate pages. diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst index 335c1d00f..2b8479243 100644 --- a/doc/sphinx/reference/index.rst +++ b/doc/sphinx/reference/index.rst @@ -10,7 +10,9 @@ The VCL language .. toctree:: :maxdepth: 1 - VCL - Varnish Configuration Language + VCL - The Varnish Configuration Language + VCL backend configuration + VCL backend health probe states.rst VCL Design Patterns diff --git a/doc/sphinx/reference/vcl-backend.rst b/doc/sphinx/reference/vcl-backend.rst new file mode 100644 index 000000000..8d5472144 --- /dev/null +++ b/doc/sphinx/reference/vcl-backend.rst @@ -0,0 +1,157 @@ +.. role:: ref(emphasis) + +.. _vcl-backend(7): + +============ +VCL-backends +============ + +-------------------- +Configuring Backends +-------------------- + +:Manual section: 7 + +.. _backend_definition: + +Backend definition +------------------ + +A backend declaration creates and initialises a named backend object. +A declaration start with the keyword ``backend`` followed by the name of the +backend. The actual declaration is in curly brackets, in a key/value fashion.:: + + backend name { + .attribute1 = value; + .attribute2 = value; + [...] + } + +If there is a backend named ``default`` it will be used unless another +backend is explicitly set. If no backend is named ``default`` the first +backend in the VCL program becomes the default. + +If you only use dynamic backends created by VMODs, an empty, always failing +(503) backend can be specified:: + + backend default none; + +A backend must be specified with either a ``.host`` or a ``.path`` attribute, but +not both. All other attributes have default values. + +Attribute ``.host`` +------------------- + +To specify a networked backend ``.host`` takes either a numeric +IPv4/IPv6 address or a domain name which resolves to *at most* +one IPv4 and one IPv6 address:: + + .host = "127.0.0.1"; + + .host = "[::1]:8080"; + + .host = "example.com:8081"; + +The TCP port number can be specied as part of ``.host`` as a bove +or separately using the ``.port`` attribute:: + + .port = 8081; + +Attribute ``.path`` +------------------- + +The absolute path to a Unix(4) domain socket of a local backend:: + + .path = "/var/run/http.sock"; + +A warning will be issued if the uds-socket does not exist when the +VCL is loaded. This makes it possible to start the UDS-listening peer, +or set the socket file's permissions afterwards. + +If the uds-socket socket does not exist or permissions deny access, +connection attempts will fail. + +Attribute ``.host_header`` +-------------------------- + +A host header to add to probes and regular backend requests if they have no such header:: + + .host_header = "Host: example.com"; + +Timeout Attributes +------------------ + +These attributes control how patient `varnishd` is during backend fetches:: + + .connect_timeout = 1.4s; + .first_byte_timeout = 20s; + .between_bytes_timeout = 10s; + +The default values comes parameters with the same names, see :ref:`varnishd(1)`. + +Attribute ``.max_connections`` +------------------------------ + +Limit how many simultaneous connections varnish can open to the backend:: + + .max_connections = 1000; + +Attribute ``.proxy_header`` +--------------------------- + +Send a PROXY protocol header to the backend with the ``client.ip`` and +``server.ip`` values:: + + .proxy_header = 2; + +Legal values are one and two, depending which version of the PROXY protocol you want. + +*Notice* this setting will lead to backend connections being used +for a single request only (subject to future improvements). Thus, +extra care should be taken to avoid running into failing backend +connections with EADDRNOTAVAIL due to no local ports being +available. Possible options are: + + * Use additional backend connections to extra IP addresses or TCP ports + + * Increase the number of available ports (Linux sysctl ``net.ipv4.ip_local_port_range``) + + * Reuse backend connection ports early (Linux sysctl ``net.ipv4.tcp_tw_reuse``) + +Attribute ``.preamble`` +----------------------- + +Send a BLOB on all newly opened connections to the backend:: + + .preamble = :SGVsbG8gV29ybGRcbgo=:; + +Attribute ``.probe`` +-------------------- + +Please see :ref:`vcl-probe(7)`. + +SEE ALSO +-------- + +* :ref:`varnishd(1)` +* :ref:`vcl(7)` +* :ref:`vcl-probe(7)` +* :ref:`vmod_directors(3)` +* :ref:`vmod_std(3)` + +HISTORY +------- + +VCL was developed by Poul-Henning Kamp in cooperation with Verdens +Gang AS, Redpill Linpro and Varnish Software. This manual page is +written by Per Buer, Poul-Henning Kamp, Martin Blix Grydeland, +Kristian Lyngst?l, Lasse Karstensen and others. + +COPYRIGHT +--------- + +This document is licensed under the same license as Varnish +itself. See LICENSE for details. + +* Copyright (c) 2006 Verdens Gang AS +* Copyright (c) 2006-2021 Varnish Software AS diff --git a/doc/sphinx/reference/vcl-probe.rst b/doc/sphinx/reference/vcl-probe.rst new file mode 100644 index 000000000..4268807c8 --- /dev/null +++ b/doc/sphinx/reference/vcl-probe.rst @@ -0,0 +1,183 @@ +.. role:: ref(emphasis) + +.. _vcl-probe(7): + +========= +VCL-probe +========= + +--------------------------------- +Configuring Backend Health Probes +--------------------------------- + +:Manual section: 7 + +.. _reference-vcl_probes: + +Backend health probes +--------------------- + +Varnish can be configured to periodically send a request to test if a +backend is answering and thus "healthy". + +Probes can be configured per backend:: + + backend foo { + [...] + .probe = { + [...] + } + } + +They can be named and shared between backends:: + + probe light { + [...] + } + + backend foo { + .probe = light; + } + + backend bar { + .probe = light; + } + +Or a ``default`` probe can be defined, which applies to all backends +without a specific ``.probe`` configured:: + + probe default { + [...] + } + +The basic syntax is the same as for backends:: + + probe name { + .attribute1 = value; + .attribute2 = "value"; + [...] + } + +There are no mandatory attributes, they all have defaults. + +Attribute ``.url`` +------------------ + +The URL to query. Defaults to ``/``:: + + .url = "/health-probe"; + +Attribute ``.request`` +---------------------- + +Can be used to specify a full HTTP/1.1 request to be sent:: + + .request = "GET / HTTP/1.1" + "Host: example.com" + "X-Magic: We're fine with this." + "Connection: close"; + +Each of the strings will have ``CRNL`` appended and a final HTTP +header block terminating ``CRNL`` will be appended as well. + +Because connection shutdown is part of the health check, +``Connection: close`` is mandatory. + +Attribute ``.expected_response`` +-------------------------------- + +The expected HTTP status, defaults to ``200``:: + + .expected_response = 418; + +Attribute ``.timeout`` +---------------------- + +How fast the probe must succeed, default is two seconds:: + + .timeout = 10s; + +Attribute ``.interval`` +----------------------- + +Time between probes, default is five seconds:: + + .interval = 1m; + +The backend health shift register +--------------------------------- + +Backend health probes uses a 64 stage shift register to remember the +most recent health probes and to evaluate the total health of the backend. + +In the CLI, a good backend health status looks like this: + +.. code-block:: text + + varnish> backend.list -p boot.backend + Backend name Admin Probe Health Last change + boot.backend probe 5/5 healthy Wed, 13 Jan 2021 10:31:50 GMT + Current states good: 5 threshold: 4 window: 5 + Average response time of good probes: 0.000793 + Oldest ================================================== Newest + 4444444444444444444444444444444444444444444444444444444444444444 Good IPv4 + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Good Xmit + RRRRRRRRRRRRRRRRRRRRRRR----RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR Good Recv + HHHHHHHHHHHHHHHHHHHHHHH--------HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH Happy + +Starting from the bottom, the last line shows that this backend has been +declared "Happy" for most the 64 health probes, but there were some +trouble some while ago. + +However, in this case the ``.window`` is configured to five, and the +``.threshold`` is set to four, so at this point in time, the backend +is considered fully healthy. + +An additional ``.initial`` fills that many "happy" entries in the +shift register when the VCL is loaded, so that backends can quickly +become healthy, even if their health is normally considered over +many samples:: + + .interval = 1s; + .window = 60; + .threshold = 45; + .initial = 43; + +This backend will be considered healthy if three out of four health +probes in the last minute were good, but it becomes healthy as soon +as two good probes have happened after the VCL was loaded. + +The default values are: + +* ``.window`` = 8 + +* ``.threshold`` = 3 + +* ``.initial`` = one less than ``.threshold`` + + +SEE ALSO +======== + +* :ref:`varnishd(1)` +* :ref:`vcl(7)` +* :ref:`vcl-backend(7)` +* :ref:`vmod_directors(3)` +* :ref:`vmod_std(3)` + +HISTORY +======= + +VCL was developed by Poul-Henning Kamp in cooperation with Verdens +Gang AS, Redpill Linpro and Varnish Software. This manual page is +written by Per Buer, Poul-Henning Kamp, Martin Blix Grydeland, +Kristian Lyngst?l, Lasse Karstensen and others. + +COPYRIGHT +========= + +This document is licensed under the same license as Varnish +itself. See LICENSE for details. + +* Copyright (c) 2006 Verdens Gang AS +* Copyright (c) 2006-2021 Varnish Software AS diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst index d6f468e04..97fe80466 100644 --- a/doc/sphinx/reference/vcl.rst +++ b/doc/sphinx/reference/vcl.rst @@ -214,157 +214,10 @@ Example:: */ } -.. _backend_definition: - -Backend definition ------------------- - -A backend declaration creates and initialises a named backend object. A -declaration start with the keyword ``backend`` followed by the name of the -backend. The actual declaration is in curly brackets, in a key/value fashion.:: - - backend name { - .attribute = "value"; - } - -One of the attributes ``.host`` or ``.path`` is mandatory (but not -both). The attributes will inherit their defaults from the global -parameters. The following attributes are available: - - ``.host`` - The host to be used. IP address or a hostname that resolves to a - single IP address. This attribute is mandatory, unless ``.path`` - is declared. - - ``.path`` (``VCL >= 4.1``) - - The absolute path of a Unix domain socket at which a backend is - listening. If the file at that path does not exist or is not - accessible to Varnish at VCL load time, then the VCL compiler - issues a warning, but does not fail. This makes it possible to - start the UDS-listening peer, or set the socket file's - permissions, after starting Varnish or loading VCL with a UDS - backend. But the socket file must exist and have necessary - permissions before the first connection is attempted, otherwise - fetches will fail. If the file does exist and is accessible, then - it must be a socket; otherwise the VCL load fails. One of - ``.path`` or ``.host`` must be declared (but not both). ``.path`` - may only be used in VCL since version 4.1. - - ``.port`` - The port on the backend that Varnish should connect to. Ignored if - a Unix domain socket is declared in ``.path``. - - ``.host_header`` - A host header to add to probes and regular backend requests if they have no - such header. - - ``.connect_timeout`` - Timeout for connections. - - Default: ``connect_timeout`` parameter, see :ref:`varnishd(1)` - - ``.first_byte_timeout`` - Timeout for first byte. - - Default: ``first_byte_timeout`` parameter, see :ref:`varnishd(1)` - - ``.between_bytes_timeout`` - Timeout between bytes. - - Default: ``between_bytes_timeout`` parameter, see :ref:`varnishd(1)` - - ``.probe`` - Attach a probe to the backend. See `Probes`_ - - ``.proxy_header`` - The PROXY protocol version Varnish should use when connecting to - this backend. Allowed values are ``1`` and ``2``. - - *Notice* this setting will lead to backend connections being used - for a single request only (subject to future improvements). Thus, - extra care should be taken to avoid running into failing backend - connections with EADDRNOTAVAIL due to no local ports being - available. Possible options are: - - * Use additional backend connections to extra IP addresses or TCP - ports - - * Increase the number of available ports (Linux sysctl - ``net.ipv4.ip_local_port_range``) - - * Reuse backend connection ports early (Linux sysctl - ``net.ipv4.tcp_tw_reuse``) - - ``.max_connections`` - Maximum number of open connections towards this backend. If - Varnish reaches the maximum Varnish it will start failing - connections. - -Empty backends can also be defined using the following syntax.:: - - backend name none; - -An empty backend will always return status code 503 as if it is sick. - -Backends can be used with *directors*. Please see the -:ref:`vmod_directors(3)` man page for more information. - -.. _reference-vcl_probes: - -Probes ------- - -Probes will query the backend for status on a regular basis and mark -the backend as down it they fail. A probe is defined as this:: - - probe name { - .attribute = "value"; - } - -The probe named ``default`` is special and will be used for all backends -which do not explicitly reference a probe. - -There are no mandatory options. These are the options you can set: - - ``.url`` - The URL to query. Defaults to ``/``. - Mutually exclusive with ``.request`` - - ``.request`` - Specify a full HTTP request using multiple strings. ``.request`` will - have ``\r\n`` automatically inserted after every string. - Mutually exclusive with ``.url``. - - *Note* that probes require the backend to complete sending the - response and close the connection within the specified timeout, so - ``.request`` will, for ``HTTP/1.1``, most likely need to contain a - ``"Connection: close"`` string. - - ``.expected_response`` - The expected HTTP response code. Defaults to ``200``. - - ``.timeout`` - The timeout for the probe. Default is ``2s``. - - ``.interval`` - How often the probe is run. Default is ``5s``. - - ``.initial`` - How many of the polls in ``.window`` are considered good when Varnish - starts. Defaults to the value of ``.threshold`` - 1. In this case, the - backend starts as sick and requires one single poll to be - considered healthy. - - ``.window`` - How many of the latest polls we examine to determine backend health. - Defaults to ``8``. - - ``.threshold`` - How many of the polls in ``.window`` must have succeeded to - consider the backend to be healthy. - Defaults to ``3``. +Backends and health probes +-------------------------- +Please see :ref:`vcl-backend(7)` and :ref:`vcl-probe(7)` Access Control List (ACL) ------------------------- @@ -542,6 +395,8 @@ SEE ALSO ======== * :ref:`varnishd(1)` +* :ref:`vcl-backend(7)` +* :ref:`vcl-probe(7)` * :ref:`vmod_directors(3)` * :ref:`vmod_std(3)` diff --git a/man/Makefile.am b/man/Makefile.am index 15bf7c9fc..bae551370 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -4,6 +4,8 @@ dist_man_MANS = \ varnish-cli.7 \ varnish-counters.7 \ vcl.7 \ + vcl-backend.7 \ + vcl-probe.7 \ vsl.7 \ vsl-query.7 \ varnishadm.1 \ @@ -48,6 +50,12 @@ vcl.7: $(top_builddir)/doc/sphinx/reference/vcl.rst \ $(top_srcdir)/bin/varnishd/builtin.vcl $(BUILD_MAN) $(top_builddir)/doc/sphinx/reference/vcl.rst $@ +vcl-backend.7: $(top_builddir)/doc/sphinx/reference/vcl-backend.rst + $(BUILD_MAN) $(top_builddir)/doc/sphinx/reference/vcl-backend.rst $@ + +vcl-probe.7: $(top_builddir)/doc/sphinx/reference/vcl-probe.rst + $(BUILD_MAN) $(top_builddir)/doc/sphinx/reference/vcl-probe.rst $@ + vsl.7: $(top_builddir)/doc/sphinx/reference/vsl.rst \ $(top_builddir)/doc/sphinx/include/vsl-tags.rst $(BUILD_MAN) $(top_builddir)/doc/sphinx/reference/vsl.rst $@ From phk at FreeBSD.org Tue Feb 16 14:16:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 16 Feb 2021 14:16:06 +0000 (UTC) Subject: [master] 41ad2c65e Teach VCC to do modules on INT, this is handy in vcl_synth{}: Message-ID: <20210216141606.A593B61FF0@lists.varnish-cache.org> commit 41ad2c65ec2550242f7f85a0ab5cc85d420b53a3 Author: Poul-Henning Kamp Date: Tue Feb 16 13:55:11 2021 +0000 Teach VCC to do modules on INT, this is handy in vcl_synth{}: sub vcl_synth { if (resp.status == 12404) { [...] // this specific 404 } else if (resp.status % 1000 == 404) { [...] // all other 404's } } diff --git a/bin/varnishtest/tests/v00020.vtc b/bin/varnishtest/tests/v00020.vtc index c9d41647b..9f93b241d 100644 --- a/bin/varnishtest/tests/v00020.vtc +++ b/bin/varnishtest/tests/v00020.vtc @@ -56,6 +56,13 @@ varnish v1 -errvcl {BOOL + BOOL not possible.} { } } +varnish v1 -errvcl {Operator % only possible on INT} { + sub vcl_recv { + if (req.ttl % 1000) { + } + } +} + varnish v1 -vcl { backend b { .host = "${localhost}"; } sub vcl_recv { diff --git a/bin/varnishtest/tests/v00050.vtc b/bin/varnishtest/tests/v00050.vtc index f4ab7acfe..b2529ed1e 100644 --- a/bin/varnishtest/tests/v00050.vtc +++ b/bin/varnishtest/tests/v00050.vtc @@ -123,6 +123,7 @@ varnish v1 -vcl+backend { } set resp.status = 22302; set resp.reason = "Wrong Postcode"; + set resp.http.residual = resp.status % 10000; return (deliver); } } -start @@ -159,6 +160,7 @@ client c1 { txreq -url "/synth" rxresp expect resp.status == 302 + expect resp.http.residual == 2302 expect resp.reason == "Wrong Postcode" } -run diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c index c15203caf..a8b91560a 100644 --- a/lib/libvcc/vcc_expr.c +++ b/lib/libvcc/vcc_expr.c @@ -911,13 +911,20 @@ vcc_expr_mul(struct vcc *tl, struct expr **e, vcc_type_t fmt) struct expr *e2; vcc_type_t f2; struct token *tk; + char buf[24]; *e = NULL; vcc_expr4(tl, e, fmt); ERRCHK(tl); AN(*e); - while (tl->t->tok == '*' || tl->t->tok == '/') { + while (tl->t->tok == '*' || tl->t->tok == '/' || tl->t->tok == '%') { + if (tl->t->tok == '%' && ((*e)->fmt != INT)) { + VSB_printf(tl->sb, + "Operator %% only possible on INT.\n"); + vcc_ErrWhere(tl, tl->t); + return; + } f2 = (*e)->fmt->multype; if (f2 == NULL) { VSB_printf(tl->sb, @@ -936,10 +943,8 @@ vcc_expr_mul(struct vcc *tl, struct expr **e, vcc_type_t fmt) vcc_ErrWhere(tl, tk); return; } - if (tk->tok == '*') - *e = vcc_expr_edit(tl, (*e)->fmt, "(\v1*\v2)", *e, e2); - else - *e = vcc_expr_edit(tl, (*e)->fmt, "(\v1/\v2)", *e, e2); + bprintf(buf, "(\v1%c\v2)", tk->tok); + *e = vcc_expr_edit(tl, (*e)->fmt, buf, *e, e2); } } From phk at FreeBSD.org Tue Feb 16 14:16:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 16 Feb 2021 14:16:06 +0000 (UTC) Subject: [master] 7509abc90 Update comment to include '%' operator Message-ID: <20210216141606.B9D4F61FF3@lists.varnish-cache.org> commit 7509abc90a6fc5fab5eb9983a8fe4ef6ab5b7b95 Author: Poul-Henning Kamp Date: Tue Feb 16 13:57:50 2021 +0000 Update comment to include '%' operator diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c index a8b91560a..9b30c438a 100644 --- a/lib/libvcc/vcc_expr.c +++ b/lib/libvcc/vcc_expr.c @@ -902,7 +902,7 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt) /*-------------------------------------------------------------------- * SYNTAX: * ExprMul: - * Expr4 { {'*'|'/'} Expr4 } * + * Expr4 { {'*'|'/'|'%'} Expr4 } * */ static void From phk at FreeBSD.org Tue Feb 16 14:16:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 16 Feb 2021 14:16:06 +0000 (UTC) Subject: [master] 6d15fe035 Split the leoprello-list of VCL variables into a separate vcl-var(7) man page. Message-ID: <20210216141606.D40FC61FF7@lists.varnish-cache.org> commit 6d15fe035cbeb680d95f1289e3cca59a015f58ec Author: Poul-Henning Kamp Date: Tue Feb 16 14:08:17 2021 +0000 Split the leoprello-list of VCL variables into a separate vcl-var(7) man page. diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst index 2b8479243..e7ff6c9e0 100644 --- a/doc/sphinx/reference/index.rst +++ b/doc/sphinx/reference/index.rst @@ -11,6 +11,7 @@ The VCL language :maxdepth: 1 VCL - The Varnish Configuration Language + VCL Variables VCL backend configuration VCL backend health probe states.rst diff --git a/doc/sphinx/reference/vcl-var.rst b/doc/sphinx/reference/vcl-var.rst new file mode 100644 index 000000000..695d3c1bb --- /dev/null +++ b/doc/sphinx/reference/vcl-var.rst @@ -0,0 +1,93 @@ +.. role:: ref(emphasis) + +.. _vcl-var(7): + +============= +VCL-Variables +============= + +------------------ +The complete album +------------------ + +:Manual section: 7 + +DESCRIPTION +=========== + +This is a list of all variables in the VCL language. + +Variable names take the form ``scope.variable[.index]``, for instance:: + + req.url + beresp.http.date + client.ip + +Which operations are possible on each variable is described below, +often with the shorthand "backend" which covers the ``vcl_backend_* {}`` +subroutines and "client" which covers the rest, except ``vcl_init {}`` +and ``vcl_fini {}``. + +.. include:: vcl_var.rst + +HTTP response status +-------------------- + +A HTTP status code has 3 digits XYZ where X must be between 1 and 5 included. +Since it is not uncommon to see HTTP clients or servers relying +on non-standard or even invalid status codes, Varnish can work +with any status between 100 and 999. + +Within VCL code it is even possible to use status codes in the form +VWXYZ as long as the overall value is lower than 65536, but only +the XYZ part will be sent to the client, by which time the X must +also have become non-zero. + +The VWXYZ form of status codes can be communicate extra information +in ``resp.status`` and ``beresp.status`` to ``return(synth(...))`` and +``return(error(...))``, to indicate which synthetic content to produce:: + + sub vcl_recv { + if ([...]) { + return synth(12404); + } + } + + sub vcl_synth { + if (resp.status == 12404) { + [...] // this specific 404 + } else if (resp.status % 1000 == 404) { + [...] // all other 404's + } + } + +The ``obj.status`` variable will inherit the VWXYZ form, but in a ban +expresion only the XYZ part will be available. The VWXYZ form is strictly +limited to VCL execution. + +Assigning an HTTP standardized code to ``resp.status`` or ``beresp.status`` +will also set ``resp.reason`` or ``beresp.reason`` to the corresponding +status message. + +SEE ALSO +======== + +* :ref:`varnishd(1)` +* :ref:`vcl(7)` + +HISTORY +======= + +VCL was developed by Poul-Henning Kamp in cooperation with Verdens +Gang AS, Redpill Linpro and Varnish Software. This manual page is +written by Per Buer, Poul-Henning Kamp, Martin Blix Grydeland, +Kristian Lyngst?l, Lasse Karstensen and others. + +COPYRIGHT +========= + +This document is licensed under the same license as Varnish +itself. See LICENSE for details. + +* Copyright (c) 2006 Verdens Gang AS +* Copyright (c) 2006-2021 Varnish Software AS diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst index 97fe80466..3c39a0dd9 100644 --- a/doc/sphinx/reference/vcl.rst +++ b/doc/sphinx/reference/vcl.rst @@ -40,11 +40,17 @@ The following operators are available in VCL: ``=`` Assignment operator. + ``+``, ``-``, ``*``, ``/``, ``%`` + Basic math on numerical values. + ``+=``, ``-=``, ``*=``, ``/=`` Assign and increment/decrement/multiply/divide operator. For strings, ``+=`` appends. + ``(``, ``)`` + Evaluate separately. + ``==``, ``!=``, ``<``, ``>``, ``<=``, ``>=`` Comparisons @@ -67,16 +73,34 @@ implemented with the ``elseif`` statement (``elsif``\ /\ ``elif``\ /\ Note that there are no loops or iterators of any kind in VCL. +Variables +--------- + +VCL does most of the work by examining, ``set``'ing and ``unset``'ing +variables:: -Strings, booleans, time, duration, integers and real numbers ------------------------------------------------------------- + if (req.url == "/mistyped_url.html") { + set req.url = "/correct_url.html"; + unset req.http.cookie; + } -These are the data types in Varnish. You can ``set`` or ``unset`` these. +There are obvious limitations to what can be done, for instance it +makes no sense to ``unset req.url;`` - a request must have some kind +of URL to be valid, and likewise trying to manipulate a backend reponse +when there is none (yet) makes no sense. +The VCL compiler will detect such errors. -Example:: +Variables have types. Most of them a STRINGS, and anything in +VCL can be turned into a STRING, but some variables have types like +``DURATION``, ``IP`` etc. - set req.http.User-Agent = "unknown"; - unset req.http.Range; +When setting a such variables, the right hand side of the equal +sign must have the correct variables type, you cannot assign a +STRING to a variable of type NUMBER, even if the string is ``"42"``. + +Explicit conversion functions are available in :ref:`vmod_std(3)`. + +For the complete album of VCL variables see: :ref:`vcl-var(7)`. Strings @@ -307,11 +331,6 @@ they are concatenated in the order in which they appear in the source. The built-in VCL distributed with Varnish will be implicitly concatenated when the VCL is compiled. - - -.. include:: vcl_var.rst - - Functions --------- diff --git a/doc/sphinx/reference/vcl_var.rst b/doc/sphinx/reference/vcl_var.rst index fc0d76ef5..5cb180b78 100644 --- a/doc/sphinx/reference/vcl_var.rst +++ b/doc/sphinx/reference/vcl_var.rst @@ -1,37 +1,5 @@ .. _vcl_variables: -VCL Variables -------------- - -Variables provide read, write and delete access to almost all aspects -of the work at hand. - -Reading a variable is done simply by using its name in VCL:: - - if (client.ip ~ bad_guys) { - return (synth(400)); - } - -Writing a variable, where this is possible, is done with a ``set`` -statement:: - - set resp.http.never = "Let You Down"; - -Similarly, deleting a variable, for the few variables where this is -possible, is done with a ``unset`` statement:: - - unset req.http.cookie; - -Which operations are possible on each variable is described below, -often with the shorthand "backend" which covers the ``vcl_backend_* {}`` -subroutines and "client" which covers the rest, except ``vcl_init {}`` -and ``vcl_fini {}``. - -When setting a variable, the right hand side of the equal sign -must have the variables type, you cannot assign a STRING to -a variable of type NUMBER, even if the string is ``"42"``. -(Explicit conversion functions can be found in -:ref:`vmod_std(3)`). local, server, remote and client ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1403,29 +1371,3 @@ storage..happy Health status for the named stevedore. Not available in any of the current stevedores. -HTTP response status --------------------- - -A status code normally has 3 digits XYZ where X must be between 1 and 5 -included. Since it is not uncommon to see HTTP clients or servers relying -on non-standard or even invalid status codes Varnish tolerates any status -between 100 and 999. - -With VCL code it is possible to use status codes in the form XXYZZ where the -overall value is lower than 65536 and the Y digit is between 1 and 9 included. -Only the YZZ part is sent to the client. - -The XXYZZ form of status codes can be set on ``resp.status`` and -``beresp.status`` or passed via ``return(synth(...))`` and -``return(error(...))`` transitions. - -XX can be therefore be used to pass information around inside VCL, for -instance ``return(synth(22404))`` from ``vcl_recv{}`` to ``vcl_synth{}``. - -The ``obj.status`` variable will inherit the XXYZZ form, but in a ban -expresion only the YZZ part will be available. The XXYZZ form is strictly -limited to VCL execution. - -Assigning an HTTP standardized code to ``resp.status`` or ``beresp.status`` -will also set ``resp.reason`` or ``beresp.reason`` to the corresponding -status message. diff --git a/man/Makefile.am b/man/Makefile.am index bae551370..b78dc7cfe 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -6,6 +6,7 @@ dist_man_MANS = \ vcl.7 \ vcl-backend.7 \ vcl-probe.7 \ + vcl-var.7 \ vsl.7 \ vsl-query.7 \ varnishadm.1 \ @@ -56,6 +57,9 @@ vcl-backend.7: $(top_builddir)/doc/sphinx/reference/vcl-backend.rst vcl-probe.7: $(top_builddir)/doc/sphinx/reference/vcl-probe.rst $(BUILD_MAN) $(top_builddir)/doc/sphinx/reference/vcl-probe.rst $@ +vcl-var.7: $(top_builddir)/doc/sphinx/reference/vcl-var.rst + $(BUILD_MAN) $(top_builddir)/doc/sphinx/reference/vcl-var.rst $@ + vsl.7: $(top_builddir)/doc/sphinx/reference/vsl.rst \ $(top_builddir)/doc/sphinx/include/vsl-tags.rst $(BUILD_MAN) $(top_builddir)/doc/sphinx/reference/vsl.rst $@ From phk at FreeBSD.org Tue Feb 16 14:16:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 16 Feb 2021 14:16:06 +0000 (UTC) Subject: [master] 95dfe7f04 Add VCL design pattern about resp.status and modulus operator. Message-ID: <20210216141606.ED11F61FFC@lists.varnish-cache.org> commit 95dfe7f04528133d67d5cc6839c81e8092aab504 Author: Poul-Henning Kamp Date: Tue Feb 16 14:14:33 2021 +0000 Add VCL design pattern about resp.status and modulus operator. diff --git a/doc/sphinx/reference/dp_vcl_resp_status.rst b/doc/sphinx/reference/dp_vcl_resp_status.rst new file mode 100644 index 000000000..a4edb17a5 --- /dev/null +++ b/doc/sphinx/reference/dp_vcl_resp_status.rst @@ -0,0 +1,22 @@ +.. _dp_vcl_resp_status: + +Using extra digits in resp.status +================================= + +In Varnish the ``.status`` variables can hold more than three +digits, which is useful to send information to ``vcl_synth{}`` +about which error message to produce:: + + sub vcl_recv { + if ([...]) { + return(synth(12404)); + } + } + + sub vcl_synth { + if (resp.status == 12404) { + [...] // this specific 404 + } else if (resp.status % 1000 == 404) { + [...] // all other 404's + } + } diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst index e7ff6c9e0..58f6f7a93 100644 --- a/doc/sphinx/reference/index.rst +++ b/doc/sphinx/reference/index.rst @@ -23,6 +23,7 @@ VCL Design Patterns :maxdepth: 1 dp_vcl_recv_hash.rst + dp_vcl_resp_status.rst Bundled VMODs ------------- From nils.goroll at uplex.de Wed Feb 17 16:18:09 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 17 Feb 2021 16:18:09 +0000 (UTC) Subject: [master] 5341e6770 Polish vcc_act_call() Message-ID: <20210217161809.6C7B56E369@lists.varnish-cache.org> commit 5341e67700d1f2e50454a226da3a0f8989a6334f Author: Nils Goroll Date: Wed Feb 17 17:15:08 2021 +0100 Polish vcc_act_call() Diff best viewed with -b option - avoid the second call to VCC_SymbolGet(), unless necessary - reorder from simple to complex Ref 7ec28f1ae91bd39e6e89beb7dffd4248c5054414 diff --git a/bin/varnishtest/tests/v00020.vtc b/bin/varnishtest/tests/v00020.vtc index 9f93b241d..68570d106 100644 --- a/bin/varnishtest/tests/v00020.vtc +++ b/bin/varnishtest/tests/v00020.vtc @@ -37,6 +37,11 @@ varnish v1 -errvcl {Symbol 'vcl_recv' type (sub) can not be used in expression.} } } +varnish v1 -errvcl {Symbol 'acl' type (reserved) can not be used in expression.} { + import std; + sub vcl_recv { call acl; } +} + varnish v1 -errvcl {Operator * not possible on type STRING.} { sub vcl_recv { set req.http.foo = "bla" * "foo"; @@ -378,9 +383,9 @@ varnish v1 -errvcl {'||' must be preceeded by BOOL, found REAL.} { sub vcl_recv { if (std.random(0,1) || 0) { } } } -varnish v1 -errvcl {Symbol 'acl' has wrong type (reserved), expected sub:} { +varnish v1 -errvcl {Symbol 'acl' has wrong type (reserved), expected acl:} { import std; - sub vcl_recv { call acl; } + sub vcl_recv { if (client.ip ~ acl) {} } } server s1 { diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index cc99c8537..71c9b91db 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -50,41 +50,45 @@ vcc_act_call(struct vcc *tl, struct token *t, struct symbol *sym) (void)t; ExpectErr(tl, ID); t0 = tl->t; - sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_NONE, SYMTAB_NOERR, XREF_NONE); - tl->t = t0; - // only functions/methods may evaluate to SUB - if (sym != NULL && (sym->kind == SYM_FUNC || sym->kind == SYM_METHOD)) { - u = tl->unique++; - - Fb(tl, 1, "{\n"); - tl->indent += INDENT; - Fb(tl, 2, "VCL_SUB call_%u =\n", u); - tl->indent += INDENT; - vcc_Expr(tl, SUB); - Fb(tl, 2, ";\n\n"); - SkipToken(tl, ';'); - tl->indent -= INDENT; - Fb(tl, 2, "if (call_%u == NULL) {\n", u); - Fb(tl, 2, " VRT_fail(ctx, \"Tried to call NULL SUB near" - " source %%u line %%u\",\n"); - Fb(tl, 2, " VGC_ref[%u].source,\n", tl->cnt); - Fb(tl, 2, " VGC_ref[%u].line);\n", tl->cnt); - Fb(tl, 2, " END_;\n"); - Fb(tl, 2, "}\n"); - Fb(tl, 2, "call_%u->func(ctx, VSUB_STATIC, NULL);\n", u); - tl->indent -= INDENT; - Fb(tl, 1, "}\n"); + sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_NONE, SYMTAB_NOERR, XREF_REF); + + if (sym == NULL) + sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_SUB, SYMTAB_CREATE, + XREF_REF); + + if (sym == NULL) return; - } - sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_SUB, SYMTAB_CREATE, XREF_REF); - if (sym != NULL) { + if (sym->kind == SYM_SUB) { vcc_AddCall(tl, t0, sym); VCC_GlobalSymbol(sym, SUB, "VGC_function"); Fb(tl, 1, "%s(ctx, VSUB_STATIC, NULL);\n", sym->lname); SkipToken(tl, ';'); + return; } + + tl->t = t0; + u = tl->unique++; + + Fb(tl, 1, "{\n"); + tl->indent += INDENT; + Fb(tl, 2, "VCL_SUB call_%u =\n", u); + tl->indent += INDENT; + vcc_Expr(tl, SUB); + Fb(tl, 2, ";\n\n"); + SkipToken(tl, ';'); + tl->indent -= INDENT; + Fb(tl, 2, "if (call_%u == NULL) {\n", u); + Fb(tl, 2, " VRT_fail(ctx, \"Tried to call NULL SUB near" + " source %%u line %%u\",\n"); + Fb(tl, 2, " VGC_ref[%u].source,\n", tl->cnt); + Fb(tl, 2, " VGC_ref[%u].line);\n", tl->cnt); + Fb(tl, 2, " END_;\n"); + Fb(tl, 2, "}\n"); + Fb(tl, 2, "call_%u->func(ctx, VSUB_STATIC, NULL);\n", u); + tl->indent -= INDENT; + Fb(tl, 1, "}\n"); } /*--------------------------------------------------------------------*/ From nils.goroll at uplex.de Wed Feb 17 19:20:03 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 17 Feb 2021 19:20:03 +0000 (UTC) Subject: [master] d548292e3 Add SYMTAB_PARTIAL_NOERR mode for VCC_SymbolGet() Message-ID: <20210217192003.6B6B4103C47@lists.varnish-cache.org> commit d548292e3449440bac6e815b266f8611add3995b Author: Nils Goroll Date: Wed Feb 17 16:58:27 2021 +0100 Add SYMTAB_PARTIAL_NOERR mode for VCC_SymbolGet() For the next commit, we need a partial lookup without error. Alternatively, we could also a an error mode. diff --git a/lib/libvcc/vcc_compile.h b/lib/libvcc/vcc_compile.h index 2dff6dfa5..5447021e4 100644 --- a/lib/libvcc/vcc_compile.h +++ b/lib/libvcc/vcc_compile.h @@ -387,6 +387,7 @@ extern const struct symmode SYMTAB_NOERR[1]; extern const struct symmode SYMTAB_CREATE[1]; extern const struct symmode SYMTAB_EXISTING[1]; extern const struct symmode SYMTAB_PARTIAL[1]; +extern const struct symmode SYMTAB_PARTIAL_NOERR[1]; struct symbol *VCC_SymbolGet(struct vcc *, vcc_ns_t, vcc_kind_t, const struct symmode *, const struct symxref *); diff --git a/lib/libvcc/vcc_symb.c b/lib/libvcc/vcc_symb.c index 59c74228f..4df46f977 100644 --- a/lib/libvcc/vcc_symb.c +++ b/lib/libvcc/vcc_symb.c @@ -254,6 +254,7 @@ const struct symmode SYMTAB_NOERR[1] = {{"sym_noerror"}}; const struct symmode SYMTAB_CREATE[1] = {{"sym_create"}}; const struct symmode SYMTAB_EXISTING[1] = {{"Symbol not found"}}; const struct symmode SYMTAB_PARTIAL[1] = {{"Symbol not found"}}; +const struct symmode SYMTAB_PARTIAL_NOERR[1] = {{"Symbol not found"}}; struct symbol * VCC_SymbolGet(struct vcc *tl, vcc_ns_t ns, vcc_kind_t kind, @@ -301,13 +302,13 @@ VCC_SymbolGet(struct vcc *tl, vcc_ns_t ns, vcc_kind_t kind, } if (sym != NULL && sym->kind == SYM_VMOD && e == SYMTAB_PARTIAL) e = SYMTAB_EXISTING; - if (sym != NULL && e == SYMTAB_PARTIAL) { + if (sym != NULL && (e == SYMTAB_PARTIAL || e == SYMTAB_PARTIAL_NOERR)) { st = st2; tn = tn2; } else if (st != st2) { sym = NULL; } - if (sym == NULL && e == SYMTAB_NOERR) + if (sym == NULL && (e == SYMTAB_NOERR || e == SYMTAB_PARTIAL_NOERR)) return (sym); AN(st); AN(tn); From nils.goroll at uplex.de Wed Feb 17 19:20:03 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 17 Feb 2021 19:20:03 +0000 (UTC) Subject: [master] 3c68fa77e Fix callling a dynamic sub for object methods Message-ID: <20210217192003.8B10A103C4A@lists.varnish-cache.org> commit 3c68fa77ecc5ed1b254abde8b692f2793dc0ea5e Author: Nils Goroll Date: Tue Feb 16 17:52:52 2021 +0100 Fix callling a dynamic sub for object methods 7ec28f1ae91bd39e6e89beb7dffd4248c5054414 did not work with object methods because we need a partial symbol table lookup to identify them, otherwise the symbol kind we find is just SUB for the method's return value. Additions to the test case and vmod_debug by @slimhazard, thank you Fixes #3521 diff --git a/bin/varnishtest/tests/m00053.vtc b/bin/varnishtest/tests/m00053.vtc index 68034edbc..d5c501ea4 100644 --- a/bin/varnishtest/tests/m00053.vtc +++ b/bin/varnishtest/tests/m00053.vtc @@ -192,3 +192,46 @@ logexpect l3 -wait client c4 -wait client c5 -wait client c6 -wait + +varnish v1 -vcl { + import debug; + backend b None; + + sub foo { + set resp.http.Foo = "Called"; + } + + sub vcl_init { + new c = debug.caller(foo); + } + + sub vcl_recv { + return (synth(200)); + } + + sub vcl_synth { + if (req.url == "/call") { + call c.xsub(); + } else { + c.call(); + } + return (deliver); + } +} + +client c1 { + txreq -url "/call" + rxresp + expect resp.status == 200 + expect resp.http.Foo == "Called" +} -start + +client c2 { + txreq + rxresp + expect resp.status == 200 + expect resp.http.Foo == "Called" +} -start + +client c1 -wait +client c2 -wait diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c index 71c9b91db..57a2f6daf 100644 --- a/lib/libvcc/vcc_action.c +++ b/lib/libvcc/vcc_action.c @@ -50,8 +50,8 @@ vcc_act_call(struct vcc *tl, struct token *t, struct symbol *sym) (void)t; ExpectErr(tl, ID); t0 = tl->t; - sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_NONE, SYMTAB_NOERR, XREF_REF); - + sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_NONE, SYMTAB_PARTIAL_NOERR, + XREF_REF); if (sym == NULL) sym = VCC_SymbolGet(tl, SYM_MAIN, SYM_SUB, SYMTAB_CREATE, XREF_REF); diff --git a/vmod/vmod_debug.c b/vmod/vmod_debug.c index 25ce2f76e..8f123c276 100644 --- a/vmod/vmod_debug.c +++ b/vmod/vmod_debug.c @@ -1331,3 +1331,62 @@ xyzzy_total_recall(VRT_CTX) return (wrong); } + +/*---------------------------------------------------------------------*/ + +struct VPFX(debug_caller) { + unsigned magic; +#define DEBUG_CALLER_MAGIC 0xb47f3449 + VCL_SUB sub; +}; + +VCL_VOID v_matchproto_(td_xyzzy_debug_caller__init) +xyzzy_caller__init(VRT_CTX, struct VPFX(debug_caller) **callerp, + const char *name, VCL_SUB sub) +{ + struct VPFX(debug_caller) *caller; + + CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); + AN(callerp); + AZ(*callerp); + AN(name); + AN(sub); + + ALLOC_OBJ(caller, DEBUG_CALLER_MAGIC); + AN(caller); + *callerp = caller; + caller->sub = sub; +} + +VCL_VOID v_matchproto_(td_xyzzy_debug_caller__fini) +xyzzy_caller__fini(struct VPFX(debug_caller) **callerp) +{ + struct VPFX(debug_caller) *caller; + + if (callerp == NULL || *callerp == NULL) + return; + CHECK_OBJ(*callerp, DEBUG_CALLER_MAGIC); + caller = *callerp; + *callerp = NULL; + FREE_OBJ(caller); +} + +VCL_VOID v_matchproto_(td_xyzzy_debug_caller_call) +xyzzy_caller_call(VRT_CTX, struct VPFX(debug_caller) *caller) +{ + CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); + CHECK_OBJ_NOTNULL(caller, DEBUG_CALLER_MAGIC); + AN(caller->sub); + + VRT_call(ctx, caller->sub); +} + +VCL_SUB v_matchproto_(td_xyzzy_debug_caller_sub) +xyzzy_caller_xsub(VRT_CTX, struct VPFX(debug_caller) *caller) +{ + CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); + CHECK_OBJ_NOTNULL(caller, DEBUG_CALLER_MAGIC); + AN(caller->sub); + + return (caller->sub); +} diff --git a/vmod/vmod_debug.vcc b/vmod/vmod_debug.vcc index 45fc1fdee..c15079630 100644 --- a/vmod/vmod_debug.vcc +++ b/vmod/vmod_debug.vcc @@ -340,3 +340,9 @@ To test *WRONG* behavior $Function SUB total_recall() To test *WRONG* behavior + +$Object caller(SUB) + +$Method VOID .call() + +$Method SUB .xsub() From nils.goroll at uplex.de Wed Feb 17 19:20:03 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 17 Feb 2021 19:20:03 +0000 (UTC) Subject: [master] 7d8e4a4f0 Refactor SYMTAB_* Message-ID: <20210217192003.B3407103C4E@lists.varnish-cache.org> commit 7d8e4a4f0d4548a8f0a58d29a870f0c075ee3426 Author: Nils Goroll Date: Wed Feb 17 20:10:29 2021 +0100 Refactor SYMTAB_* suggested by phk diff --git a/lib/libvcc/vcc_compile.h b/lib/libvcc/vcc_compile.h index 5447021e4..2bdc7e480 100644 --- a/lib/libvcc/vcc_compile.h +++ b/lib/libvcc/vcc_compile.h @@ -382,7 +382,11 @@ extern const struct symxref XREF_NONE[1]; extern const struct symxref XREF_DEF[1]; extern const struct symxref XREF_REF[1]; -struct symmode { const char *name; }; +struct symmode { + const char *name; + unsigned noerr; + unsigned partial; +}; extern const struct symmode SYMTAB_NOERR[1]; extern const struct symmode SYMTAB_CREATE[1]; extern const struct symmode SYMTAB_EXISTING[1]; diff --git a/lib/libvcc/vcc_symb.c b/lib/libvcc/vcc_symb.c index 4df46f977..0423c3c14 100644 --- a/lib/libvcc/vcc_symb.c +++ b/lib/libvcc/vcc_symb.c @@ -250,11 +250,26 @@ vcc_sym_in_tab(struct vcc *tl, struct symtab *st, const struct symxref XREF_NONE[1] = {{"xref_none"}}; const struct symxref XREF_DEF[1] = {{"xref_def"}}; const struct symxref XREF_REF[1] = {{"xref_ref"}}; -const struct symmode SYMTAB_NOERR[1] = {{"sym_noerror"}}; -const struct symmode SYMTAB_CREATE[1] = {{"sym_create"}}; -const struct symmode SYMTAB_EXISTING[1] = {{"Symbol not found"}}; -const struct symmode SYMTAB_PARTIAL[1] = {{"Symbol not found"}}; -const struct symmode SYMTAB_PARTIAL_NOERR[1] = {{"Symbol not found"}}; + +const struct symmode SYMTAB_NOERR[1] = {{ + .name = "sym_noerror", + .noerr = 1 + }}; +const struct symmode SYMTAB_CREATE[1] = {{ + .name = "sym_create" + }}; +const struct symmode SYMTAB_EXISTING[1] = {{ + .name = "Symbol not found" + }}; +const struct symmode SYMTAB_PARTIAL[1] = {{ + .name = "Symbol not found", + .partial = 1 + }}; +const struct symmode SYMTAB_PARTIAL_NOERR[1] = {{ + .name = "Symbol not found", + .partial = 1, + .noerr = 1 + }}; struct symbol * VCC_SymbolGet(struct vcc *tl, vcc_ns_t ns, vcc_kind_t kind, @@ -300,15 +315,15 @@ VCC_SymbolGet(struct vcc *tl, vcc_ns_t ns, vcc_kind_t kind, break; tn = tn1; } - if (sym != NULL && sym->kind == SYM_VMOD && e == SYMTAB_PARTIAL) + if (sym != NULL && sym->kind == SYM_VMOD && e->partial) e = SYMTAB_EXISTING; - if (sym != NULL && (e == SYMTAB_PARTIAL || e == SYMTAB_PARTIAL_NOERR)) { + if (sym != NULL && e->partial) { st = st2; tn = tn2; } else if (st != st2) { sym = NULL; } - if (sym == NULL && (e == SYMTAB_NOERR || e == SYMTAB_PARTIAL_NOERR)) + if (sym == NULL && e->noerr) return (sym); AN(st); AN(tn); From nils.goroll at uplex.de Wed Feb 17 19:39:06 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 17 Feb 2021 19:39:06 +0000 (UTC) Subject: [master] b559b6b2d Flexelint e74abf895d2e1147ab474e0490cbf7dd33ce2454 Message-ID: <20210217193906.671DF10477A@lists.varnish-cache.org> commit b559b6b2daabc67901dfae07571b1300869ef690 Author: Nils Goroll Date: Wed Feb 17 20:36:26 2021 +0100 Flexelint e74abf895d2e1147ab474e0490cbf7dd33ce2454 diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c index 25beaf3d8..cc1e44c26 100644 --- a/bin/varnishd/cache/cache_hash.c +++ b/bin/varnishd/cache/cache_hash.c @@ -397,7 +397,6 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp) busy_found = 0; exp_oc = NULL; exp_t_origin = 0.0; - wrk->strangelove = 0; VTAILQ_FOREACH(oc, &oh->objcs, hsh_list) { /* Must be at least our own ref + the objcore we examine */ assert(oh->refcnt > 1); diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index eb40fa98f..ea09689f6 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -542,8 +542,10 @@ cnt_lookup(struct worker *wrk, struct req *req) AZ(req->objcore); if (req->hash_objhead) had_objhead = 1; + wrk->strangelove = 0; lr = HSH_Lookup(req, &oc, &busy); - if (wrk->strangelove >= cache_param->vary_notice) + assert(wrk->strangelove >= 0); + if ((unsigned)wrk->strangelove >= cache_param->vary_notice) VSLb(req->vsl, SLT_Notice, "vsl: High number of variants (%d)", wrk->strangelove); if (lr == HSH_BUSY) { From nils.goroll at uplex.de Thu Feb 18 18:28:06 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Thu, 18 Feb 2021 18:28:06 +0000 (UTC) Subject: [master] e89cd5f62 Clear the status and response on a retry Message-ID: <20210218182806.18288110053@lists.varnish-cache.org> commit e89cd5f625ee1b087be06da63a045797d090a54b Author: Steven Date: Thu Feb 18 12:06:53 2021 -0500 Clear the status and response on a retry The bo fields err_code and err_reason need to be reset on a retry otherwise the values are kept. Fixes #3525 diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c index 9ca855de8..f68ae7fa2 100644 --- a/bin/varnishd/cache/cache_fetch.c +++ b/bin/varnishd/cache/cache_fetch.c @@ -331,6 +331,8 @@ vbf_stp_retry(struct worker *wrk, struct busyobj *bo) bo->do_esi = 0; bo->do_stream = 1; bo->was_304 = 0; + bo->err_code = 0; + bo->err_reason = NULL; // XXX: BereqEnd + BereqAcct ? VSL_ChgId(bo->vsl, "bereq", "retry", VXID_Get(wrk, VSL_BACKENDMARKER)); diff --git a/bin/varnishtest/tests/r03525.vtc b/bin/varnishtest/tests/r03525.vtc new file mode 100644 index 000000000..75011e81e --- /dev/null +++ b/bin/varnishtest/tests/r03525.vtc @@ -0,0 +1,24 @@ +varnishtest "Clear beresp status and reason on a retry" + +server s1 { + rxreq + txresp -status 500 -reason "my reason" +} -start + +varnish v1 -arg "-p first_byte_timeout=0.2" -vcl+backend { + sub vcl_backend_response { + return (error(beresp.status, beresp.reason)); + } + sub vcl_backend_error { + if (bereq.retries == 0) { + return (retry); + } + } +} -start + +client c1 { + txreq + rxresp + expect resp.status == 503 + expect resp.reason == "Backend fetch failed" +} -run From nils.goroll at uplex.de Sat Feb 20 15:00:10 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Sat, 20 Feb 2021 15:00:10 +0000 (UTC) Subject: [master] d2be2bfc0 Look at Content-Encoding to determine gzip status for esi subrequests Message-ID: <20210220150010.BE1A110E3B8@lists.varnish-cache.org> commit d2be2bfc0f59ef79cd8efa4720ace4e49e55dcb6 Author: Nils Goroll Date: Sat Feb 20 15:51:49 2021 +0100 Look at Content-Encoding to determine gzip status for esi subrequests to handle correctly use of the "gunzip" filter at esi_level > 0 Fixes #3529 diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c index 68ae73268..082e32631 100644 --- a/bin/varnishd/cache/cache_esi_deliver.c +++ b/bin/varnishd/cache/cache_esi_deliver.c @@ -844,7 +844,8 @@ static const struct vdp ved_ved = { static void v_matchproto_(vtr_deliver_f) ved_deliver(struct req *req, struct boc *boc, int wantbody) { - int i; + int i = 0; + const char *p; struct ecx *ecx; struct ved_foo foo[1]; @@ -860,7 +861,11 @@ ved_deliver(struct req *req, struct boc *boc, int wantbody) if (boc == NULL && ObjGetLen(req->wrk, req->objcore) == 0) return; - i = ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED); + if (http_GetHdr(req->resp, H_Content_Encoding, &p)) + i = !strcasecmp(p, "gzip"); + if (i) + i = ObjCheckFlag(req->wrk, req->objcore, OF_GZIPED); + if (ecx->isgzip && i && !(req->res_mode & RES_ESI)) { /* A gzip'ed include which is not ESI processed */ diff --git a/bin/varnishtest/tests/e00026.vtc b/bin/varnishtest/tests/e00026.vtc index 2e5c06ffd..7fa85d0cf 100644 --- a/bin/varnishtest/tests/e00026.vtc +++ b/bin/varnishtest/tests/e00026.vtc @@ -25,13 +25,30 @@ server s1 { expect req.http.accept-encoding == gzip txresp -gzipbody {} + rxreq + expect req.url == "/5" + expect req.http.accept-encoding == gzip + txresp -gzipbody {} + + rxreq + expect req.url == "/bar" + txresp -bodylen 500 } -start varnish v1 -vcl+backend { sub vcl_backend_response { - if (bereq.url != "/foo") { + if (bereq.url ~ "^/.$") { set beresp.do_esi = true; + } else + if (bereq.url ~ "/bar") { + set beresp.do_gzip = true; + } + } + sub vcl_deliver { + if (req.esi_level > 0 && req.http.r3529) { + unset req.http.Accept-Encoding; } + set resp.http.filters = resp.filters; } } -start @@ -74,6 +91,12 @@ client c1 { expect resp.status == 200 expect resp.bodylen == 13 + txreq -url /5 -hdr "Accept-Encoding: gzip" -hdr "r3529: 1" + rxresp + expect resp.http.content-encoding == gzip + gunzip + expect resp.status == 200 + expect resp.bodylen == 500 } client c1 -run From nils.goroll at uplex.de Sun Feb 21 11:59:08 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Sun, 21 Feb 2021 11:59:08 +0000 (UTC) Subject: [master] 2bd5d2adf Make threads_limited counter accurate Message-ID: <20210221115908.4EAB4106D8D@lists.varnish-cache.org> commit 2bd5d2adfc407216ebaa653fae882d3c8d47f5e1 Author: Nils Goroll Date: Sun Feb 21 12:41:49 2021 +0100 Make threads_limited counter accurate In pool_herder(), we do as much work as possible outside the pool mutex. In particular, we check if we need to breed more threads, then we do more checks, and finally we aquire the lock and either go sleep or increase the threads_limited counter if, at that point, lqueue is non-zero. Yet it could have increased since we last checked, and there is nothing wrong with that, we will breed a new thread in the next iteration of the loop. Increase threads_limited only if we would not bread a new thread right away. Fixes #3531 diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c index 9b6933cae..bd89940b7 100644 --- a/bin/varnishd/cache/cache_wrk.c +++ b/bin/varnishd/cache/cache_wrk.c @@ -681,7 +681,7 @@ pool_herder(void *priv) delay = 0.5; (void)Lck_CondWait(&pp->herder_cond, &pp->mtx, VTIM_real() + delay); - } else + } else if (pp->nthr >= cache_param->wthread_max) /* XXX: unsafe counters */ VSC_C_main->threads_limited++; Lck_Unlock(&pp->mtx); From phk at FreeBSD.org Mon Feb 22 12:27:09 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 22 Feb 2021 12:27:09 +0000 (UTC) Subject: [master] ac0b9f5ac Teach the remaining programs about --optstring. Message-ID: <20210222122709.333D1108F65@lists.varnish-cache.org> commit ac0b9f5ac4e2c932ad0f6983584fbc7a4b2440de Author: Poul-Henning Kamp Date: Mon Feb 22 10:32:30 2021 +0000 Teach the remaining programs about --optstring. Move the description of this feature from user to reference. diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c index 76b19e775..08c4a4125 100644 --- a/bin/varnishadm/varnishadm.c +++ b/bin/varnishadm/varnishadm.c @@ -423,6 +423,8 @@ n_arg_sock(const char *n_arg, const char *t_arg) return (sock); } +#define OPTARG "hn:pS:T:t:" + int main(int argc, char * const *argv) { @@ -432,6 +434,10 @@ main(int argc, char * const *argv) const char *t_arg = NULL; int opt, sock; + if (argc == 2 && !strcmp(argv[1], "--optstring")) { + printf(OPTARG "\n"); + exit(0); + } /* * By default linux::getopt(3) mangles the argv order, such that * varnishadm -n bla param.set foo -bar @@ -440,7 +446,7 @@ main(int argc, char * const *argv) * The '+' stops that from happening * See #1496 */ - while ((opt = getopt(argc, argv, "+hn:pS:T:t:")) != -1) { + while ((opt = getopt(argc, argv, "+" OPTARG)) != -1) { switch (opt) { case 'h': /* Usage help */ diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c index 64e404c88..9f4c23623 100644 --- a/bin/varnishd/mgt/mgt_main.c +++ b/bin/varnishd/mgt/mgt_main.c @@ -490,6 +490,11 @@ main(int argc, char * const *argv) struct vsb *vsb; pid_t pid; + if (argc == 2 && !strcmp(argv[1], "--optstring")) { + printf("%s\n", opt_spec); + exit(0); + } + heritage.argc = argc; heritage.argv = argv; diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst index 58f6f7a93..fa6d61193 100644 --- a/doc/sphinx/reference/index.rst +++ b/doc/sphinx/reference/index.rst @@ -88,12 +88,13 @@ Varnishtest VarnishTest - execute test cases vmod_vtc.rst -For Developers --------------- +For Developers & DevOps +----------------------- .. toctree:: :maxdepth: 1 + Shell tricks VMODS - Extensions to VCL VSM - Shared memory use VDIR - Backends & Directors diff --git a/doc/sphinx/reference/shell_tricks.rst b/doc/sphinx/reference/shell_tricks.rst new file mode 100644 index 000000000..471706575 --- /dev/null +++ b/doc/sphinx/reference/shell_tricks.rst @@ -0,0 +1,30 @@ +.. _ref-shell_tricks: + +%%%%%%%%%%%% +Shell Tricks +%%%%%%%%%%%% + +All the varnish programs can be invoked with the single +argument ``--optstring`` to request their `getopt()` +specification, which simplifies wrapper scripts: + +.. code-block:: shell + + optstring=$(varnishfoo --optstring) + + while getopts "$optstring" opt + do + case $opt in + n) + # handle $OPTARG + ;; + # handle other options + *) + # ignore unneeded options + ;; + esac + done + + varnishfoo "$@" + + # do something with the options diff --git a/doc/sphinx/users-guide/run_cli.rst b/doc/sphinx/users-guide/run_cli.rst index e0c23e303..f68d0ffd2 100644 --- a/doc/sphinx/users-guide/run_cli.rst +++ b/doc/sphinx/users-guide/run_cli.rst @@ -65,7 +65,9 @@ To load new VCL program:: varnish> vcl.load some_name some_filename Loading will read the VCL program from the file, and compile it. If -the compilation fails, you will get an error messages:: +the compilation fails, you will get an error messages: + +.. code-block:: text .../mask is not numeric. ('input' Line 4 Pos 17) @@ -105,7 +107,9 @@ But sometimes it is useful to be able to throw things out of cache without having an exact list of what to throw out. Imagine for instance that the company logo changed and now you need -Varnish to stop serving the old logo out of the cache:: +Varnish to stop serving the old logo out of the cache: + +.. code-block:: text varnish> ban req.url ~ "logo.*[.]png" @@ -130,7 +134,9 @@ Change parameters ^^^^^^^^^^^^^^^^^ Parameters can be set on the command line with the '-p' argument, -but they can also be examined and changed on the fly from the CLI:: +but they can also be examined and changed on the fly from the CLI: + +.. code-block:: text varnish> param.show prefer_ipv6 200 @@ -169,47 +175,3 @@ always need to start the child process explicitly. Should the child process die, the master process will automatically restart it, but you can disable that with the 'auto_restart' parameter. - -The shell, the other CLI ------------------------- - -Besides accessing the CLI via its interface or via ``varnishadm`` there -is the matter of actually running the ``varnishd`` command line, usually -via a shell. See :ref:`run_security` for security concerns around the -``varnishd`` command line. See also :ref:`ref_syntax` about the CLI -syntax and quoting pitfalls when using ``varnishadm``. - -The programs shipped with Varnish can expose their *optstring* in order -to help writing wrapper scripts, in particular to get an opportunity to -hook a task before a program daemonizes. With the exception of -``varnishtest`` and ``varnishadm``, you can write Shell wrappers for -``varnishd`` using the ``-x`` option and other programs using the -``--optstring`` long option. - -This way, when writing a wrapper script you don't need to maintain the -*optstring* in sync when you only need a subset of the options, usually -``-n`` or ``-P``:: - - optstring=$(varnishd -x optstring) - - while getopts "$optstring" opt - do - case $opt in - n) - # handle $OPTARG - ;; - # handle other options - *) - # ignore unneeded options - ;; - esac - done - - varnishd "$@" - - # do something with the options - -You can for example write a wrapper script that blocks until the shared -memory is ready or when the child is started if you need that kind of -synchronization. You can also prevent ``varnishd`` from starting if the -``-S`` option is inadvertently set to not challenge access to the CLI. diff --git a/doc/sphinx/users-guide/run_security.rst b/doc/sphinx/users-guide/run_security.rst index 9d847df6b..8334eb8cd 100644 --- a/doc/sphinx/users-guide/run_security.rst +++ b/doc/sphinx/users-guide/run_security.rst @@ -199,7 +199,7 @@ system, but if `varnishd` is not started as root/superuser, this is not possible. No, don't ask me why you have to be superuser to lower the privilege of a child process... -Inline-C is disabled by default starting with Varnish version 4, so unless +Inline-C is disabled by default since Varnish version 4, so unless you enable it, you don't have to worry about it. The parameters mentioned above can restrict the loading of VMODs to only From phk at FreeBSD.org Mon Feb 22 12:27:09 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 22 Feb 2021 12:27:09 +0000 (UTC) Subject: [master] c1e794047 More doc-polish Message-ID: <20210222122709.4E3CB108F68@lists.varnish-cache.org> commit c1e7940477e1eede4d68421edd49b1173bc46c28 Author: Poul-Henning Kamp Date: Mon Feb 22 12:26:29 2021 +0000 More doc-polish diff --git a/doc/sphinx/reference/cli_protocol.rst b/doc/sphinx/reference/cli_protocol.rst index 2d40eb79a..106f7d3e8 100644 --- a/doc/sphinx/reference/cli_protocol.rst +++ b/doc/sphinx/reference/cli_protocol.rst @@ -10,15 +10,15 @@ The Varnish CLI has a few bells&whistles when used as an API. First: `vcli.h` contains magic numbers. -Second: If you use `varnishadm` to connect to `varnishd` use the -`-p` argument to get "pass" mode. +Second: If you use `varnishadm` to connect to `varnishd` for +API purposes, use the `-p` argument to get "pass" mode. In "pass" mode, or with direct CLI connections (more below), the first line of responses is always exactly 13 bytes long, including the NL, and it contains two numbers: The status code and the count -of bytes in the remainder of the response:: +of bytes in the "body" of the response:: - 200?19? + 200?19??????? PONG?1613397488?1.0 This makes parsing the response unambiguous, even in cases like this @@ -27,23 +27,63 @@ where the response does not end with a NL. The varnishapi library contains functions to implement the basics of the CLI protocol, for more, see the `vcli.h` include file. +.. _ref_remote_cli: + +Local and remote CLI connections +-------------------------------- + +The ``varnishd`` process receives the CLI commands via TCP connections +which require PSK authentication (see below), but which provide no secrecy. + +"No secrecy" means that if you configure these TCP connections to run +across a network, anybody who can sniff packets can see your CLI +commands. If you need secrecy, use ``ssh`` to run ``varnishadm`` or +to tunnel the TCP connection. + +By default `varnishd` binds to ``localhost`` and ask the kernel to +assign a random port number. The resulting listen address is +stored in the shared memory, where the ``varnishadm`` program finds it. + +You can configure ``varnishd`` to listen to a specific address with +the ``-T`` argument, this will also be written to shared memory, so +``varnishadm`` keeps working:: + + # Bind to internal network + varnishd -T 192.168.10.21:3245 + +You can also configure ``varnishd`` to actively open a TCP connection +to another "controller" program, with the ``-M`` argument. + +Finally, when run in "debug mode" with the ``-d`` argument, ``varnishd`` +will stay in the foreground and turn stdin/stdout into a CLI connection. + .. _ref_psk_auth: Authentication CLI connections ------------------------------ CLI connections to `varnishd` are authenticated with a "pre-shared-key" -authentication scheme, where the other end must prove they know the -contents of a particular file, either by being able to access it on -the machine `varnishd` runs on, usually via information in `VSM` or -by having a local copy of the file on another machine. +authentication scheme, where the other end must prove they know +*the contents of* the secret file ``varnishd`` uses. + +They do not have to read the precise same file on that specific +computer, they could read an entirely different file on a different +computer or fetch the secret from a server. + +The name of the file can be configured with the ``-S`` option, and +``varnishd`` records the name in shared memory, so ``varnishadm`` +can find it. + +As a bare minimum ``varnishd`` needs to be able to read the file, +but other than that, it can be restricted any way you want. -The precise filename can be configured with the `-S` option to `varnishd` -and regular file system permissions control access to it. +Since it is not the file, but only the content of it that matter, +you can make the file unreadable by everybody, and instead place +a copy of the file in the home directories of the authorized users. -The file is only read at the time the `auth` CLI command is issued -and the contents is not cached in `varnishd`, so it is possible to -change the contents of the file while `varnishd` is running. +The file is read only at the moment when the `auth` CLI command is +issued and the contents is not cached in `varnishd`, so you can +change it as often as you want. An authenticated session looks like this: @@ -77,7 +117,7 @@ first 32 characters of the response text is the challenge connection, and changes each time a 107 is emitted. The most recently emitted challenge must be used for calculating the -authenticator "455c...c89a". +authenticator "455c?c89a". The authenticator is calculated by applying the SHA256 function to the following byte sequence: @@ -110,7 +150,7 @@ In the above example, the secret file contains ``foo\n`` and thus: 00000040 66 79 6d 70 67 0a |fympg.| 00000046 critter phk> sha256 tmpfile - SHA256 (_) = 455ce847f0073c7ab3b1465f74507b75d3dc064c1e7de3b71e00de9092fdc89a + SHA256 (tmpfile) = 455ce847f0073c7ab3b1465f74507b75d3dc064c1e7de3b71e00de9092fdc89a critter phk> openssl dgst -sha256 < tmpfile 455ce847f0073c7ab3b1465f74507b75d3dc064c1e7de3b71e00de9092fdc89a diff --git a/doc/sphinx/users-guide/command-line.rst b/doc/sphinx/users-guide/command-line.rst index 3356ea4e0..5bf7a83b9 100644 --- a/doc/sphinx/users-guide/command-line.rst +++ b/doc/sphinx/users-guide/command-line.rst @@ -1,7 +1,7 @@ .. _users-guide-command-line: -Important command line arguments --------------------------------- +Required command line arguments +------------------------------- There a two command line arguments you have to set when starting Varnish, these are: * what TCP port to serve HTTP from, and @@ -44,7 +44,6 @@ it to another port number first. '-f' *VCL-file* or '-b' *backend* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Varnish needs to know where to find the HTTP server it is caching for. You can either specify it with the '-b' argument, or you can put it in your own VCL file, specified with the '-f' argument. @@ -57,37 +56,17 @@ Using '-b' is a quick way to get started:: Notice that if you specify a name, it can at most resolve to one IPv4 *and* one IPv6 address. -If you go with '-f', you can start with a VCL file containing just:: +For more advanced use, you will want to specify a VCL program with ``-f``, +but you can start with as little as just:: backend default { .host = "localhost:81"; } -which is exactly what '-b' does. - -.. XXX:What happens if I start with -b and then have the backend defined in my VCL? benc - -In both cases the built-in VCL code is appended. - -Other options -^^^^^^^^^^^^^ - -Varnish comes with an abundance of useful command line arguments. We recommend that you study them but not necessary use them all, but to get started, the above will be sufficient. - -By default Varnish will use 100 megabytes of virtual memory (malloc(3) -or libumem(3lib)) storage for caching objects, if you want to cache -more than that, you should look at the '-s' argument. - -.. XXX: 3? benc - -If you run a really big site, you may want to tune the number of -worker threads and other parameters with the '-p' argument, -but we generally advice not to do that unless you need to. +which is, by the way, *precisely* what '-b' does. -Before you go into production, you may also want to revisit the -chapter -:ref:`run_security` to see if you need to partition administrative -privileges. +Optional arguments +^^^^^^^^^^^^^^^^^^ -For a complete list of the command line parameters please see -:ref:`ref-varnishd-options`. +For a complete list of the command line arguments please see +:ref:`varnishd(1) options `. diff --git a/doc/sphinx/users-guide/run_cli.rst b/doc/sphinx/users-guide/run_cli.rst index f68d0ffd2..c02a8d788 100644 --- a/doc/sphinx/users-guide/run_cli.rst +++ b/doc/sphinx/users-guide/run_cli.rst @@ -3,46 +3,54 @@ CLI - bossing Varnish around ============================ -Once ``varnishd`` is started, you can control it using the command line -interface. - -The easiest way to do this, is using ``varnishadm`` on the -same machine as ``varnishd`` is running:: +Once ``varnishd`` is started, you can control it using the ``varnishadm`` +program and the command line interface:: varnishadm help -If you want to run ``varnishadm`` from a remote system, you can do it -two ways. +If you want to run ``varnishadm`` from a remote system, we recommend +you use ``ssh`` into the system where ``varnishd`` runs. (But see also: +:ref:`Local and remote CLI connections `) You can SSH into the ``varnishd`` computer and run ``varnishadm``:: - ssh $http_front_end varnishadm help - -But you can also configure ``varnishd`` to accept remote CLI connections -(using the '-T' and '-S' arguments):: + ssh $hostname varnishadm help - varnishd -T :6082 -S /etc/varnish_secret +If you give no command arguments, ``varnishadm`` runs in interactive mode +with command-completion, command-history and other comforts: -And then on the remote system run ``varnishadm``:: +.. code-block:: text - varnishadm -T $http_front_end -S /etc/copy_of_varnish_secret help + critter phk> ./varnishadm + 200 + ----------------------------- + Varnish Cache CLI 1.0 + ----------------------------- + FreeBSD,13.0-CURRENT,amd64,-jnone,-sdefault,-sdefault,-hcritbit + varnish-trunk revision 2bd5d2adfc407216ebaa653fae882d3c8d47f5e1 + + Type 'help' for command list. + Type 'quit' to close CLI session. + Type 'start' to launch worker process. + + varnish> -but as you can see, SSH is much more convenient. +The CLI always returns a three digit status code to tell how things went. -If you run ``varnishadm`` without arguments, it will read CLI commands from -``stdin``, if you give it arguments, it will treat those as the single -CLI command to execute. +200 and 201 means *OK*, anything else means that some kind of trouble +prevented the execution of the command. -The CLI always returns a status code to tell how it went: '200' -means OK, anything else means there were some kind of trouble. +(If you get 201, it means that the output was truncated, +See the :ref:`ref_param_cli_limit` parameter.) -``varnishadm`` will exit with status 1 and print the status code on -standard error if it is not 200. +When commands are given as arguments to ``varnishadm``, a status +different than 200 or 201 will cause it to exit with status 1 +and print the status code on standard error. What can you do with the CLI ---------------------------- -The CLI gives you almost total control over ``varnishd`` some of the more important tasks you can perform are: +From the CLI you can: * load/use/discard VCL programs * ban (invalidate) cache content @@ -91,19 +99,18 @@ The switch is instantaneous, all new requests will start using the VCL you activated right away. The requests currently being processed complete using whatever VCL they started with. -It is good idea to design an emergency-VCL before you need it, -and always have it loaded, so you can switch to it with a single -vcl.use command. +We highly recommend you design an emergency-VCL, and always keep +it loaded, so it can be activated with :: -.. XXX:Should above have a clearer admonition like a NOTE:? benc + vcl.use emergency Ban cache content ^^^^^^^^^^^^^^^^^ -Varnish offers "purges" to remove things from cache, provided that -you know exactly what they are. +Varnish offers "purges" to remove things from cache, but that +requires you to know exactly what they are. -But sometimes it is useful to be able to throw things out of cache +Sometimes it is useful to be able to throw things out of cache without having an exact list of what to throw out. Imagine for instance that the company logo changed and now you need @@ -116,14 +123,13 @@ Varnish to stop serving the old logo out of the cache: should do that, and yes, that is a regular expression. We call this "banning" because the objects are still in the cache, -but they are banned from delivery. +but they are now banned from delivery, while all the rest of the +cache is unaffected. -Instead of checking each and every cached object right away, we -test each object against the regular expression only if and when -an HTTP request asks for it. +Even when you want to throw out *all* the cached content, banning is +both faster and less disruptive that a restart:: -Banning stuff is much cheaper than restarting Varnish to get rid -of wronly cached content. + varnish> ban obj.http.date ~ .* .. In addition to handling such special occasions, banning can be used .. in many creative ways to keep the cache up to date, more about @@ -134,7 +140,8 @@ Change parameters ^^^^^^^^^^^^^^^^^ Parameters can be set on the command line with the '-p' argument, -but they can also be examined and changed on the fly from the CLI: +but almost all parameters can be examined and changed on the fly +from the CLI: .. code-block:: text @@ -153,10 +160,10 @@ have a good reason, such as performance tuning or security configuration. .. XXX: Natural delay of some duration sounds vague. benc -Most parameters will take effect instantly, or with a natural delay -of some duration, but a few of them requires you to restart the -child process before they take effect. This is always noted in the -description of the parameter. +Most parameters will take effect instantly, or with a short delay, +but a few of them requires you to restart the child process before +they take effect. This is always mentioned in the description of +the parameter. Starting and stopping the worker process ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -174,4 +181,5 @@ If you start ``varnishd`` with the '-d' (debugging) argument, you will always need to start the child process explicitly. Should the child process die, the master process will automatically -restart it, but you can disable that with the 'auto_restart' parameter. +restart it, but you can disable that with the +:ref:`ref_param_auto_restart` parameter. From phk at FreeBSD.org Mon Feb 22 13:27:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 22 Feb 2021 13:27:07 +0000 (UTC) Subject: [master] 532dcd3fb Close a one-in-a-billion risk of unwarranted panic. Message-ID: <20210222132707.3637010AD0E@lists.varnish-cache.org> commit 532dcd3fbfea5cafb8fb628d0826c85a8ad38b44 Author: Poul-Henning Kamp Date: Mon Feb 22 12:56:48 2021 +0000 Close a one-in-a-billion risk of unwarranted panic. Spotted by: Rasmus Villemoes diff --git a/bin/varnishd/cache/cache_lck.c b/bin/varnishd/cache/cache_lck.c index 7af1a5712..a8f3d2f36 100644 --- a/bin/varnishd/cache/cache_lck.c +++ b/bin/varnishd/cache/cache_lck.c @@ -218,7 +218,7 @@ Lck_CondWait(pthread_cond_t *cond, struct lock *lck, vtim_real when) assert(when > 1e9); ts.tv_nsec = (long)(modf(when, &t) * 1e9); ts.tv_sec = (long)t; - assert(ts.tv_nsec >= 0 && ts.tv_nsec < 999999999); + assert(ts.tv_nsec >= 0 && ts.tv_nsec <= 999999999); errno = pthread_cond_timedwait(cond, &ilck->mtx, &ts); #if defined (__APPLE__) if (errno == EINVAL && when > VTIM_real()) { From phk at FreeBSD.org Mon Feb 22 13:27:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 22 Feb 2021 13:27:07 +0000 (UTC) Subject: [master] 49334d854 This addition supposedly fixed #1853, but on the face of it, it looks like the sign is wrong, we should never get EINVAL if the deadline is in the future. Message-ID: <20210222132707.498C610AD11@lists.varnish-cache.org> commit 49334d854edd7f00bc4820c834e4af42fbd8a02d Author: Poul-Henning Kamp Date: Mon Feb 22 13:05:20 2021 +0000 This addition supposedly fixed #1853, but on the face of it, it looks like the sign is wrong, we should never get EINVAL if the deadline is in the future. Fix the test to make sense, and hope for the best (or a M1 :-) Spotted by: Rasmus Villemoes diff --git a/bin/varnishd/cache/cache_lck.c b/bin/varnishd/cache/cache_lck.c index a8f3d2f36..16c266291 100644 --- a/bin/varnishd/cache/cache_lck.c +++ b/bin/varnishd/cache/cache_lck.c @@ -221,7 +221,7 @@ Lck_CondWait(pthread_cond_t *cond, struct lock *lck, vtim_real when) assert(ts.tv_nsec >= 0 && ts.tv_nsec <= 999999999); errno = pthread_cond_timedwait(cond, &ilck->mtx, &ts); #if defined (__APPLE__) - if (errno == EINVAL && when > VTIM_real()) { + if (errno == EINVAL && when <= VTIM_real()) { /* * Most kernels treat this as honest error, * recognizing that a thread has no way to From phk at FreeBSD.org Mon Feb 22 13:27:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 22 Feb 2021 13:27:07 +0000 (UTC) Subject: [master] 30eb7db8b Pthread_create() acutally doesnt set errno as we expect. Message-ID: <20210222132707.64EB410AD14@lists.varnish-cache.org> commit 30eb7db8b87d9db42b3b99b0bb14e9b8a8ffaedf Author: Poul-Henning Kamp Date: Mon Feb 22 13:14:14 2021 +0000 Pthread_create() acutally doesnt set errno as we expect. Spotted by: Rasmus Villemoes diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c index bd89940b7..dcedcd344 100644 --- a/bin/varnishd/cache/cache_wrk.c +++ b/bin/varnishd/cache/cache_wrk.c @@ -528,7 +528,8 @@ pool_breed(struct pool *qp) AZ(pthread_attr_getstacksize(&tp_attr, &pi->stacksize)); pi->qp = qp; - if (pthread_create(&tp, &tp_attr, pool_thread, pi)) { + errno = pthread_create(&tp, &tp_attr, pool_thread, pi); + if (errno) { FREE_OBJ(pi); VSL(SLT_Debug, 0, "Create worker thread failed %d %s", errno, vstrerror(errno)); From phk at FreeBSD.org Mon Feb 22 13:27:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 22 Feb 2021 13:27:07 +0000 (UTC) Subject: [master] a2a17a1b2 Use pthread_equal(3) as POSIX intended. Message-ID: <20210222132707.8152810AD1D@lists.varnish-cache.org> commit a2a17a1b2647cbc710899bfe1e9851fd55bae359 Author: Poul-Henning Kamp Date: Mon Feb 22 13:23:15 2021 +0000 Use pthread_equal(3) as POSIX intended. Spotted by: Rasmus Villemoes diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h index 952dc03ab..7fba1e6f2 100644 --- a/bin/varnishd/cache/cache.h +++ b/bin/varnishd/cache/cache.h @@ -591,7 +591,7 @@ void BAN_Abandon(struct ban_proto *b); /* cache_cli.c [CLI] */ extern pthread_t cli_thread; -#define ASSERT_CLI() do {assert(pthread_self() == cli_thread);} while (0) +#define ASSERT_CLI() do {assert(pthread_equal(pthread_self(), cli_thread));} while (0) /* cache_http.c */ unsigned HTTP_estimate(unsigned nhttp); diff --git a/bin/varnishtest/vtc_barrier.c b/bin/varnishtest/vtc_barrier.c index 5600401fa..3a83b771d 100644 --- a/bin/varnishtest/vtc_barrier.c +++ b/bin/varnishtest/vtc_barrier.c @@ -77,7 +77,7 @@ barrier_new(const char *name, struct vtclog *vl) ALLOC_OBJ(b, BARRIER_MAGIC); AN(b); - if (pthread_self() != vtc_thread) + if (!pthread_equal(pthread_self(), vtc_thread)) vtc_fatal(vl, "Barrier %s can only be created on the top thread", name); REPLACE(b->name, name); diff --git a/bin/varnishtest/vtc_log.c b/bin/varnishtest/vtc_log.c index ec4dbda0c..15c1a7371 100644 --- a/bin/varnishtest/vtc_log.c +++ b/bin/varnishtest/vtc_log.c @@ -114,7 +114,7 @@ vtc_logfail(void) { vtc_error = 2; - if (pthread_self() != vtc_thread) + if (!pthread_equal(pthread_self(), vtc_thread)) pthread_exit(NULL); else exit(fail_out()); diff --git a/lib/libvarnish/vev.c b/lib/libvarnish/vev.c index f6359d38f..f83832c6f 100644 --- a/lib/libvarnish/vev.c +++ b/lib/libvarnish/vev.c @@ -221,7 +221,7 @@ VEV_Destroy(struct vev_root **evbp) struct vev_root *evb; TAKE_OBJ_NOTNULL(evb, evbp, VEV_BASE_MAGIC); - assert(evb->thread == pthread_self()); + assert(pthread_equal(evb->thread, pthread_self())); free(evb->pfd); free(evb->pev); /* XXX: destroy evb->binheap */ @@ -255,7 +255,7 @@ VEV_Start(struct vev_root *evb, struct vev *e) assert(e->sig >= 0); assert(e->timeout >= 0.0); assert(e->fd < 0 || e->fd_flags); - assert(evb->thread == pthread_self()); + assert(pthread_equal(evb->thread, pthread_self())); DBG(evb, "ev_add(%p) fd = %d\n", e, e->fd); if (vev_get_pfd(evb)) @@ -311,7 +311,7 @@ VEV_Stop(struct vev_root *evb, struct vev *e) CHECK_OBJ_NOTNULL(e, VEV_MAGIC); DBG(evb, "ev_del(%p) fd = %d i=%u L=%d\n", e, e->fd, e->__binheap_idx, evb->lpfd); assert(evb == e->__vevb); - assert(evb->thread == pthread_self()); + assert(pthread_equal(evb->thread, pthread_self())); assert(evb->pev[e->__binheap_idx] == e); assert(e->__binheap_idx != VBH_NOIDX); @@ -344,7 +344,7 @@ VEV_Loop(struct vev_root *evb) int i; CHECK_OBJ_NOTNULL(evb, VEV_BASE_MAGIC); - assert(evb->thread == pthread_self()); + assert(pthread_equal(evb->thread, pthread_self())); do i = VEV_Once(evb); while (i == 1); @@ -406,7 +406,7 @@ VEV_Once(struct vev_root *evb) unsigned u; CHECK_OBJ_NOTNULL(evb, VEV_BASE_MAGIC); - assert(evb->thread == pthread_self()); + assert(pthread_equal(evb->thread, pthread_self())); assert(evb->lpfd < evb->npfd); if (evb->psig) From phk at FreeBSD.org Mon Feb 22 13:27:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 22 Feb 2021 13:27:07 +0000 (UTC) Subject: [master] 6cbd4c852 We might as well clean up the witness memory, when it is this easy. Message-ID: <20210222132707.9C3D410AD24@lists.varnish-cache.org> commit 6cbd4c852415ed21ad2e741588dc852627813a67 Author: Poul-Henning Kamp Date: Mon Feb 22 13:26:09 2021 +0000 We might as well clean up the witness memory, when it is this easy. Spotted by: Rasmus Villemoes diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c index e9d2da664..1581f950d 100644 --- a/bin/varnishd/cache/cache_main.c +++ b/bin/varnishd/cache/cache_main.c @@ -350,7 +350,7 @@ child_main(int sigmagic, size_t altstksz) AZ(pthread_key_create(&req_key, NULL)); AZ(pthread_key_create(&bo_key, NULL)); - AZ(pthread_key_create(&witness_key, NULL)); + AZ(pthread_key_create(&witness_key, free)); AZ(pthread_key_create(&name_key, NULL)); THR_SetName("cache-main"); From phk at FreeBSD.org Mon Feb 22 13:33:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 22 Feb 2021 13:33:06 +0000 (UTC) Subject: [master] 0dd8b32bc Use PTHREAD_NULL if the platform has it. Message-ID: <20210222133306.52BD810D60F@lists.varnish-cache.org> commit 0dd8b32bc23d14c42ea105cde4ec30a0a0c72a7e Author: Poul-Henning Kamp Date: Mon Feb 22 13:31:47 2021 +0000 Use PTHREAD_NULL if the platform has it. Spotted by: Rasmus Villemoes diff --git a/bin/varnishd/cache/cache_lck.c b/bin/varnishd/cache/cache_lck.c index 16c266291..c3c726708 100644 --- a/bin/varnishd/cache/cache_lck.c +++ b/bin/varnishd/cache/cache_lck.c @@ -154,7 +154,11 @@ Lck__Unlock(struct lock *lck, const char *p, int l) * implementations of pthread. * #endif */ +#ifdef PTHREAD_NULL + ilck->owner = PTHREAD_NULL; +#else memset(&ilck->owner, 0, sizeof ilck->owner); +#endif AZ(pthread_mutex_unlock(&ilck->mtx)); if (DO_DEBUG(DBG_WITNESS)) Lck_Witness_Unlock(ilck); From phk at FreeBSD.org Mon Feb 22 13:34:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 22 Feb 2021 13:34:06 +0000 (UTC) Subject: [master] 78122980f Forego shell syntax highlighting, not installed everywhere. Message-ID: <20210222133406.771BA10D7EF@lists.varnish-cache.org> commit 78122980fec456267c25aec74804abd076782777 Author: Poul-Henning Kamp Date: Mon Feb 22 13:33:05 2021 +0000 Forego shell syntax highlighting, not installed everywhere. diff --git a/doc/sphinx/reference/shell_tricks.rst b/doc/sphinx/reference/shell_tricks.rst index 471706575..89e55e559 100644 --- a/doc/sphinx/reference/shell_tricks.rst +++ b/doc/sphinx/reference/shell_tricks.rst @@ -8,7 +8,7 @@ All the varnish programs can be invoked with the single argument ``--optstring`` to request their `getopt()` specification, which simplifies wrapper scripts: -.. code-block:: shell +.. code-block:: text optstring=$(varnishfoo --optstring) From nils.goroll at uplex.de Mon Feb 22 19:01:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 22 Feb 2021 19:01:07 +0000 (UTC) Subject: [master] e5391c5f7 VTCP_Check() to accept ETIMEDOUT on all platforms Message-ID: <20210222190107.0D66E116217@lists.varnish-cache.org> commit e5391c5f7fd1b727ee5c1358f9adf2f1a55ac0ad Author: Nils Goroll Date: Mon Feb 22 19:50:33 2021 +0100 VTCP_Check() to accept ETIMEDOUT on all platforms it was already accepted on Solaris and NetBSD, now we have seen it on Linux and I think it does not make sense to keep the exception for Apple. Fixes #3532 (hopefully) diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c index 087938bef..d6e474249 100644 --- a/lib/libvarnish/vtcp.c +++ b/lib/libvarnish/vtcp.c @@ -600,6 +600,10 @@ VTCP_Check(ssize_t a) * described in the socket(7) manpage.) */ if (errno == EAGAIN || errno == EWOULDBLOCK) return (1); + /* tcp(7): The other end didn't acknowledge retransmitted data after + * some time. */ + if (errno == ETIMEDOUT) + return (1); #if (defined (__SVR4) && defined (__sun)) if (errno == ECONNREFUSED) // in r02702.vtc return (1); From nils.goroll at uplex.de Mon Feb 22 19:01:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 22 Feb 2021 19:01:07 +0000 (UTC) Subject: [master] 44d5cf339 Collapse the MacOS case with Solaris & NetBSD in VTCP_Check() Message-ID: <20210222190107.222A711621A@lists.varnish-cache.org> commit 44d5cf3395fd8d6f69dcdc88af0bc1458ee388bb Author: Nils Goroll Date: Mon Feb 22 19:53:27 2021 +0100 Collapse the MacOS case with Solaris & NetBSD in VTCP_Check() diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c index d6e474249..9ac383769 100644 --- a/lib/libvarnish/vtcp.c +++ b/lib/libvarnish/vtcp.c @@ -610,18 +610,14 @@ VTCP_Check(ssize_t a) if (errno == EPROTO) return (1); #endif -#if (defined (__SVR4) && defined (__sun)) || defined (__NetBSD__) +#if (defined (__SVR4) && defined (__sun)) || \ + defined (__NetBSD__) || \ + defined (__APPLE__) /* - * Solaris returns EINVAL if the other end unexpectedly reset the - * connection. - * This is a bug in Solaris and documented behaviour on NetBSD. - */ - if (errno == EINVAL || errno == ETIMEDOUT) - return (1); -#elif defined (__APPLE__) - /* - * MacOS returns EINVAL if the other end unexpectedly reset + * Solaris and MacOS returns EINVAL if the other end unexpectedly reset * the connection. + * + * On NetBSD it is documented behaviour. */ if (errno == EINVAL) return (1); From phk at FreeBSD.org Tue Feb 23 07:50:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 23 Feb 2021 07:50:08 +0000 (UTC) Subject: [master] fbee34a62 Add missing X-ref Message-ID: <20210223075008.C1F0B102B87@lists.varnish-cache.org> commit fbee34a62adab48a233d1c1ea7d138e8fd37e24c Author: Poul-Henning Kamp Date: Mon Feb 22 14:25:18 2021 +0000 Add missing X-ref diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst index 3c39a0dd9..0640181b7 100644 --- a/doc/sphinx/reference/vcl.rst +++ b/doc/sphinx/reference/vcl.rst @@ -416,6 +416,7 @@ SEE ALSO * :ref:`varnishd(1)` * :ref:`vcl-backend(7)` * :ref:`vcl-probe(7)` +* :ref:`vcl-var(7)` * :ref:`vmod_directors(3)` * :ref:`vmod_std(3)` From dridi.boukelmoune at gmail.com Tue Feb 23 15:23:07 2021 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Tue, 23 Feb 2021 15:23:07 +0000 (UTC) Subject: [master] 687273347 pool: Wait when we run out of workers Message-ID: <20210223152307.1E6E0110F6A@lists.varnish-cache.org> commit 6872733475228890799a94e62b689d88e3fa911e Author: Dridi Boukelmoune Date: Thu Feb 11 12:21:33 2021 +0100 pool: Wait when we run out of workers Since the removal of dry signals, pools will spin when they run out of threads and increment MAIN.threads_limited at a very high rate. That spike in CPU consumption will also have detrimental effects on useful tasks. This change introduces a 1s delay when the pool is saturated. This allows to periodically exercise the watchdog check. We could wait until the watchdog times out but we would also miss potential updates to the thread_pool_watchdog parameter. To avoid spurious increments of MAIN.threads_limited we only take task submissions into account and ignore timeouts of the condvar. Refs #2942 Refs #3531 diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c index dcedcd344..3d31072d0 100644 --- a/bin/varnishd/cache/cache_wrk.c +++ b/bin/varnishd/cache/cache_wrk.c @@ -579,6 +579,7 @@ pool_herder(void *priv) unsigned wthread_min; uintmax_t dq = (1ULL << 31); vtim_mono dqt = 0; + int r = 0; CAST_OBJ_NOTNULL(pp, priv, POOL_MAGIC); @@ -680,11 +681,15 @@ pool_herder(void *priv) if (pp->lqueue == 0) { if (DO_DEBUG(DBG_VTC_MODE)) delay = 0.5; - (void)Lck_CondWait(&pp->herder_cond, &pp->mtx, - VTIM_real() + delay); - } else if (pp->nthr >= cache_param->wthread_max) + r = Lck_CondWait(&pp->herder_cond, &pp->mtx, + VTIM_real() + delay); + } else if (pp->nthr >= cache_param->wthread_max) { /* XXX: unsafe counters */ - VSC_C_main->threads_limited++; + if (r != ETIMEDOUT) + VSC_C_main->threads_limited++; + r = Lck_CondWait(&pp->herder_cond, &pp->mtx, + VTIM_real() + 1.0); + } Lck_Unlock(&pp->mtx); } return (NULL); From nils.goroll at uplex.de Wed Feb 24 09:43:07 2021 From: nils.goroll at uplex.de (Nils Goroll) Date: Wed, 24 Feb 2021 09:43:07 +0000 (UTC) Subject: [master] 6e1c2b6ba document the happy counter Message-ID: <20210224094307.54D00104DBE@lists.varnish-cache.org> commit 6e1c2b6ba3b5d5a32c0a9ef125eeaf0a6440a794 Author: Guillaume Quintard Date: Tue Feb 23 17:46:41 2021 -0800 document the happy counter diff --git a/bin/varnishd/VSC_vbe.vsc b/bin/varnishd/VSC_vbe.vsc index c26207af9..52fa1806b 100644 --- a/bin/varnishd/VSC_vbe.vsc +++ b/bin/varnishd/VSC_vbe.vsc @@ -12,6 +12,10 @@ :level: info :oneliner: Happy health probes + Represents the last probe results as a bitmap. Happy probes are bits set + to 1, and the unhappy ones are set to 0. The highest bits represent the + oldest probes. + .. varnish_vsc:: bereq_hdrbytes :type: counter :level: info From phk at FreeBSD.org Wed Feb 24 11:32:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 24 Feb 2021 11:32:08 +0000 (UTC) Subject: [master] a040c673a Trivial typographical alignment of copyright notices. Message-ID: <20210224113208.10634107ADC@lists.varnish-cache.org> commit a040c673aefca9ebe29295d951ef3d1a4e35b598 Author: Poul-Henning Kamp Date: Wed Feb 24 10:55:01 2021 +0000 Trivial typographical alignment of copyright notices. diff --git a/bin/varnishd/common/heritage.h b/bin/varnishd/common/heritage.h index e6daa8db3..f2b2e448f 100644 --- a/bin/varnishd/common/heritage.h +++ b/bin/varnishd/common/heritage.h @@ -1,4 +1,3 @@ - /*- * Copyright (c) 2006 Verdens Gang AS * Copyright (c) 2006-2011 Varnish Software AS diff --git a/bin/varnishd/hpack/vhp.h b/bin/varnishd/hpack/vhp.h index f89dd981a..37c74bdf4 100644 --- a/bin/varnishd/hpack/vhp.h +++ b/bin/varnishd/hpack/vhp.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Varnish Software + * Copyright (c) 2016 Varnish Software AS * All rights reserved. * * Author: Martin Blix Grydeland diff --git a/bin/varnishd/hpack/vhp_decode.c b/bin/varnishd/hpack/vhp_decode.c index d18f30b13..b7c712212 100644 --- a/bin/varnishd/hpack/vhp_decode.c +++ b/bin/varnishd/hpack/vhp_decode.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Varnish Software + * Copyright (c) 2016 Varnish Software AS * All rights reserved. * * Author: Martin Blix Grydeland diff --git a/bin/varnishd/hpack/vhp_gen_hufdec.c b/bin/varnishd/hpack/vhp_gen_hufdec.c index 679251efe..bfc052816 100644 --- a/bin/varnishd/hpack/vhp_gen_hufdec.c +++ b/bin/varnishd/hpack/vhp_gen_hufdec.c @@ -246,7 +246,8 @@ main(int argc, const char **argv) huf[u].code, huf[u].blen, huf[u].chr); printf("/*\n"); - printf(" * NB: This file is machine generated, DO NOT EDIT!\n"); + printf(" * NB: This file is machine generated, DO NOT EDIT!\n"); + printf(" *\n"); printf(" */\n\n"); printf("#define HUFDEC_LEN %u\n", idx); diff --git a/bin/varnishd/hpack/vhp_table.c b/bin/varnishd/hpack/vhp_table.c index 4d8a6b7fa..4415f47b8 100644 --- a/bin/varnishd/hpack/vhp_table.c +++ b/bin/varnishd/hpack/vhp_table.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Varnish Software + * Copyright (c) 2016 Varnish Software AS * All rights reserved. * * Author: Martin Blix Grydeland diff --git a/bin/varnishd/mgt/mgt_jail_solaris_tbl.h b/bin/varnishd/mgt/mgt_jail_solaris_tbl.h index 062f25bb6..7b1b0915f 100644 --- a/bin/varnishd/mgt/mgt_jail_solaris_tbl.h +++ b/bin/varnishd/mgt/mgt_jail_solaris_tbl.h @@ -1,5 +1,5 @@ /*- - * Copyright 2020 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2020 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Author: Nils Goroll diff --git a/bin/varnishd/waiter/cache_waiter_ports.c b/bin/varnishd/waiter/cache_waiter_ports.c index 4120586f9..4055e1b61 100644 --- a/bin/varnishd/waiter/cache_waiter_ports.c +++ b/bin/varnishd/waiter/cache_waiter_ports.c @@ -3,7 +3,7 @@ * Copyright (c) 2006 Varnish Software AS * Copyright (c) 2007 OmniTI Computer Consulting, Inc. * Copyright (c) 2007 Theo Schlossnagle - * Copyright (c) 2010-2016 UPLEX, Nils Goroll + * Copyright (c) 2010-2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause diff --git a/bin/varnishhist/varnishhist_profiles.h b/bin/varnishhist/varnishhist_profiles.h index 6619f06d1..42bf02251 100644 --- a/bin/varnishhist/varnishhist_profiles.h +++ b/bin/varnishhist/varnishhist_profiles.h @@ -1,5 +1,5 @@ /*- - * Copyright 2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Author: Nils Goroll diff --git a/include/tbl/ban_arg_oper.h b/include/tbl/ban_arg_oper.h index d139e08a6..2589f0266 100644 --- a/include/tbl/ban_arg_oper.h +++ b/include/tbl/ban_arg_oper.h @@ -1,5 +1,5 @@ /*- - * Copyright 2017 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2017 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Author: Nils Goroll diff --git a/include/tbl/ban_oper.h b/include/tbl/ban_oper.h index cd4103e61..2d244c6f5 100644 --- a/include/tbl/ban_oper.h +++ b/include/tbl/ban_oper.h @@ -1,5 +1,5 @@ /*- - * Copyright 2017 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2017 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Author: Nils Goroll diff --git a/include/tbl/vhd_fsm.h b/include/tbl/vhd_fsm.h index ec7258706..a99a630a0 100644 --- a/include/tbl/vhd_fsm.h +++ b/include/tbl/vhd_fsm.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Varnish Software + * Copyright (c) 2016 Varnish Software AS * All rights reserved. * * Author: Martin Blix Grydeland diff --git a/include/tbl/vhd_fsm_funcs.h b/include/tbl/vhd_fsm_funcs.h index e3f80f462..266a570c4 100644 --- a/include/tbl/vhd_fsm_funcs.h +++ b/include/tbl/vhd_fsm_funcs.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Varnish Software + * Copyright (c) 2016 Varnish Software AS * All rights reserved. * * Author: Martin Blix Grydeland diff --git a/include/tbl/vhd_return.h b/include/tbl/vhd_return.h index aab5212fd..218a7bd1c 100644 --- a/include/tbl/vhd_return.h +++ b/include/tbl/vhd_return.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Varnish Software + * Copyright (c) 2016 Varnish Software AS * All rights reserved. * * Author: Martin Blix Grydeland diff --git a/include/vbm_test.c b/include/vbm_test.c index bf55a6a30..587f27d5a 100644 --- a/include/vbm_test.c +++ b/include/vbm_test.c @@ -1,5 +1,5 @@ /*- - * Copyright 2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Author: Nils Goroll diff --git a/include/vend.h b/include/vend.h index 8a701b86e..f0eb5cc68 100644 --- a/include/vend.h +++ b/include/vend.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2003,2010 Poul-Henning Kamp + * Copyright (c) 2003,2010 Poul-Henning Kamp * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/include/vlu.h b/include/vlu.h index 12d55a057..3bb68ba82 100644 --- a/include/vlu.h +++ b/include/vlu.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2008 Poul-Henning Kamp + * Copyright (c) 2005-2008 Poul-Henning Kamp * All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause diff --git a/include/vsb.h b/include/vsb.h index 06239b6bb..f67220e96 100644 --- a/include/vsb.h +++ b/include/vsb.h @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2000-2011 Poul-Henning Kamp + * Copyright (c) 2000-2011 Poul-Henning Kamp * Copyright (c) 2000-2008 Dag-Erling Co?dan Sm?rgrav * All rights reserved. * diff --git a/lib/libvarnish/vlu.c b/lib/libvarnish/vlu.c index 3c32a87a0..d8cb39c5c 100644 --- a/lib/libvarnish/vlu.c +++ b/lib/libvarnish/vlu.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2008 Poul-Henning Kamp + * Copyright (c) 2005-2008 Poul-Henning Kamp * All rights reserved. * * SPDX-License-Identifier: BSD-2-Clause diff --git a/lib/libvarnish/vsb.c b/lib/libvarnish/vsb.c index 6238d8349..8857bd26a 100644 --- a/lib/libvarnish/vsb.c +++ b/lib/libvarnish/vsb.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2008 Poul-Henning Kamp + * Copyright (c) 2000-2008 Poul-Henning Kamp * Copyright (c) 2000-2008 Dag-Erling Co?dan Sm?rgrav * All rights reserved. * diff --git a/vmod/vmod_blob.c b/vmod/vmod_blob.c index e1f474c26..70644f5ad 100644 --- a/vmod/vmod_blob.c +++ b/vmod/vmod_blob.c @@ -1,5 +1,5 @@ /*- - * Copyright 2015-2017 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2015-2017 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Nils Goroll diff --git a/vmod/vmod_blob.h b/vmod/vmod_blob.h index 90872b61a..3c1048b48 100644 --- a/vmod/vmod_blob.h +++ b/vmod/vmod_blob.h @@ -1,5 +1,5 @@ /*- - * Copyright 2015-2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2015-2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Nils Goroll diff --git a/vmod/vmod_blob_base64.c b/vmod/vmod_blob_base64.c index 06d6b6cef..b77c98e22 100644 --- a/vmod/vmod_blob_base64.c +++ b/vmod/vmod_blob_base64.c @@ -1,5 +1,5 @@ /*- - * Copyright 2015-2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2015-2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Nils Goroll diff --git a/vmod/vmod_blob_hex.c b/vmod/vmod_blob_hex.c index 539ab87a7..fce4f7839 100644 --- a/vmod/vmod_blob_hex.c +++ b/vmod/vmod_blob_hex.c @@ -1,5 +1,5 @@ /*- - * Copyright 2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Nils Goroll diff --git a/vmod/vmod_blob_id.c b/vmod/vmod_blob_id.c index ad6b64607..cf5b6ee72 100644 --- a/vmod/vmod_blob_id.c +++ b/vmod/vmod_blob_id.c @@ -1,5 +1,5 @@ /*- - * Copyright 2015-2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2015-2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Nils Goroll diff --git a/vmod/vmod_blob_url.c b/vmod/vmod_blob_url.c index 9ce272ed8..aff0669e9 100644 --- a/vmod/vmod_blob_url.c +++ b/vmod/vmod_blob_url.c @@ -1,5 +1,5 @@ /*- - * Copyright 2015-2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2015-2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Nils Goroll diff --git a/vmod/vmod_cookie.c b/vmod/vmod_cookie.c index 98e4bc44c..2cb1605e8 100644 --- a/vmod/vmod_cookie.c +++ b/vmod/vmod_cookie.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012-2020 Varnish Software + * Copyright (c) 2012-2020 Varnish Software AS * * Author: Lasse Karstensen * Author: Lasse Karstensen diff --git a/vmod/vmod_directors_shard.c b/vmod/vmod_directors_shard.c index 19f48339b..8e544ce4b 100644 --- a/vmod/vmod_directors_shard.c +++ b/vmod/vmod_directors_shard.c @@ -1,5 +1,5 @@ /*- - * Copyright 2009-2018 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2009-2018 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Julian Wiesener diff --git a/vmod/vmod_directors_shard_cfg.c b/vmod/vmod_directors_shard_cfg.c index 6ba55b692..53088a404 100644 --- a/vmod/vmod_directors_shard_cfg.c +++ b/vmod/vmod_directors_shard_cfg.c @@ -1,5 +1,5 @@ /*- - * Copyright 2009-2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2009-2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Nils Goroll diff --git a/vmod/vmod_directors_shard_cfg.h b/vmod/vmod_directors_shard_cfg.h index 87a6f69e4..d2f66a717 100644 --- a/vmod/vmod_directors_shard_cfg.h +++ b/vmod/vmod_directors_shard_cfg.h @@ -1,5 +1,5 @@ /*- - * Copyright 2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Author: Nils Goroll diff --git a/vmod/vmod_directors_shard_dir.c b/vmod/vmod_directors_shard_dir.c index 9b82722d1..3393a7faf 100644 --- a/vmod/vmod_directors_shard_dir.c +++ b/vmod/vmod_directors_shard_dir.c @@ -1,5 +1,5 @@ /*- - * Copyright 2009-2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2009-2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Nils Goroll diff --git a/vmod/vmod_directors_shard_dir.h b/vmod/vmod_directors_shard_dir.h index 47a66b92a..fb49bcdfc 100644 --- a/vmod/vmod_directors_shard_dir.h +++ b/vmod/vmod_directors_shard_dir.h @@ -1,5 +1,5 @@ /*- - * Copyright 2009-2016 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2009-2016 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Julian Wiesener diff --git a/vmod/vmod_unix.c b/vmod/vmod_unix.c index 1edfca9d5..ccd0f1a85 100644 --- a/vmod/vmod_unix.c +++ b/vmod/vmod_unix.c @@ -1,5 +1,5 @@ /*- - * Copyright 2018 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2018 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Geoffrey Simmons diff --git a/vmod/vmod_unix_cred_compat.h b/vmod/vmod_unix_cred_compat.h index 9ac8438f8..1b741ddde 100644 --- a/vmod/vmod_unix_cred_compat.h +++ b/vmod/vmod_unix_cred_compat.h @@ -1,5 +1,5 @@ /*- - * Copyright 2018 UPLEX - Nils Goroll Systemoptimierung + * Copyright (c) 2018 UPLEX - Nils Goroll Systemoptimierung * All rights reserved. * * Authors: Geoffrey Simmons From phk at FreeBSD.org Wed Feb 24 11:32:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 24 Feb 2021 11:32:08 +0000 (UTC) Subject: [master] 3c18b3911 Bounce of copyright where warranted Message-ID: <20210224113208.27534107ADF@lists.varnish-cache.org> commit 3c18b3911d48ddf2bfdfc4c50bdadd74648a64d5 Author: Poul-Henning Kamp Date: Wed Feb 24 10:56:43 2021 +0000 Bounce of copyright where warranted diff --git a/LICENSE b/LICENSE index b32a79c55..bc7f1d35b 100644 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ The compilation of software known as "Varnish Cache" is distributed under the following terms: Copyright (c) 2006 Verdens Gang AS -Copyright (c) 2006-2020 Varnish Software AS +Copyright (c) 2006-2021 Varnish Software AS All rights reserved. SPDX-License-Identifier: BSD-2-Clause diff --git a/bin/varnishd/cache/cache_vrt_priv.c b/bin/varnishd/cache/cache_vrt_priv.c index 99c67c7dc..307b3c9cb 100644 --- a/bin/varnishd/cache/cache_vrt_priv.c +++ b/bin/varnishd/cache/cache_vrt_priv.c @@ -1,6 +1,6 @@ /*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2015 Varnish Software AS + * Copyright (c) 2006-2021 Varnish Software AS * All rights reserved. * * Author: Poul-Henning Kamp diff --git a/bin/varnishtest/vtc_h2_stattbl.h b/bin/varnishtest/vtc_h2_stattbl.h index e845cf85b..a8b325856 100644 --- a/bin/varnishtest/vtc_h2_stattbl.h +++ b/bin/varnishtest/vtc_h2_stattbl.h @@ -1,6 +1,7 @@ /*- * For Copyright information see RFC7541 [BSD3] */ + STAT_HDRS(1, ":authority", "") STAT_HDRS(2, ":method", "GET") STAT_HDRS(3, ":method", "POST") diff --git a/include/tbl/h2_error.h b/include/tbl/h2_error.h index d8b1df3ab..e8104f8aa 100644 --- a/include/tbl/h2_error.h +++ b/include/tbl/h2_error.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Varnish Software AS + * Copyright (c) 2016-2021 Varnish Software AS * All rights reserved. * * Author: Poul-Henning Kamp diff --git a/include/tbl/mgt_vcc.h b/include/tbl/mgt_vcc.h index efff37265..9f828679a 100644 --- a/include/tbl/mgt_vcc.h +++ b/include/tbl/mgt_vcc.h @@ -1,3 +1,8 @@ +/* + * This file is in the public domain + * + */ + MGT_VCC(unsigned, acl_pedantic, Acl_Pedantic) MGT_VCC(unsigned, allow_inline_c, Allow_InlineC) MGT_VCC(unsigned, err_unref, Err_Unref) diff --git a/include/tbl/params.h b/include/tbl/params.h index fe4d2a293..cca420cb8 100644 --- a/include/tbl/params.h +++ b/include/tbl/params.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Varnish Software AS + * Copyright (c) 2015-2020 Varnish Software AS * All rights reserved. * * Author: Poul-Henning Kamp diff --git a/include/vrt.h b/include/vrt.h index 64b400068..70eb45179 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -1,5 +1,6 @@ -/*- * Copyright (c) 2006 Verdens Gang AS - * Copyright (c) 2006-2015 Varnish Software AS +/*- + * Copyright (c) 2006 Verdens Gang AS + * Copyright (c) 2006-2021 Varnish Software AS * All rights reserved. * * Author: Poul-Henning Kamp diff --git a/vmod/vmod_blob_tbl_encodings.h b/vmod/vmod_blob_tbl_encodings.h index 2319e9cb7..48765b27c 100644 --- a/vmod/vmod_blob_tbl_encodings.h +++ b/vmod/vmod_blob_tbl_encodings.h @@ -1,3 +1,8 @@ +/* + * This file is in the public domain. + * + */ + VMODENUM(BASE64) VMODENUM(BASE64URL) VMODENUM(BASE64URLNOPAD) diff --git a/vmod/vmod_debug_obj.c b/vmod/vmod_debug_obj.c index 11c499997..cca01c1db 100644 --- a/vmod/vmod_debug_obj.c +++ b/vmod/vmod_debug_obj.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015 Varnish Software AS + * Copyright (c) 2013-2021 Varnish Software AS * All rights reserved. * * Author: Poul-Henning Kamp From dridi.boukelmoune at gmail.com Wed Feb 24 12:18:06 2021 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Wed, 24 Feb 2021 12:18:06 +0000 (UTC) Subject: [master] 005f88847 vtc: Polish error message Message-ID: <20210224121807.14F5C109048@lists.varnish-cache.org> commit 005f888471e004a8d512caa5118b83fad164dccc Author: Dridi Boukelmoune Date: Tue Feb 23 18:57:30 2021 +0100 vtc: Polish error message diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c index cb1c6b5f5..e10b11a93 100644 --- a/bin/varnishtest/vtc_http2.c +++ b/bin/varnishtest/vtc_http2.c @@ -864,7 +864,7 @@ receive_frame(void *priv) do { \ n = strtoul(ss, &p, 0); \ if (*p != '\0') \ - vtc_fatal(v, "%s takes an integer as argument" \ + vtc_fatal(v, "%s takes an integer as argument " \ "(found %s)", c, ss); \ } while (0) From dridi.boukelmoune at gmail.com Wed Feb 24 12:18:07 2021 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Wed, 24 Feb 2021 12:18:07 +0000 (UTC) Subject: [master] 0145e4a7a vtc: Properly parse `rxdata -some` Message-ID: <20210224121807.2EF9A10904B@lists.varnish-cache.org> commit 0145e4a7a3dbe1c94da1cc81e506e137394f7b59 Author: Dridi Boukelmoune Date: Tue Feb 23 18:57:55 2021 +0100 vtc: Properly parse `rxdata -some` diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c index e10b11a93..be80d32ed 100644 --- a/bin/varnishtest/vtc_http2.c +++ b/bin/varnishtest/vtc_http2.c @@ -2254,6 +2254,7 @@ cmd_rxdata(CMD_ARGS) while (*++av) if (!strcmp(*av, "-some")) { + av++; STRTOU32(times, *av, p, vl, "-some"); if (!times) vtc_fatal(vl, "-some argument must be more" From dridi.boukelmoune at gmail.com Wed Feb 24 12:18:07 2021 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Wed, 24 Feb 2021 12:18:07 +0000 (UTC) Subject: [master] 03f71c6e6 h2: Reset the stream upon delivery error Message-ID: <20210224121807.4D36510904E@lists.varnish-cache.org> commit 03f71c6e6dae1340ea7ed080306a6d6c2b8bb56d Author: Dridi Boukelmoune Date: Tue Feb 23 19:16:17 2021 +0100 h2: Reset the stream upon delivery error Until now we'd send a zero-length DATA frame with the END_STREAM flag set, masquerading fetch streaming failures as completed responses. In the absence of a content-length header a user agent couldn't notice there was a problem. This does not apply to ESI sub-requests, they aren't streamed during delivery. diff --git a/bin/varnishd/http2/cache_http2_deliver.c b/bin/varnishd/http2/cache_http2_deliver.c index ffcee5827..a73c9943d 100644 --- a/bin/varnishd/http2/cache_http2_deliver.c +++ b/bin/varnishd/http2/cache_http2_deliver.c @@ -95,6 +95,14 @@ h2_fini(struct vdp_ctx *vdc, void **priv) if (r2->error) return (0); + if (vdc->retval) { + r2->error = H2SE_INTERNAL_ERROR; /* XXX: proper error? */ + H2_Send_Get(vdc->wrk, r2->h2sess, r2); + H2_Send_RST(vdc->wrk, r2->h2sess, r2, r2->stream, r2->error); + H2_Send_Rel(r2->h2sess, r2); + return (0); + } + H2_Send_Get(vdc->wrk, r2->h2sess, r2); H2_Send(vdc->wrk, r2, H2_F_DATA, H2FF_DATA_END_STREAM, 0, "", NULL); H2_Send_Rel(r2->h2sess, r2); diff --git a/bin/varnishtest/tests/r02258.vtc b/bin/varnishtest/tests/r02258.vtc index 097682c88..552b1b47e 100644 --- a/bin/varnishtest/tests/r02258.vtc +++ b/bin/varnishtest/tests/r02258.vtc @@ -23,29 +23,23 @@ client c1 { expect_close } -run -delay .3 +varnish v1 -expect MAIN.sc_range_short == 1 -server s1 { - rxreq - txresp -nolen -hdr "Content-length: 9" - delay 1 - send "BLA" - delay .4 - send "BLA" - delay .3 - send "BL" -} -start +delay .3 varnish v1 -cliok "param.set feature +http2" -client c1 { +server s1 -start + +client c2 { stream 1 { txreq -hdr "range" "bytes=0-16" rxhdrs expect resp.status == 206 expect resp.http.content-length == 9 - rxdata -all + rxdata -some 3 + expect resp.body == BLABLABL + rxrst + expect rst.err == INTERNAL_ERROR } -run } -run - -varnish v1 -expect MAIN.sc_range_short == 1 From phk at FreeBSD.org Wed Feb 24 13:00:10 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 24 Feb 2021 13:00:10 +0000 (UTC) Subject: [master] fe8cfe848 Add Copyright/license info to .rst files. Message-ID: <20210224130010.0F2FD10D499@lists.varnish-cache.org> commit fe8cfe8484e500596f634b16b70c1f778b9a7415 Author: Poul-Henning Kamp Date: Wed Feb 24 12:58:12 2021 +0000 Add Copyright/license info to .rst files. diff --git a/.circleci/README.rst b/.circleci/README.rst index 0c52c4235..fa541b43b 100644 --- a/.circleci/README.rst +++ b/.circleci/README.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Multiarch building, testing & packaging ======================================= diff --git a/README.rst b/README.rst index 89c0853a0..14f40f90a 100644 --- a/README.rst +++ b/README.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Varnish Cache ============= diff --git a/doc/README.WRITING_RST.rst b/doc/README.WRITING_RST.rst index 77e005476..a805be04a 100644 --- a/doc/README.WRITING_RST.rst +++ b/doc/README.WRITING_RST.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2015-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + THINGS TO CONSIDER WHEN WRITING VARNISH RST DOCUMENTATION ========================================================= diff --git a/doc/changes.rst b/doc/changes.rst index f23a79f70..f29961551 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2011-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + =================== About this document =================== diff --git a/doc/sphinx/dev-guide/homepage_contrib.rst b/doc/sphinx/dev-guide/homepage_contrib.rst index a6c9c8720..1a34bfb88 100644 --- a/doc/sphinx/dev-guide/homepage_contrib.rst +++ b/doc/sphinx/dev-guide/homepage_contrib.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _homepage_contrib: How to contribute content to varnish-cache.org diff --git a/doc/sphinx/dev-guide/homepage_dogfood.rst b/doc/sphinx/dev-guide/homepage_dogfood.rst index 3073fc4d1..d317096bd 100644 --- a/doc/sphinx/dev-guide/homepage_dogfood.rst +++ b/doc/sphinx/dev-guide/homepage_dogfood.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _homepage_dogfood: How our website works diff --git a/doc/sphinx/dev-guide/index.rst b/doc/sphinx/dev-guide/index.rst index 192ec689a..c55984150 100644 --- a/doc/sphinx/dev-guide/index.rst +++ b/doc/sphinx/dev-guide/index.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _dev-guide-index: The Varnish Developers Guide diff --git a/doc/sphinx/dev-guide/policy_vmods.rst b/doc/sphinx/dev-guide/policy_vmods.rst index 365e86e73..66066c67c 100644 --- a/doc/sphinx/dev-guide/policy_vmods.rst +++ b/doc/sphinx/dev-guide/policy_vmods.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _policy-vmods: Bundling VMODs with the Varnish distribution diff --git a/doc/sphinx/dev-guide/who.rst b/doc/sphinx/dev-guide/who.rst index d7b8c1d95..cc04bacdd 100644 --- a/doc/sphinx/dev-guide/who.rst +++ b/doc/sphinx/dev-guide/who.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _who_is: Who is ... ? diff --git a/doc/sphinx/glossary/index.rst b/doc/sphinx/glossary/index.rst index 7877f607c..7c0ce9dab 100644 --- a/doc/sphinx/glossary/index.rst +++ b/doc/sphinx/glossary/index.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _glossary: diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst index 83f0cdc79..ce5a4077d 100644 --- a/doc/sphinx/index.rst +++ b/doc/sphinx/index.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Varnish Documentation ===================== diff --git a/doc/sphinx/installation/bugs.rst b/doc/sphinx/installation/bugs.rst index 75fda836f..31eb0f0a8 100644 --- a/doc/sphinx/installation/bugs.rst +++ b/doc/sphinx/installation/bugs.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + %%%%%%%%%%%%%% Reporting bugs %%%%%%%%%%%%%% diff --git a/doc/sphinx/installation/cloud_debian.rst b/doc/sphinx/installation/cloud_debian.rst index 80464bf10..2a77cb34c 100644 --- a/doc/sphinx/installation/cloud_debian.rst +++ b/doc/sphinx/installation/cloud_debian.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _cloud-debian: Debian cloud images diff --git a/doc/sphinx/installation/cloud_redhat.rst b/doc/sphinx/installation/cloud_redhat.rst index 07bb5a67c..0b8b66c91 100644 --- a/doc/sphinx/installation/cloud_redhat.rst +++ b/doc/sphinx/installation/cloud_redhat.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _cloud-redhat: RedHat Cloud images diff --git a/doc/sphinx/installation/cloud_ubuntu.rst b/doc/sphinx/installation/cloud_ubuntu.rst index 9693b07c6..293f8c4f4 100644 --- a/doc/sphinx/installation/cloud_ubuntu.rst +++ b/doc/sphinx/installation/cloud_ubuntu.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _cloud-ubuntu: Ubuntu Cloud images diff --git a/doc/sphinx/installation/help.rst b/doc/sphinx/installation/help.rst index 47f2dfe52..73fa9dce1 100644 --- a/doc/sphinx/installation/help.rst +++ b/doc/sphinx/installation/help.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + %%%%%%%%%%%% Getting help %%%%%%%%%%%% diff --git a/doc/sphinx/installation/index.rst b/doc/sphinx/installation/index.rst index 525fdcd44..ed77a10b8 100644 --- a/doc/sphinx/installation/index.rst +++ b/doc/sphinx/installation/index.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _install-index: Varnish Installation diff --git a/doc/sphinx/installation/install.rst b/doc/sphinx/installation/install.rst index 609d08dee..ff39d519f 100644 --- a/doc/sphinx/installation/install.rst +++ b/doc/sphinx/installation/install.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _install-doc: Installing Varnish diff --git a/doc/sphinx/installation/install_debian.rst b/doc/sphinx/installation/install_debian.rst index 405824252..f7ab55afe 100644 --- a/doc/sphinx/installation/install_debian.rst +++ b/doc/sphinx/installation/install_debian.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _install-debian: Installing on Debian/Ubuntu diff --git a/doc/sphinx/installation/install_freebsd.rst b/doc/sphinx/installation/install_freebsd.rst index 76cef4389..a4da75645 100644 --- a/doc/sphinx/installation/install_freebsd.rst +++ b/doc/sphinx/installation/install_freebsd.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _install-freebsd: Installing on FreeBSD diff --git a/doc/sphinx/installation/install_openbsd.rst b/doc/sphinx/installation/install_openbsd.rst index e2dedbeb6..6548312aa 100644 --- a/doc/sphinx/installation/install_openbsd.rst +++ b/doc/sphinx/installation/install_openbsd.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _install-openbsd: Installing on OpenBSD diff --git a/doc/sphinx/installation/install_redhat.rst b/doc/sphinx/installation/install_redhat.rst index e2ce63be7..4bd7222c4 100644 --- a/doc/sphinx/installation/install_redhat.rst +++ b/doc/sphinx/installation/install_redhat.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _install-redhat: Installing on RedHat or CentOS diff --git a/doc/sphinx/installation/install_source.rst b/doc/sphinx/installation/install_source.rst index 0df5e8c99..ba778b68a 100644 --- a/doc/sphinx/installation/install_source.rst +++ b/doc/sphinx/installation/install_source.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _install-src: Compiling Varnish from source diff --git a/doc/sphinx/installation/platformnotes.rst b/doc/sphinx/installation/platformnotes.rst index 1657af1c7..38f20e4ae 100644 --- a/doc/sphinx/installation/platformnotes.rst +++ b/doc/sphinx/installation/platformnotes.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Platform specific notes ------------------------ diff --git a/doc/sphinx/installation/prerequisites.rst b/doc/sphinx/installation/prerequisites.rst index 05aea319d..7e47ba045 100644 --- a/doc/sphinx/installation/prerequisites.rst +++ b/doc/sphinx/installation/prerequisites.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2014 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Prerequisites ============= diff --git a/doc/sphinx/phk/10goingon50.rst b/doc/sphinx/phk/10goingon50.rst index 219922775..24624bc9a 100644 --- a/doc/sphinx/phk/10goingon50.rst +++ b/doc/sphinx/phk/10goingon50.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_10goingon50: ======================== diff --git a/doc/sphinx/phk/VSV00001.rst b/doc/sphinx/phk/VSV00001.rst index 8d3c68656..225f300cd 100644 --- a/doc/sphinx/phk/VSV00001.rst +++ b/doc/sphinx/phk/VSV00001.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_vsv00001: Yah! A security issue - finally! diff --git a/doc/sphinx/phk/VSV00003.rst b/doc/sphinx/phk/VSV00003.rst index dcb64f19e..e0dac03a7 100644 --- a/doc/sphinx/phk/VSV00003.rst +++ b/doc/sphinx/phk/VSV00003.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_vsv00003: Here we are again - VSV00003 in perspective diff --git a/doc/sphinx/phk/apispaces.rst b/doc/sphinx/phk/apispaces.rst index 5da87e67c..acda64b6b 100644 --- a/doc/sphinx/phk/apispaces.rst +++ b/doc/sphinx/phk/apispaces.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_api_spaces: API spaces diff --git a/doc/sphinx/phk/autocrap.rst b/doc/sphinx/phk/autocrap.rst index 86a2dd155..0d2535d14 100644 --- a/doc/sphinx/phk/autocrap.rst +++ b/doc/sphinx/phk/autocrap.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_autocrap: ==================================== diff --git a/doc/sphinx/phk/backends.rst b/doc/sphinx/phk/backends.rst index 2a2a34813..a8a1fd089 100644 --- a/doc/sphinx/phk/backends.rst +++ b/doc/sphinx/phk/backends.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_backends: =============================== diff --git a/doc/sphinx/phk/barriers.rst b/doc/sphinx/phk/barriers.rst index f9ba31b09..ccce898f8 100644 --- a/doc/sphinx/phk/barriers.rst +++ b/doc/sphinx/phk/barriers.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_barriers: ============================ diff --git a/doc/sphinx/phk/brinch-hansens-arrows.rst b/doc/sphinx/phk/brinch-hansens-arrows.rst index f4299b5c1..e7e20d05b 100644 --- a/doc/sphinx/phk/brinch-hansens-arrows.rst +++ b/doc/sphinx/phk/brinch-hansens-arrows.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_brinch_hansens_arrows: ===================== diff --git a/doc/sphinx/phk/dough.rst b/doc/sphinx/phk/dough.rst index ea38a2e86..fa5b8c62e 100644 --- a/doc/sphinx/phk/dough.rst +++ b/doc/sphinx/phk/dough.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2014-2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_dough: ==================================================== diff --git a/doc/sphinx/phk/farfaraway.rst b/doc/sphinx/phk/farfaraway.rst index 594a4cba0..18c90bf2b 100644 --- a/doc/sphinx/phk/farfaraway.rst +++ b/doc/sphinx/phk/farfaraway.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_farfaraway: ============= diff --git a/doc/sphinx/phk/firstdesign.rst b/doc/sphinx/phk/firstdesign.rst index fee1943f8..3eedaa17f 100644 --- a/doc/sphinx/phk/firstdesign.rst +++ b/doc/sphinx/phk/firstdesign.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016-2018 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_firstdesign: =========================== diff --git a/doc/sphinx/phk/gzip.rst b/doc/sphinx/phk/gzip.rst index 68ff0f0b0..929ece18b 100644 --- a/doc/sphinx/phk/gzip.rst +++ b/doc/sphinx/phk/gzip.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2011-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_gzip: ======================================= diff --git a/doc/sphinx/phk/http20.rst b/doc/sphinx/phk/http20.rst index 525f0f399..a3d597310 100644 --- a/doc/sphinx/phk/http20.rst +++ b/doc/sphinx/phk/http20.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_http20_lack_of_interest: ====================================== diff --git a/doc/sphinx/phk/index.rst b/doc/sphinx/phk/index.rst index 043ede143..6b3357b59 100644 --- a/doc/sphinx/phk/index.rst +++ b/doc/sphinx/phk/index.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk: Poul-Hennings random outbursts diff --git a/doc/sphinx/phk/ipv6suckage.rst b/doc/sphinx/phk/ipv6suckage.rst index dac68bedb..bd92c96b5 100644 --- a/doc/sphinx/phk/ipv6suckage.rst +++ b/doc/sphinx/phk/ipv6suckage.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2011 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_ipv6suckage: ============ diff --git a/doc/sphinx/phk/lucky.rst b/doc/sphinx/phk/lucky.rst index bf84ce746..434768488 100644 --- a/doc/sphinx/phk/lucky.rst +++ b/doc/sphinx/phk/lucky.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_lucky: =================== diff --git a/doc/sphinx/phk/notes.rst b/doc/sphinx/phk/notes.rst index 16065ec1c..61c3a0a8d 100644 --- a/doc/sphinx/phk/notes.rst +++ b/doc/sphinx/phk/notes.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_notes: ======================== diff --git a/doc/sphinx/phk/patent.rst b/doc/sphinx/phk/patent.rst index 7fa4b8f53..dc3cf0e46 100644 --- a/doc/sphinx/phk/patent.rst +++ b/doc/sphinx/phk/patent.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_patent: A patently good idea diff --git a/doc/sphinx/phk/persistent.rst b/doc/sphinx/phk/persistent.rst index cdcb2d9c0..01164e2dc 100644 --- a/doc/sphinx/phk/persistent.rst +++ b/doc/sphinx/phk/persistent.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2014-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_persistent: ==================== diff --git a/doc/sphinx/phk/platforms.rst b/doc/sphinx/phk/platforms.rst index 047196b72..643780fe7 100644 --- a/doc/sphinx/phk/platforms.rst +++ b/doc/sphinx/phk/platforms.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_platforms: ================= diff --git a/doc/sphinx/phk/quic.rst b/doc/sphinx/phk/quic.rst index c512af7a7..25ca1ec44 100644 --- a/doc/sphinx/phk/quic.rst +++ b/doc/sphinx/phk/quic.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_quick_osi: QUIC visions of OSI diff --git a/doc/sphinx/phk/somethinghappened.rst b/doc/sphinx/phk/somethinghappened.rst index 30d45fadf..384a92164 100644 --- a/doc/sphinx/phk/somethinghappened.rst +++ b/doc/sphinx/phk/somethinghappened.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_somethinghappened: ==================================================== diff --git a/doc/sphinx/phk/spdy.rst b/doc/sphinx/phk/spdy.rst index 7f70236ac..bba6a24a0 100644 --- a/doc/sphinx/phk/spdy.rst +++ b/doc/sphinx/phk/spdy.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_spdy: =================================== diff --git a/doc/sphinx/phk/sphinx.rst b/doc/sphinx/phk/sphinx.rst index d001826ac..e4083a9b2 100644 --- a/doc/sphinx/phk/sphinx.rst +++ b/doc/sphinx/phk/sphinx.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_sphinx: =================================== diff --git a/doc/sphinx/phk/ssl.rst b/doc/sphinx/phk/ssl.rst index f700f1913..285d72197 100644 --- a/doc/sphinx/phk/ssl.rst +++ b/doc/sphinx/phk/ssl.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2011-2014 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_ssl: ============ diff --git a/doc/sphinx/phk/ssl_again.rst b/doc/sphinx/phk/ssl_again.rst index d0f832310..edf3c1c63 100644 --- a/doc/sphinx/phk/ssl_again.rst +++ b/doc/sphinx/phk/ssl_again.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2015-2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_ssl_again: ============= diff --git a/doc/sphinx/phk/thatslow.rst b/doc/sphinx/phk/thatslow.rst index 7bfd76ad8..e5bd92a8b 100644 --- a/doc/sphinx/phk/thatslow.rst +++ b/doc/sphinx/phk/thatslow.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_that_slow: ================= diff --git a/doc/sphinx/phk/thetoolsweworkwith.rst b/doc/sphinx/phk/thetoolsweworkwith.rst index 1ab4fc57d..536c719c8 100644 --- a/doc/sphinx/phk/thetoolsweworkwith.rst +++ b/doc/sphinx/phk/thetoolsweworkwith.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2011-2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_thetoolsweworkwith: ====================== diff --git a/doc/sphinx/phk/thoughts.rst b/doc/sphinx/phk/thoughts.rst index b562ba7cb..b8f95ecdd 100644 --- a/doc/sphinx/phk/thoughts.rst +++ b/doc/sphinx/phk/thoughts.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_thoughts: ========================= diff --git a/doc/sphinx/phk/three-zero.rst b/doc/sphinx/phk/three-zero.rst index c1fd3b86a..4c5902909 100644 --- a/doc/sphinx/phk/three-zero.rst +++ b/doc/sphinx/phk/three-zero.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2011-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_3.0: ================================== diff --git a/doc/sphinx/phk/trialerror.rst b/doc/sphinx/phk/trialerror.rst index d36688e15..79be80e70 100644 --- a/doc/sphinx/phk/trialerror.rst +++ b/doc/sphinx/phk/trialerror.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016-2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_trialerror: ================================================= diff --git a/doc/sphinx/phk/varnish_does_not_hash.rst b/doc/sphinx/phk/varnish_does_not_hash.rst index e03f078f8..832d67c95 100644 --- a/doc/sphinx/phk/varnish_does_not_hash.rst +++ b/doc/sphinx/phk/varnish_does_not_hash.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2013 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_varnish_does_not_hash: ===================== diff --git a/doc/sphinx/phk/vcl_expr.rst b/doc/sphinx/phk/vcl_expr.rst index 254384dcb..3a7028388 100644 --- a/doc/sphinx/phk/vcl_expr.rst +++ b/doc/sphinx/phk/vcl_expr.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_vcl_expr: =============== diff --git a/doc/sphinx/phk/vdd19q3.rst b/doc/sphinx/phk/vdd19q3.rst index a5d2b8598..170460e54 100644 --- a/doc/sphinx/phk/vdd19q3.rst +++ b/doc/sphinx/phk/vdd19q3.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _vdd19q3: Varnish Developer Day 2019Q3 diff --git a/doc/sphinx/phk/wanton_destruction.rst b/doc/sphinx/phk/wanton_destruction.rst index 8ad757d4e..511e974ee 100644 --- a/doc/sphinx/phk/wanton_destruction.rst +++ b/doc/sphinx/phk/wanton_destruction.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _phk_wanton: ======================================= diff --git a/doc/sphinx/reference/cli_protocol.rst b/doc/sphinx/reference/cli_protocol.rst index 106f7d3e8..ff9e7d7d8 100644 --- a/doc/sphinx/reference/cli_protocol.rst +++ b/doc/sphinx/reference/cli_protocol.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _ref_cli_api: diff --git a/doc/sphinx/reference/directors.rst b/doc/sphinx/reference/directors.rst index 5d24e8fb9..8f9b82bdf 100644 --- a/doc/sphinx/reference/directors.rst +++ b/doc/sphinx/reference/directors.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2015-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _ref-writing-a-director: %%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/reference/dp_vcl_recv_hash.rst b/doc/sphinx/reference/dp_vcl_recv_hash.rst index a44e07006..a3a548f92 100644 --- a/doc/sphinx/reference/dp_vcl_recv_hash.rst +++ b/doc/sphinx/reference/dp_vcl_recv_hash.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _db_vcl_recv_hash: Hashing in `vcl_recv{}` diff --git a/doc/sphinx/reference/dp_vcl_resp_status.rst b/doc/sphinx/reference/dp_vcl_resp_status.rst index a4edb17a5..90415f4f1 100644 --- a/doc/sphinx/reference/dp_vcl_resp_status.rst +++ b/doc/sphinx/reference/dp_vcl_resp_status.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _dp_vcl_resp_status: Using extra digits in resp.status diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst index fa6d61193..830541c04 100644 --- a/doc/sphinx/reference/index.rst +++ b/doc/sphinx/reference/index.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _reference-index: %%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/reference/shell_tricks.rst b/doc/sphinx/reference/shell_tricks.rst index 89e55e559..35622abb3 100644 --- a/doc/sphinx/reference/shell_tricks.rst +++ b/doc/sphinx/reference/shell_tricks.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _ref-shell_tricks: %%%%%%%%%%%% diff --git a/doc/sphinx/reference/states.rst b/doc/sphinx/reference/states.rst index 9effce167..4bc0910ba 100644 --- a/doc/sphinx/reference/states.rst +++ b/doc/sphinx/reference/states.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2014-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _reference-states: ========================= diff --git a/doc/sphinx/reference/varnish-cli.rst b/doc/sphinx/reference/varnish-cli.rst index 6b7cfaf28..58809d56f 100644 --- a/doc/sphinx/reference/varnish-cli.rst +++ b/doc/sphinx/reference/varnish-cli.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2011-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _varnish-cli(7): diff --git a/doc/sphinx/reference/varnish-counters.rst b/doc/sphinx/reference/varnish-counters.rst index 781eeaa02..e6caebba2 100644 --- a/doc/sphinx/reference/varnish-counters.rst +++ b/doc/sphinx/reference/varnish-counters.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _varnish-counters(7): ================ diff --git a/doc/sphinx/reference/varnishadm.rst b/doc/sphinx/reference/varnishadm.rst index aa7f3d4a4..5214b3477 100644 --- a/doc/sphinx/reference/varnishadm.rst +++ b/doc/sphinx/reference/varnishadm.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _varnishadm(1): diff --git a/doc/sphinx/reference/varnishd.rst b/doc/sphinx/reference/varnishd.rst index 95c680908..fca58cad0 100644 --- a/doc/sphinx/reference/varnishd.rst +++ b/doc/sphinx/reference/varnishd.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _varnishd(1): diff --git a/doc/sphinx/reference/varnishhist.rst b/doc/sphinx/reference/varnishhist.rst index aabb9154a..d02080a24 100644 --- a/doc/sphinx/reference/varnishhist.rst +++ b/doc/sphinx/reference/varnishhist.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _varnishhist(1): diff --git a/doc/sphinx/reference/varnishlog.rst b/doc/sphinx/reference/varnishlog.rst index f93d5d623..55df8a2a2 100644 --- a/doc/sphinx/reference/varnishlog.rst +++ b/doc/sphinx/reference/varnishlog.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _varnishlog(1): diff --git a/doc/sphinx/reference/varnishncsa.rst b/doc/sphinx/reference/varnishncsa.rst index d2b61e16c..6cb30e3e0 100644 --- a/doc/sphinx/reference/varnishncsa.rst +++ b/doc/sphinx/reference/varnishncsa.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _varnishncsa(1): diff --git a/doc/sphinx/reference/varnishstat.rst b/doc/sphinx/reference/varnishstat.rst index ecc26526c..1ff603831 100644 --- a/doc/sphinx/reference/varnishstat.rst +++ b/doc/sphinx/reference/varnishstat.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _varnishstat(1): diff --git a/doc/sphinx/reference/varnishtest.rst b/doc/sphinx/reference/varnishtest.rst index edde1f1ec..baaa6c288 100644 --- a/doc/sphinx/reference/varnishtest.rst +++ b/doc/sphinx/reference/varnishtest.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _varnishtest(1): diff --git a/doc/sphinx/reference/varnishtop.rst b/doc/sphinx/reference/varnishtop.rst index b9f2b078a..a8eeddab9 100644 --- a/doc/sphinx/reference/varnishtop.rst +++ b/doc/sphinx/reference/varnishtop.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _varnishtop(1): diff --git a/doc/sphinx/reference/vcl-backend.rst b/doc/sphinx/reference/vcl-backend.rst index 8d5472144..dfd2296c6 100644 --- a/doc/sphinx/reference/vcl-backend.rst +++ b/doc/sphinx/reference/vcl-backend.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _vcl-backend(7): diff --git a/doc/sphinx/reference/vcl-probe.rst b/doc/sphinx/reference/vcl-probe.rst index 4268807c8..01bea5a92 100644 --- a/doc/sphinx/reference/vcl-probe.rst +++ b/doc/sphinx/reference/vcl-probe.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _vcl-probe(7): diff --git a/doc/sphinx/reference/vcl-var.rst b/doc/sphinx/reference/vcl-var.rst index 695d3c1bb..e05f6c74c 100644 --- a/doc/sphinx/reference/vcl-var.rst +++ b/doc/sphinx/reference/vcl-var.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _vcl-var(7): diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst index 0640181b7..186b75e86 100644 --- a/doc/sphinx/reference/vcl.rst +++ b/doc/sphinx/reference/vcl.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _vcl(7): diff --git a/doc/sphinx/reference/vcl_var.rst b/doc/sphinx/reference/vcl_var.rst index 5cb180b78..5b7a4a1b5 100644 --- a/doc/sphinx/reference/vcl_var.rst +++ b/doc/sphinx/reference/vcl_var.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2018-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _vcl_variables: diff --git a/doc/sphinx/reference/vmod.rst b/doc/sphinx/reference/vmod.rst index 44499496a..26aa38b01 100644 --- a/doc/sphinx/reference/vmod.rst +++ b/doc/sphinx/reference/vmod.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _ref-vmod: %%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/reference/vmod_blob.rst b/doc/sphinx/reference/vmod_blob.rst index e6b473c4f..48e4f1ffc 100644 --- a/doc/sphinx/reference/vmod_blob.rst +++ b/doc/sphinx/reference/vmod_blob.rst @@ -1,2 +1,7 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. include:: ../include/vmod_blob.generated.rst diff --git a/doc/sphinx/reference/vmod_cookie.rst b/doc/sphinx/reference/vmod_cookie.rst index f38ff037c..fb48ee45b 100644 --- a/doc/sphinx/reference/vmod_cookie.rst +++ b/doc/sphinx/reference/vmod_cookie.rst @@ -1,2 +1,7 @@ +.. + Copyright (c) 2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. include:: ../include/vmod_cookie.generated.rst diff --git a/doc/sphinx/reference/vmod_directors.rst b/doc/sphinx/reference/vmod_directors.rst index fdb536602..a1badfe96 100644 --- a/doc/sphinx/reference/vmod_directors.rst +++ b/doc/sphinx/reference/vmod_directors.rst @@ -1,2 +1,7 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. include:: ../include/vmod_directors.generated.rst diff --git a/doc/sphinx/reference/vmod_proxy.rst b/doc/sphinx/reference/vmod_proxy.rst index 224b323a0..fc78f8d23 100644 --- a/doc/sphinx/reference/vmod_proxy.rst +++ b/doc/sphinx/reference/vmod_proxy.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. include:: ../include/vmod_proxy.generated.rst diff --git a/doc/sphinx/reference/vmod_purge.rst b/doc/sphinx/reference/vmod_purge.rst index 24f9ffbd2..0bd1738c2 100644 --- a/doc/sphinx/reference/vmod_purge.rst +++ b/doc/sphinx/reference/vmod_purge.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. include:: ../include/vmod_purge.generated.rst diff --git a/doc/sphinx/reference/vmod_std.rst b/doc/sphinx/reference/vmod_std.rst index 5124783bd..4c3571306 100644 --- a/doc/sphinx/reference/vmod_std.rst +++ b/doc/sphinx/reference/vmod_std.rst @@ -1,2 +1,7 @@ +.. + Copyright (c) 2011-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. include:: ../include/vmod_std.generated.rst diff --git a/doc/sphinx/reference/vmod_unix.rst b/doc/sphinx/reference/vmod_unix.rst index fe26290f0..d31030813 100644 --- a/doc/sphinx/reference/vmod_unix.rst +++ b/doc/sphinx/reference/vmod_unix.rst @@ -1,2 +1,7 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. include:: ../include/vmod_unix.generated.rst diff --git a/doc/sphinx/reference/vmod_vtc.rst b/doc/sphinx/reference/vmod_vtc.rst index f71a68588..ab76009c8 100644 --- a/doc/sphinx/reference/vmod_vtc.rst +++ b/doc/sphinx/reference/vmod_vtc.rst @@ -1,2 +1,7 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. include:: ../include/vmod_vtc.generated.rst diff --git a/doc/sphinx/reference/vsl-query.rst b/doc/sphinx/reference/vsl-query.rst index 6cfff6100..7c06dccca 100644 --- a/doc/sphinx/reference/vsl-query.rst +++ b/doc/sphinx/reference/vsl-query.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _vsl-query(7): diff --git a/doc/sphinx/reference/vsl.rst b/doc/sphinx/reference/vsl.rst index 5835f5a0d..17074a633 100644 --- a/doc/sphinx/reference/vsl.rst +++ b/doc/sphinx/reference/vsl.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2011-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _vsl(7): diff --git a/doc/sphinx/reference/vsm.rst b/doc/sphinx/reference/vsm.rst index d9a689c55..63bb8c758 100644 --- a/doc/sphinx/reference/vsm.rst +++ b/doc/sphinx/reference/vsm.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2011-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VSM: Shared Memory Logging and Statistics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/reference/vtc.rst b/doc/sphinx/reference/vtc.rst index 876b80900..761eee323 100644 --- a/doc/sphinx/reference/vtc.rst +++ b/doc/sphinx/reference/vtc.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016-2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _vtc(7): diff --git a/doc/sphinx/reference/vtla.rst b/doc/sphinx/reference/vtla.rst index 82b99ed24..571b2e297 100644 --- a/doc/sphinx/reference/vtla.rst +++ b/doc/sphinx/reference/vtla.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. role:: ref(emphasis) .. _vtla: diff --git a/doc/sphinx/tutorial/backend_servers.rst b/doc/sphinx/tutorial/backend_servers.rst index 7d7b70a72..e29adab77 100644 --- a/doc/sphinx/tutorial/backend_servers.rst +++ b/doc/sphinx/tutorial/backend_servers.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _tutorial-backend_servers: Backend servers diff --git a/doc/sphinx/tutorial/index.rst b/doc/sphinx/tutorial/index.rst index edac3c9b6..e9e710354 100644 --- a/doc/sphinx/tutorial/index.rst +++ b/doc/sphinx/tutorial/index.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2014 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _tutorial-index: The Varnish Tutorial diff --git a/doc/sphinx/tutorial/introduction.rst b/doc/sphinx/tutorial/introduction.rst index 067a7f834..cf38febfb 100644 --- a/doc/sphinx/tutorial/introduction.rst +++ b/doc/sphinx/tutorial/introduction.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _tutorial-intro: Varnish: The beef in the sandwich diff --git a/doc/sphinx/tutorial/now_what.rst b/doc/sphinx/tutorial/now_what.rst index 90e28f471..a9e12299d 100644 --- a/doc/sphinx/tutorial/now_what.rst +++ b/doc/sphinx/tutorial/now_what.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2014 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + ========= diff --git a/doc/sphinx/tutorial/peculiarities.rst b/doc/sphinx/tutorial/peculiarities.rst index 60709b0be..f5b01b7a9 100644 --- a/doc/sphinx/tutorial/peculiarities.rst +++ b/doc/sphinx/tutorial/peculiarities.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Peculiarities ------------- diff --git a/doc/sphinx/tutorial/putting_varnish_on_port_80.rst b/doc/sphinx/tutorial/putting_varnish_on_port_80.rst index b1c254b8d..c899a9fe4 100644 --- a/doc/sphinx/tutorial/putting_varnish_on_port_80.rst +++ b/doc/sphinx/tutorial/putting_varnish_on_port_80.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Put Varnish on port 80 ---------------------- diff --git a/doc/sphinx/tutorial/starting_varnish.rst b/doc/sphinx/tutorial/starting_varnish.rst index b90e6b6cb..a08451f0e 100644 --- a/doc/sphinx/tutorial/starting_varnish.rst +++ b/doc/sphinx/tutorial/starting_varnish.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2010-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _tutorial-starting_varnish: diff --git a/doc/sphinx/users-guide/command-line.rst b/doc/sphinx/users-guide/command-line.rst index 5bf7a83b9..af80bc538 100644 --- a/doc/sphinx/users-guide/command-line.rst +++ b/doc/sphinx/users-guide/command-line.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-command-line: Required command line arguments diff --git a/doc/sphinx/users-guide/compression.rst b/doc/sphinx/users-guide/compression.rst index d88e35195..ed7f2efe9 100644 --- a/doc/sphinx/users-guide/compression.rst +++ b/doc/sphinx/users-guide/compression.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-compression: Compression diff --git a/doc/sphinx/users-guide/devicedetection.rst b/doc/sphinx/users-guide/devicedetection.rst index 8719adc13..acac51cd9 100644 --- a/doc/sphinx/users-guide/devicedetection.rst +++ b/doc/sphinx/users-guide/devicedetection.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-devicedetect: Device detection diff --git a/doc/sphinx/users-guide/esi.rst b/doc/sphinx/users-guide/esi.rst index 4baa38a3a..a75864ce4 100644 --- a/doc/sphinx/users-guide/esi.rst +++ b/doc/sphinx/users-guide/esi.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-esi: Content composition with Edge Side Includes diff --git a/doc/sphinx/users-guide/increasing-your-hitrate.rst b/doc/sphinx/users-guide/increasing-your-hitrate.rst index def6fcb36..a36ff3d7a 100644 --- a/doc/sphinx/users-guide/increasing-your-hitrate.rst +++ b/doc/sphinx/users-guide/increasing-your-hitrate.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-increasing_your_hitrate: Achieving a high hitrate diff --git a/doc/sphinx/users-guide/index.rst b/doc/sphinx/users-guide/index.rst index 4aae50426..28602fff7 100644 --- a/doc/sphinx/users-guide/index.rst +++ b/doc/sphinx/users-guide/index.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-index: The Varnish Users Guide diff --git a/doc/sphinx/users-guide/intro.rst b/doc/sphinx/users-guide/intro.rst index f430d75cf..04d95c78f 100644 --- a/doc/sphinx/users-guide/intro.rst +++ b/doc/sphinx/users-guide/intro.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users_intro: The Big Varnish Picture diff --git a/doc/sphinx/users-guide/operation-logging.rst b/doc/sphinx/users-guide/operation-logging.rst index e6b58f287..b37009c54 100644 --- a/doc/sphinx/users-guide/operation-logging.rst +++ b/doc/sphinx/users-guide/operation-logging.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-logging: Logging in Varnish diff --git a/doc/sphinx/users-guide/operation-statistics.rst b/doc/sphinx/users-guide/operation-statistics.rst index af062bd7c..92796c848 100644 --- a/doc/sphinx/users-guide/operation-statistics.rst +++ b/doc/sphinx/users-guide/operation-statistics.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-statistics: diff --git a/doc/sphinx/users-guide/params.rst b/doc/sphinx/users-guide/params.rst index 3fc5cd2a2..f4b64fe58 100644 --- a/doc/sphinx/users-guide/params.rst +++ b/doc/sphinx/users-guide/params.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Parameters diff --git a/doc/sphinx/users-guide/performance.rst b/doc/sphinx/users-guide/performance.rst index e775c4557..a85c566c9 100644 --- a/doc/sphinx/users-guide/performance.rst +++ b/doc/sphinx/users-guide/performance.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users_performance: Varnish and Website Performance diff --git a/doc/sphinx/users-guide/purging.rst b/doc/sphinx/users-guide/purging.rst index 696c330cf..8a82dd2f4 100644 --- a/doc/sphinx/users-guide/purging.rst +++ b/doc/sphinx/users-guide/purging.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-purging: diff --git a/doc/sphinx/users-guide/report.rst b/doc/sphinx/users-guide/report.rst index 13daf3e9b..2349b935d 100644 --- a/doc/sphinx/users-guide/report.rst +++ b/doc/sphinx/users-guide/report.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2014 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users_report: Reporting and statistics diff --git a/doc/sphinx/users-guide/run_cli.rst b/doc/sphinx/users-guide/run_cli.rst index c02a8d788..a9e25123b 100644 --- a/doc/sphinx/users-guide/run_cli.rst +++ b/doc/sphinx/users-guide/run_cli.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _run_cli: CLI - bossing Varnish around diff --git a/doc/sphinx/users-guide/run_security.rst b/doc/sphinx/users-guide/run_security.rst index 8334eb8cd..bd51f7b89 100644 --- a/doc/sphinx/users-guide/run_security.rst +++ b/doc/sphinx/users-guide/run_security.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _run_security: Security first diff --git a/doc/sphinx/users-guide/running.rst b/doc/sphinx/users-guide/running.rst index 5cfd539aa..310e9043d 100644 --- a/doc/sphinx/users-guide/running.rst +++ b/doc/sphinx/users-guide/running.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2014 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users_running: Starting and running Varnish diff --git a/doc/sphinx/users-guide/sizing-your-cache.rst b/doc/sphinx/users-guide/sizing-your-cache.rst index 85023a63c..3884f776f 100644 --- a/doc/sphinx/users-guide/sizing-your-cache.rst +++ b/doc/sphinx/users-guide/sizing-your-cache.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Sizing your cache ----------------- diff --git a/doc/sphinx/users-guide/storage-backends.rst b/doc/sphinx/users-guide/storage-backends.rst index 8591fb6c9..cd6201dc1 100644 --- a/doc/sphinx/users-guide/storage-backends.rst +++ b/doc/sphinx/users-guide/storage-backends.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _guide-storage: Storage backends diff --git a/doc/sphinx/users-guide/troubleshooting.rst b/doc/sphinx/users-guide/troubleshooting.rst index 46e5459fd..08af86fab 100644 --- a/doc/sphinx/users-guide/troubleshooting.rst +++ b/doc/sphinx/users-guide/troubleshooting.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users_trouble: Troubleshooting Varnish diff --git a/doc/sphinx/users-guide/vcl-actions.rst b/doc/sphinx/users-guide/vcl-actions.rst index 918c2b513..e4d0aae51 100644 --- a/doc/sphinx/users-guide/vcl-actions.rst +++ b/doc/sphinx/users-guide/vcl-actions.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _user-guide-vcl_actions: Actions diff --git a/doc/sphinx/users-guide/vcl-backends.rst b/doc/sphinx/users-guide/vcl-backends.rst index 65105f2af..c87d4bc88 100644 --- a/doc/sphinx/users-guide/vcl-backends.rst +++ b/doc/sphinx/users-guide/vcl-backends.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-backend_servers: Backend servers diff --git a/doc/sphinx/users-guide/vcl-built-in-subs.rst b/doc/sphinx/users-guide/vcl-built-in-subs.rst index bb3673687..6eb1095fa 100644 --- a/doc/sphinx/users-guide/vcl-built-in-subs.rst +++ b/doc/sphinx/users-guide/vcl-built-in-subs.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _vcl-built-in-subs: Built in subroutines diff --git a/doc/sphinx/users-guide/vcl-example-acls.rst b/doc/sphinx/users-guide/vcl-example-acls.rst index c76842f26..2a970f957 100644 --- a/doc/sphinx/users-guide/vcl-example-acls.rst +++ b/doc/sphinx/users-guide/vcl-example-acls.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + ACLs ~~~~ diff --git a/doc/sphinx/users-guide/vcl-example-manipulating-headers.rst b/doc/sphinx/users-guide/vcl-example-manipulating-headers.rst index 1ea81b17c..9cf26ba56 100644 --- a/doc/sphinx/users-guide/vcl-example-manipulating-headers.rst +++ b/doc/sphinx/users-guide/vcl-example-manipulating-headers.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + diff --git a/doc/sphinx/users-guide/vcl-example-manipulating-responses.rst b/doc/sphinx/users-guide/vcl-example-manipulating-responses.rst index 48a95556c..4b59f9bdc 100644 --- a/doc/sphinx/users-guide/vcl-example-manipulating-responses.rst +++ b/doc/sphinx/users-guide/vcl-example-manipulating-responses.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Altering the backend response diff --git a/doc/sphinx/users-guide/vcl-example-websockets.rst b/doc/sphinx/users-guide/vcl-example-websockets.rst index f4aed7082..f2b33ae96 100644 --- a/doc/sphinx/users-guide/vcl-example-websockets.rst +++ b/doc/sphinx/users-guide/vcl-example-websockets.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Adding WebSockets support ------------------------- diff --git a/doc/sphinx/users-guide/vcl-examples.rst b/doc/sphinx/users-guide/vcl-examples.rst index e3a948922..7a4ea5c86 100644 --- a/doc/sphinx/users-guide/vcl-examples.rst +++ b/doc/sphinx/users-guide/vcl-examples.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2014 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + VCL Examples ------------ diff --git a/doc/sphinx/users-guide/vcl-grace.rst b/doc/sphinx/users-guide/vcl-grace.rst index afaac2ce4..4a65e035a 100644 --- a/doc/sphinx/users-guide/vcl-grace.rst +++ b/doc/sphinx/users-guide/vcl-grace.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2014-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-handling_misbehaving_servers: Grace mode and keep diff --git a/doc/sphinx/users-guide/vcl-hashing.rst b/doc/sphinx/users-guide/vcl-hashing.rst index 5d960a6d0..a3bd1ab86 100644 --- a/doc/sphinx/users-guide/vcl-hashing.rst +++ b/doc/sphinx/users-guide/vcl-hashing.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Hashing ------- diff --git a/doc/sphinx/users-guide/vcl-inline-c.rst b/doc/sphinx/users-guide/vcl-inline-c.rst index d9748a32c..e4b7c4fe2 100644 --- a/doc/sphinx/users-guide/vcl-inline-c.rst +++ b/doc/sphinx/users-guide/vcl-inline-c.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2015 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + diff --git a/doc/sphinx/users-guide/vcl-separate.rst b/doc/sphinx/users-guide/vcl-separate.rst index a654fe9ed..0c6c675e7 100644 --- a/doc/sphinx/users-guide/vcl-separate.rst +++ b/doc/sphinx/users-guide/vcl-separate.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users-guide-separate_VCL: Separate VCL files diff --git a/doc/sphinx/users-guide/vcl-syntax.rst b/doc/sphinx/users-guide/vcl-syntax.rst index 73acf995f..291093b72 100644 --- a/doc/sphinx/users-guide/vcl-syntax.rst +++ b/doc/sphinx/users-guide/vcl-syntax.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + VCL Syntax ---------- diff --git a/doc/sphinx/users-guide/vcl-variables.rst b/doc/sphinx/users-guide/vcl-variables.rst index 1e0c832a1..f4df0f43a 100644 --- a/doc/sphinx/users-guide/vcl-variables.rst +++ b/doc/sphinx/users-guide/vcl-variables.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + Request and response VCL objects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/sphinx/users-guide/vcl.rst b/doc/sphinx/users-guide/vcl.rst index f38966b73..d34ad43e7 100644 --- a/doc/sphinx/users-guide/vcl.rst +++ b/doc/sphinx/users-guide/vcl.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2012-2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _users_vcl: diff --git a/doc/sphinx/whats-new/changes-4.1.rst b/doc/sphinx/whats-new/changes-4.1.rst index bbc8177c8..b5b4508f3 100644 --- a/doc/sphinx/whats-new/changes-4.1.rst +++ b/doc/sphinx/whats-new/changes-4.1.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_changes_4_1: Changes in Varnish 4.1 diff --git a/doc/sphinx/whats-new/changes-5.0.rst b/doc/sphinx/whats-new/changes-5.0.rst index 9d74be636..a078c32c4 100644 --- a/doc/sphinx/whats-new/changes-5.0.rst +++ b/doc/sphinx/whats-new/changes-5.0.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_changes_5.0: Changes in Varnish 5.0 diff --git a/doc/sphinx/whats-new/changes-5.1.rst b/doc/sphinx/whats-new/changes-5.1.rst index 654e4dc17..9d2c5cecb 100644 --- a/doc/sphinx/whats-new/changes-5.1.rst +++ b/doc/sphinx/whats-new/changes-5.1.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_changes_5.1: Changes in Varnish 5.1 diff --git a/doc/sphinx/whats-new/changes-5.2.rst b/doc/sphinx/whats-new/changes-5.2.rst index 6834325b1..ffd306271 100644 --- a/doc/sphinx/whats-new/changes-5.2.rst +++ b/doc/sphinx/whats-new/changes-5.2.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_changes_5.2: Changes in Varnish 5.2 diff --git a/doc/sphinx/whats-new/changes-6.0.rst b/doc/sphinx/whats-new/changes-6.0.rst index 41fd5052e..deb025964 100644 --- a/doc/sphinx/whats-new/changes-6.0.rst +++ b/doc/sphinx/whats-new/changes-6.0.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2018 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_changes_6.0: Changes in Varnish 6.0 diff --git a/doc/sphinx/whats-new/changes-6.1.rst b/doc/sphinx/whats-new/changes-6.1.rst index f9579b76c..e12aaffa1 100644 --- a/doc/sphinx/whats-new/changes-6.1.rst +++ b/doc/sphinx/whats-new/changes-6.1.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2018 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_changes_6.1: Changes in Varnish 6.1 diff --git a/doc/sphinx/whats-new/changes-6.2.rst b/doc/sphinx/whats-new/changes-6.2.rst index afebe2de5..90697fe18 100644 --- a/doc/sphinx/whats-new/changes-6.2.rst +++ b/doc/sphinx/whats-new/changes-6.2.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_changes_2019_03: %%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/changes-6.3.rst b/doc/sphinx/whats-new/changes-6.3.rst index d51b0789d..5c4eac672 100644 --- a/doc/sphinx/whats-new/changes-6.3.rst +++ b/doc/sphinx/whats-new/changes-6.3.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_changes_6.3: %%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/changes-6.4.rst b/doc/sphinx/whats-new/changes-6.4.rst index 4248847df..b4d388b5b 100644 --- a/doc/sphinx/whats-new/changes-6.4.rst +++ b/doc/sphinx/whats-new/changes-6.4.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_changes_6.4: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/changes-6.5.rst b/doc/sphinx/whats-new/changes-6.5.rst index 0dbe26afa..a09a5e0be 100644 --- a/doc/sphinx/whats-new/changes-6.5.rst +++ b/doc/sphinx/whats-new/changes-6.5.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_changes_6.5: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/index.rst b/doc/sphinx/whats-new/index.rst index 4c2e31a20..d04d542f6 100644 --- a/doc/sphinx/whats-new/index.rst +++ b/doc/sphinx/whats-new/index.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2013-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whats-new-index: %%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/relnote-5.0.rst b/doc/sphinx/whats-new/relnote-5.0.rst index 513f46dd7..631f2d9dd 100644 --- a/doc/sphinx/whats-new/relnote-5.0.rst +++ b/doc/sphinx/whats-new/relnote-5.0.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016-2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_relnote_5.0: Varnish 5.0 Release Note diff --git a/doc/sphinx/whats-new/upgrading-4.0.rst b/doc/sphinx/whats-new/upgrading-4.0.rst index eecd5b71d..2ab3a2da2 100644 --- a/doc/sphinx/whats-new/upgrading-4.0.rst +++ b/doc/sphinx/whats-new/upgrading-4.0.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_4_0: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/upgrading-4.1.rst b/doc/sphinx/whats-new/upgrading-4.1.rst index 9a78d29a5..47d9ceaf3 100644 --- a/doc/sphinx/whats-new/upgrading-4.1.rst +++ b/doc/sphinx/whats-new/upgrading-4.1.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_4_1: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/upgrading-5.0.rst b/doc/sphinx/whats-new/upgrading-5.0.rst index 095e72b5c..272257d7a 100644 --- a/doc/sphinx/whats-new/upgrading-5.0.rst +++ b/doc/sphinx/whats-new/upgrading-5.0.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2016 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_5.0: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/upgrading-5.1.rst b/doc/sphinx/whats-new/upgrading-5.1.rst index 9caba7e46..354e50934 100644 --- a/doc/sphinx/whats-new/upgrading-5.1.rst +++ b/doc/sphinx/whats-new/upgrading-5.1.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_5.1: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/upgrading-5.2.rst b/doc/sphinx/whats-new/upgrading-5.2.rst index d617ae1f9..09e90c73b 100644 --- a/doc/sphinx/whats-new/upgrading-5.2.rst +++ b/doc/sphinx/whats-new/upgrading-5.2.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_5.2: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/upgrading-6.0.rst b/doc/sphinx/whats-new/upgrading-6.0.rst index 4f9e3015d..bb4c0187c 100644 --- a/doc/sphinx/whats-new/upgrading-6.0.rst +++ b/doc/sphinx/whats-new/upgrading-6.0.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2018-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_6.0: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/upgrading-6.1.rst b/doc/sphinx/whats-new/upgrading-6.1.rst index a9d286536..429da5eb5 100644 --- a/doc/sphinx/whats-new/upgrading-6.1.rst +++ b/doc/sphinx/whats-new/upgrading-6.1.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2018-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_6.1: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/upgrading-6.2.rst b/doc/sphinx/whats-new/upgrading-6.2.rst index 12746c208..c5d92c54a 100644 --- a/doc/sphinx/whats-new/upgrading-6.2.rst +++ b/doc/sphinx/whats-new/upgrading-6.2.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_2019_03: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/upgrading-6.3.rst b/doc/sphinx/whats-new/upgrading-6.3.rst index fb9e90b73..4608bcf89 100644 --- a/doc/sphinx/whats-new/upgrading-6.3.rst +++ b/doc/sphinx/whats-new/upgrading-6.3.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_6.3: %%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/upgrading-6.4.rst b/doc/sphinx/whats-new/upgrading-6.4.rst index 2510044a2..e7d391d66 100644 --- a/doc/sphinx/whats-new/upgrading-6.4.rst +++ b/doc/sphinx/whats-new/upgrading-6.4.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_6.4: %%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/doc/sphinx/whats-new/upgrading-6.5.rst b/doc/sphinx/whats-new/upgrading-6.5.rst index 8d4d15951..12feae9f2 100644 --- a/doc/sphinx/whats-new/upgrading-6.5.rst +++ b/doc/sphinx/whats-new/upgrading-6.5.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. _whatsnew_upgrading_6.5: %%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/tools/coccinelle/README.rst b/tools/coccinelle/README.rst index e51e5741d..c689da1ab 100644 --- a/tools/coccinelle/README.rst +++ b/tools/coccinelle/README.rst @@ -1,3 +1,8 @@ +.. + Copyright (c) 2019-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + This directory contains `coccinelle`_ semantic patches to facilitate code maintenance. From phk at FreeBSD.org Wed Feb 24 13:00:10 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 24 Feb 2021 13:00:10 +0000 (UTC) Subject: [master] f614bf17d Merge branch 'master' of github.com:varnishcache/varnish-cache Message-ID: <20210224130010.291A710D49C@lists.varnish-cache.org> commit f614bf17d5f8757c971379cf04d25de7d56299a9 Merge: fe8cfe848 03f71c6e6 Author: Poul-Henning Kamp Date: Wed Feb 24 12:58:57 2021 +0000 Merge branch 'master' of github.com:varnishcache/varnish-cache From phk at FreeBSD.org Wed Feb 24 13:12:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 24 Feb 2021 13:12:07 +0000 (UTC) Subject: [master] b802d2a0d Stick license and SPDX on *.vsc files. Message-ID: <20210224131208.0D51710DC6D@lists.varnish-cache.org> commit b802d2a0d89a08e33ca760007319f21628c81191 Author: Poul-Henning Kamp Date: Wed Feb 24 13:10:47 2021 +0000 Stick license and SPDX on *.vsc files. diff --git a/bin/varnishd/VSC_lck.vsc b/bin/varnishd/VSC_lck.vsc index 0470964a5..8bfe07101 100644 --- a/bin/varnishd/VSC_lck.vsc +++ b/bin/varnishd/VSC_lck.vsc @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017-2019 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. This is *NOT* a RST file but the syntax has been chosen so that it may become an RST file at some later date. diff --git a/bin/varnishd/VSC_main.vsc b/bin/varnishd/VSC_main.vsc index b99ca8c2a..1113e5b4b 100644 --- a/bin/varnishd/VSC_main.vsc +++ b/bin/varnishd/VSC_main.vsc @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017-2020 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. This is *NOT* a RST file but the syntax has been chosen so that it may become an RST file at some later date. diff --git a/bin/varnishd/VSC_mempool.vsc b/bin/varnishd/VSC_mempool.vsc index 8c4724501..5309c243e 100644 --- a/bin/varnishd/VSC_mempool.vsc +++ b/bin/varnishd/VSC_mempool.vsc @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. This is *NOT* a RST file but the syntax has been chosen so that it may become an RST file at some later date. diff --git a/bin/varnishd/VSC_mgt.vsc b/bin/varnishd/VSC_mgt.vsc index c3ca8675d..18359a4c5 100644 --- a/bin/varnishd/VSC_mgt.vsc +++ b/bin/varnishd/VSC_mgt.vsc @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. This is *NOT* a RST file but the syntax has been chosen so that it may become an RST file at some later date. diff --git a/bin/varnishd/VSC_sma.vsc b/bin/varnishd/VSC_sma.vsc index d2ecc52e2..9b72eab76 100644 --- a/bin/varnishd/VSC_sma.vsc +++ b/bin/varnishd/VSC_sma.vsc @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. This is *NOT* a RST file but the syntax has been chosen so that it may become an RST file at some later date. diff --git a/bin/varnishd/VSC_smf.vsc b/bin/varnishd/VSC_smf.vsc index 4ec0dcc74..22a4a5998 100644 --- a/bin/varnishd/VSC_smf.vsc +++ b/bin/varnishd/VSC_smf.vsc @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. This is *NOT* a RST file but the syntax has been chosen so that it may become an RST file at some later date. diff --git a/bin/varnishd/VSC_smu.vsc b/bin/varnishd/VSC_smu.vsc index 89af32b46..4d10a51e2 100644 --- a/bin/varnishd/VSC_smu.vsc +++ b/bin/varnishd/VSC_smu.vsc @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. This is *NOT* a RST file but the syntax has been chosen so that it may become an RST file at some later date. diff --git a/bin/varnishd/VSC_vbe.vsc b/bin/varnishd/VSC_vbe.vsc index 52fa1806b..d041342f0 100644 --- a/bin/varnishd/VSC_vbe.vsc +++ b/bin/varnishd/VSC_vbe.vsc @@ -1,3 +1,8 @@ +.. + Copyright (c) 2017-2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + .. This is *NOT* a RST file but the syntax has been chosen so that it may become an RST file at some later date. diff --git a/vmod/VSC_debug.vsc b/vmod/VSC_debug.vsc index d6902ffdf..e4177de14 100644 --- a/vmod/VSC_debug.vsc +++ b/vmod/VSC_debug.vsc @@ -1,3 +1,8 @@ +.. + Copyright (c) 2021 Varnish Software AS + SPDX-License-Identifier: BSD-2-Clause + See LICENSE file for full text of licens + # .. varnish_vsc_begin:: debug :oneliner: Example Counters From phk at FreeBSD.org Wed Feb 24 13:18:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 24 Feb 2021 13:18:06 +0000 (UTC) Subject: [master] 846220250 Add Copyright & SPDX to .lnt files Message-ID: <20210224131806.D166F10E028@lists.varnish-cache.org> commit 846220250b5989d2f85d8a86f5878d9fefd9d33f Author: Poul-Henning Kamp Date: Wed Feb 24 13:16:16 2021 +0000 Add Copyright & SPDX to .lnt files diff --git a/bin/flint.lnt b/bin/flint.lnt index dadd62d66..e6cee798a 100644 --- a/bin/flint.lnt +++ b/bin/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2010-2017 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + -passes=3 -ffc // No automatic custody diff --git a/bin/varnishadm/flint.lnt b/bin/varnishadm/flint.lnt index c67ba85e3..440568de2 100644 --- a/bin/varnishadm/flint.lnt +++ b/bin/varnishadm/flint.lnt @@ -1 +1,5 @@ +// Copyright (c) 2017-2018 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + -sem(usage, r_no) diff --git a/bin/varnishd/flint.lnt b/bin/varnishd/flint.lnt index ffb48351c..8f04936be 100644 --- a/bin/varnishd/flint.lnt +++ b/bin/varnishd/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2006-2020 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + // -w4 /////////////////////////////////////////////////////////////////////// diff --git a/bin/varnishd/vclflint.lnt b/bin/varnishd/vclflint.lnt index de6aaab29..cc9feb042 100644 --- a/bin/varnishd/vclflint.lnt +++ b/bin/varnishd/vclflint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2007-2017 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + // Flexelint configuration file for VCL compiler output // diff --git a/bin/varnishhist/flint.lnt b/bin/varnishhist/flint.lnt index 6399b0249..c2702057f 100644 --- a/bin/varnishhist/flint.lnt +++ b/bin/varnishhist/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2017-2018 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + -efile(451, "varnishhist_profiles.h") -efile(451, "varnishhist_options.h") -sem(profile_error, r_no) diff --git a/bin/varnishlog/flint.lnt b/bin/varnishlog/flint.lnt index 509f2fe55..b922a299a 100644 --- a/bin/varnishlog/flint.lnt +++ b/bin/varnishlog/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2010-2018 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + -e712 // 14 Info 712 Loss of precision (___) (___ to ___) -e747 // 16 Info 747 Significant prototype coercion (___) ___ to ___ diff --git a/bin/varnishncsa/flint.lnt b/bin/varnishncsa/flint.lnt index 5270ff22b..f52151546 100644 --- a/bin/varnishncsa/flint.lnt +++ b/bin/varnishncsa/flint.lnt @@ -1,2 +1,6 @@ +// Copyright (c) 2006-2018 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + -efile(451, "varnishncsa_options.h") diff --git a/bin/varnishstat/flint.lnt b/bin/varnishstat/flint.lnt index e47f76850..764ed641e 100644 --- a/bin/varnishstat/flint.lnt +++ b/bin/varnishstat/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2010-2019 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + // +libh mgt_event.h diff --git a/bin/varnishtest/flint.lnt b/bin/varnishtest/flint.lnt index 6e392f2d6..3d087918f 100644 --- a/bin/varnishtest/flint.lnt +++ b/bin/varnishtest/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2008-2018 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + +libh(teken.h) diff --git a/bin/varnishtop/flint.lnt b/bin/varnishtop/flint.lnt index 20b82091e..41dadcc9f 100644 --- a/bin/varnishtop/flint.lnt +++ b/bin/varnishtop/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2010-2018 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + -efile(451, "varnishtop_options.h") -e712 // 14 Info 712 Loss of precision (___) (___ to ___) diff --git a/flint.lnt b/flint.lnt index b47a74bdb..4b527f423 100644 --- a/flint.lnt +++ b/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2013-2020 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + /* * Toplevel control file for FlexeLint */ diff --git a/lib/flint.lnt b/lib/flint.lnt index e69de29bb..65e8d0353 100644 --- a/lib/flint.lnt +++ b/lib/flint.lnt @@ -0,0 +1,4 @@ +// Copyright (c) 2017 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + diff --git a/lib/libvarnish/flint.lnt b/lib/libvarnish/flint.lnt index eaf3e61b5..4c41e5fee 100644 --- a/lib/libvarnish/flint.lnt +++ b/lib/libvarnish/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2008-2020 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + -efunc(835, VSHA256_Transform) // A zero has been given as ___ argument to operator '___' -efunc(778, VSHA256_Transform) // Constant expression evaluates to 0 in operation '___' -efunc(661, VSHA256_Transform) // Possible access of out-of-bounds pointer diff --git a/lib/libvarnishapi/flint.lnt b/lib/libvarnishapi/flint.lnt index f94af2f07..f66e32b8a 100644 --- a/lib/libvarnishapi/flint.lnt +++ b/lib/libvarnishapi/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2017 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + +fan -esym(759, VJSN_*) // could be moved hdr->mod diff --git a/lib/libvcc/flint.lnt b/lib/libvcc/flint.lnt index d419a731d..22852628c 100644 --- a/lib/libvcc/flint.lnt +++ b/lib/libvcc/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2013-2020 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + -sem(vcc_new_source, custodial(1)) diff --git a/vmod/flint.lnt b/vmod/flint.lnt index 5231099c7..cca94189a 100644 --- a/vmod/flint.lnt +++ b/vmod/flint.lnt @@ -1,3 +1,7 @@ +// Copyright (c) 2021 Varnish Software AS +// SPDX-License-Identifier: BSD-2-Clause +// See LICENSE file for full text of license + /* we always want config.h included even where not actually required */ -efile(766, config.h) From phk at FreeBSD.org Wed Feb 24 13:18:07 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 24 Feb 2021 13:18:07 +0000 (UTC) Subject: [master] 934398848 Eliminate Danglish spelling of 'licens[e]' Message-ID: <20210224131807.3005F10E02C@lists.varnish-cache.org> commit 934398848a20b846b6861be3843b3df17bce54d8 Author: Poul-Henning Kamp Date: Wed Feb 24 13:16:41 2021 +0000 Eliminate Danglish spelling of 'licens[e]' diff --git a/.circleci/README.rst b/.circleci/README.rst index fa541b43b..e19a6485e 100644 --- a/.circleci/README.rst +++ b/.circleci/README.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Multiarch building, testing & packaging ======================================= diff --git a/README.rst b/README.rst index 14f40f90a..20db8b20d 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Varnish Cache ============= diff --git a/bin/varnishd/VSC_lck.vsc b/bin/varnishd/VSC_lck.vsc index 8bfe07101..ee7ff64fd 100644 --- a/bin/varnishd/VSC_lck.vsc +++ b/bin/varnishd/VSC_lck.vsc @@ -1,7 +1,7 @@ .. Copyright (c) 2017-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. This is *NOT* a RST file but the syntax has been chosen so diff --git a/bin/varnishd/VSC_main.vsc b/bin/varnishd/VSC_main.vsc index 1113e5b4b..7b32584c9 100644 --- a/bin/varnishd/VSC_main.vsc +++ b/bin/varnishd/VSC_main.vsc @@ -1,7 +1,7 @@ .. Copyright (c) 2017-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. This is *NOT* a RST file but the syntax has been chosen so diff --git a/bin/varnishd/VSC_mempool.vsc b/bin/varnishd/VSC_mempool.vsc index 5309c243e..88c11032a 100644 --- a/bin/varnishd/VSC_mempool.vsc +++ b/bin/varnishd/VSC_mempool.vsc @@ -1,7 +1,7 @@ .. Copyright (c) 2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. This is *NOT* a RST file but the syntax has been chosen so diff --git a/bin/varnishd/VSC_mgt.vsc b/bin/varnishd/VSC_mgt.vsc index 18359a4c5..603b2b797 100644 --- a/bin/varnishd/VSC_mgt.vsc +++ b/bin/varnishd/VSC_mgt.vsc @@ -1,7 +1,7 @@ .. Copyright (c) 2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. This is *NOT* a RST file but the syntax has been chosen so diff --git a/bin/varnishd/VSC_sma.vsc b/bin/varnishd/VSC_sma.vsc index 9b72eab76..68d529358 100644 --- a/bin/varnishd/VSC_sma.vsc +++ b/bin/varnishd/VSC_sma.vsc @@ -1,7 +1,7 @@ .. Copyright (c) 2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. This is *NOT* a RST file but the syntax has been chosen so diff --git a/bin/varnishd/VSC_smf.vsc b/bin/varnishd/VSC_smf.vsc index 22a4a5998..c9f7e23e3 100644 --- a/bin/varnishd/VSC_smf.vsc +++ b/bin/varnishd/VSC_smf.vsc @@ -1,7 +1,7 @@ .. Copyright (c) 2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. This is *NOT* a RST file but the syntax has been chosen so diff --git a/bin/varnishd/VSC_smu.vsc b/bin/varnishd/VSC_smu.vsc index 4d10a51e2..bc51c9837 100644 --- a/bin/varnishd/VSC_smu.vsc +++ b/bin/varnishd/VSC_smu.vsc @@ -1,7 +1,7 @@ .. Copyright (c) 2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. This is *NOT* a RST file but the syntax has been chosen so diff --git a/bin/varnishd/VSC_vbe.vsc b/bin/varnishd/VSC_vbe.vsc index d041342f0..b23745192 100644 --- a/bin/varnishd/VSC_vbe.vsc +++ b/bin/varnishd/VSC_vbe.vsc @@ -1,7 +1,7 @@ .. Copyright (c) 2017-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. This is *NOT* a RST file but the syntax has been chosen so diff --git a/doc/README.WRITING_RST.rst b/doc/README.WRITING_RST.rst index a805be04a..f64cab47c 100644 --- a/doc/README.WRITING_RST.rst +++ b/doc/README.WRITING_RST.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2015-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license THINGS TO CONSIDER WHEN WRITING VARNISH RST DOCUMENTATION ========================================================= diff --git a/doc/changes.rst b/doc/changes.rst index f29961551..146ec9f60 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2011-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license =================== About this document diff --git a/doc/sphinx/dev-guide/homepage_contrib.rst b/doc/sphinx/dev-guide/homepage_contrib.rst index 1a34bfb88..6f095f5f0 100644 --- a/doc/sphinx/dev-guide/homepage_contrib.rst +++ b/doc/sphinx/dev-guide/homepage_contrib.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _homepage_contrib: diff --git a/doc/sphinx/dev-guide/homepage_dogfood.rst b/doc/sphinx/dev-guide/homepage_dogfood.rst index d317096bd..450e17d3e 100644 --- a/doc/sphinx/dev-guide/homepage_dogfood.rst +++ b/doc/sphinx/dev-guide/homepage_dogfood.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _homepage_dogfood: diff --git a/doc/sphinx/dev-guide/index.rst b/doc/sphinx/dev-guide/index.rst index c55984150..7c4158fa6 100644 --- a/doc/sphinx/dev-guide/index.rst +++ b/doc/sphinx/dev-guide/index.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _dev-guide-index: diff --git a/doc/sphinx/dev-guide/policy_vmods.rst b/doc/sphinx/dev-guide/policy_vmods.rst index 66066c67c..ee5575fc1 100644 --- a/doc/sphinx/dev-guide/policy_vmods.rst +++ b/doc/sphinx/dev-guide/policy_vmods.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _policy-vmods: diff --git a/doc/sphinx/dev-guide/who.rst b/doc/sphinx/dev-guide/who.rst index cc04bacdd..9e9ec67dd 100644 --- a/doc/sphinx/dev-guide/who.rst +++ b/doc/sphinx/dev-guide/who.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _who_is: diff --git a/doc/sphinx/glossary/index.rst b/doc/sphinx/glossary/index.rst index 7c0ce9dab..4dcf26467 100644 --- a/doc/sphinx/glossary/index.rst +++ b/doc/sphinx/glossary/index.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _glossary: diff --git a/doc/sphinx/index.rst b/doc/sphinx/index.rst index ce5a4077d..a017cf10a 100644 --- a/doc/sphinx/index.rst +++ b/doc/sphinx/index.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Varnish Documentation diff --git a/doc/sphinx/installation/bugs.rst b/doc/sphinx/installation/bugs.rst index 31eb0f0a8..0f41b03f7 100644 --- a/doc/sphinx/installation/bugs.rst +++ b/doc/sphinx/installation/bugs.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license %%%%%%%%%%%%%% Reporting bugs diff --git a/doc/sphinx/installation/cloud_debian.rst b/doc/sphinx/installation/cloud_debian.rst index 2a77cb34c..f9d8c2353 100644 --- a/doc/sphinx/installation/cloud_debian.rst +++ b/doc/sphinx/installation/cloud_debian.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _cloud-debian: diff --git a/doc/sphinx/installation/cloud_redhat.rst b/doc/sphinx/installation/cloud_redhat.rst index 0b8b66c91..8f2f95cf3 100644 --- a/doc/sphinx/installation/cloud_redhat.rst +++ b/doc/sphinx/installation/cloud_redhat.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _cloud-redhat: diff --git a/doc/sphinx/installation/cloud_ubuntu.rst b/doc/sphinx/installation/cloud_ubuntu.rst index 293f8c4f4..1df5beb12 100644 --- a/doc/sphinx/installation/cloud_ubuntu.rst +++ b/doc/sphinx/installation/cloud_ubuntu.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _cloud-ubuntu: diff --git a/doc/sphinx/installation/help.rst b/doc/sphinx/installation/help.rst index 73fa9dce1..82561143b 100644 --- a/doc/sphinx/installation/help.rst +++ b/doc/sphinx/installation/help.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license %%%%%%%%%%%% Getting help diff --git a/doc/sphinx/installation/index.rst b/doc/sphinx/installation/index.rst index ed77a10b8..254172ae8 100644 --- a/doc/sphinx/installation/index.rst +++ b/doc/sphinx/installation/index.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _install-index: diff --git a/doc/sphinx/installation/install.rst b/doc/sphinx/installation/install.rst index ff39d519f..5acb0cc59 100644 --- a/doc/sphinx/installation/install.rst +++ b/doc/sphinx/installation/install.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _install-doc: diff --git a/doc/sphinx/installation/install_debian.rst b/doc/sphinx/installation/install_debian.rst index f7ab55afe..f1e9549d2 100644 --- a/doc/sphinx/installation/install_debian.rst +++ b/doc/sphinx/installation/install_debian.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _install-debian: diff --git a/doc/sphinx/installation/install_freebsd.rst b/doc/sphinx/installation/install_freebsd.rst index a4da75645..531cf2471 100644 --- a/doc/sphinx/installation/install_freebsd.rst +++ b/doc/sphinx/installation/install_freebsd.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _install-freebsd: diff --git a/doc/sphinx/installation/install_openbsd.rst b/doc/sphinx/installation/install_openbsd.rst index 6548312aa..bbcf3c20e 100644 --- a/doc/sphinx/installation/install_openbsd.rst +++ b/doc/sphinx/installation/install_openbsd.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _install-openbsd: diff --git a/doc/sphinx/installation/install_redhat.rst b/doc/sphinx/installation/install_redhat.rst index 4bd7222c4..2baaaeb34 100644 --- a/doc/sphinx/installation/install_redhat.rst +++ b/doc/sphinx/installation/install_redhat.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _install-redhat: diff --git a/doc/sphinx/installation/install_source.rst b/doc/sphinx/installation/install_source.rst index ba778b68a..ef67e00b3 100644 --- a/doc/sphinx/installation/install_source.rst +++ b/doc/sphinx/installation/install_source.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _install-src: diff --git a/doc/sphinx/installation/platformnotes.rst b/doc/sphinx/installation/platformnotes.rst index 38f20e4ae..494e4eb9d 100644 --- a/doc/sphinx/installation/platformnotes.rst +++ b/doc/sphinx/installation/platformnotes.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Platform specific notes diff --git a/doc/sphinx/installation/prerequisites.rst b/doc/sphinx/installation/prerequisites.rst index 7e47ba045..ed3e4768b 100644 --- a/doc/sphinx/installation/prerequisites.rst +++ b/doc/sphinx/installation/prerequisites.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2014 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Prerequisites ============= diff --git a/doc/sphinx/phk/10goingon50.rst b/doc/sphinx/phk/10goingon50.rst index 24624bc9a..bed42a48b 100644 --- a/doc/sphinx/phk/10goingon50.rst +++ b/doc/sphinx/phk/10goingon50.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_10goingon50: diff --git a/doc/sphinx/phk/VSV00001.rst b/doc/sphinx/phk/VSV00001.rst index 225f300cd..0032b4fc2 100644 --- a/doc/sphinx/phk/VSV00001.rst +++ b/doc/sphinx/phk/VSV00001.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_vsv00001: diff --git a/doc/sphinx/phk/VSV00003.rst b/doc/sphinx/phk/VSV00003.rst index e0dac03a7..f899cd98e 100644 --- a/doc/sphinx/phk/VSV00003.rst +++ b/doc/sphinx/phk/VSV00003.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_vsv00003: diff --git a/doc/sphinx/phk/apispaces.rst b/doc/sphinx/phk/apispaces.rst index acda64b6b..e71eb2928 100644 --- a/doc/sphinx/phk/apispaces.rst +++ b/doc/sphinx/phk/apispaces.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_api_spaces: diff --git a/doc/sphinx/phk/autocrap.rst b/doc/sphinx/phk/autocrap.rst index 0d2535d14..baaa3c7a3 100644 --- a/doc/sphinx/phk/autocrap.rst +++ b/doc/sphinx/phk/autocrap.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_autocrap: diff --git a/doc/sphinx/phk/backends.rst b/doc/sphinx/phk/backends.rst index a8a1fd089..709093eb6 100644 --- a/doc/sphinx/phk/backends.rst +++ b/doc/sphinx/phk/backends.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_backends: diff --git a/doc/sphinx/phk/barriers.rst b/doc/sphinx/phk/barriers.rst index ccce898f8..cc2728b92 100644 --- a/doc/sphinx/phk/barriers.rst +++ b/doc/sphinx/phk/barriers.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_barriers: diff --git a/doc/sphinx/phk/brinch-hansens-arrows.rst b/doc/sphinx/phk/brinch-hansens-arrows.rst index e7e20d05b..8a79458d1 100644 --- a/doc/sphinx/phk/brinch-hansens-arrows.rst +++ b/doc/sphinx/phk/brinch-hansens-arrows.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_brinch_hansens_arrows: diff --git a/doc/sphinx/phk/dough.rst b/doc/sphinx/phk/dough.rst index fa5b8c62e..512347842 100644 --- a/doc/sphinx/phk/dough.rst +++ b/doc/sphinx/phk/dough.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2014-2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_dough: diff --git a/doc/sphinx/phk/farfaraway.rst b/doc/sphinx/phk/farfaraway.rst index 18c90bf2b..a49185053 100644 --- a/doc/sphinx/phk/farfaraway.rst +++ b/doc/sphinx/phk/farfaraway.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_farfaraway: diff --git a/doc/sphinx/phk/firstdesign.rst b/doc/sphinx/phk/firstdesign.rst index 3eedaa17f..55d9811fa 100644 --- a/doc/sphinx/phk/firstdesign.rst +++ b/doc/sphinx/phk/firstdesign.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016-2018 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_firstdesign: diff --git a/doc/sphinx/phk/gzip.rst b/doc/sphinx/phk/gzip.rst index 929ece18b..61c4e19b0 100644 --- a/doc/sphinx/phk/gzip.rst +++ b/doc/sphinx/phk/gzip.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2011-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_gzip: diff --git a/doc/sphinx/phk/http20.rst b/doc/sphinx/phk/http20.rst index a3d597310..371a0180e 100644 --- a/doc/sphinx/phk/http20.rst +++ b/doc/sphinx/phk/http20.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_http20_lack_of_interest: diff --git a/doc/sphinx/phk/index.rst b/doc/sphinx/phk/index.rst index 6b3357b59..2b358a031 100644 --- a/doc/sphinx/phk/index.rst +++ b/doc/sphinx/phk/index.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk: diff --git a/doc/sphinx/phk/ipv6suckage.rst b/doc/sphinx/phk/ipv6suckage.rst index bd92c96b5..cf77f299e 100644 --- a/doc/sphinx/phk/ipv6suckage.rst +++ b/doc/sphinx/phk/ipv6suckage.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2011 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_ipv6suckage: diff --git a/doc/sphinx/phk/lucky.rst b/doc/sphinx/phk/lucky.rst index 434768488..b11febdac 100644 --- a/doc/sphinx/phk/lucky.rst +++ b/doc/sphinx/phk/lucky.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_lucky: diff --git a/doc/sphinx/phk/notes.rst b/doc/sphinx/phk/notes.rst index 61c3a0a8d..b663096fb 100644 --- a/doc/sphinx/phk/notes.rst +++ b/doc/sphinx/phk/notes.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_notes: diff --git a/doc/sphinx/phk/patent.rst b/doc/sphinx/phk/patent.rst index dc3cf0e46..b90847ff2 100644 --- a/doc/sphinx/phk/patent.rst +++ b/doc/sphinx/phk/patent.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_patent: diff --git a/doc/sphinx/phk/persistent.rst b/doc/sphinx/phk/persistent.rst index 01164e2dc..301cd2d64 100644 --- a/doc/sphinx/phk/persistent.rst +++ b/doc/sphinx/phk/persistent.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2014-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_persistent: diff --git a/doc/sphinx/phk/platforms.rst b/doc/sphinx/phk/platforms.rst index 643780fe7..a83528bfa 100644 --- a/doc/sphinx/phk/platforms.rst +++ b/doc/sphinx/phk/platforms.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_platforms: diff --git a/doc/sphinx/phk/quic.rst b/doc/sphinx/phk/quic.rst index 25ca1ec44..6d3074bd0 100644 --- a/doc/sphinx/phk/quic.rst +++ b/doc/sphinx/phk/quic.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_quick_osi: diff --git a/doc/sphinx/phk/somethinghappened.rst b/doc/sphinx/phk/somethinghappened.rst index 384a92164..a8391bd51 100644 --- a/doc/sphinx/phk/somethinghappened.rst +++ b/doc/sphinx/phk/somethinghappened.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_somethinghappened: diff --git a/doc/sphinx/phk/spdy.rst b/doc/sphinx/phk/spdy.rst index bba6a24a0..4cf9db228 100644 --- a/doc/sphinx/phk/spdy.rst +++ b/doc/sphinx/phk/spdy.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_spdy: diff --git a/doc/sphinx/phk/sphinx.rst b/doc/sphinx/phk/sphinx.rst index e4083a9b2..68e6b19de 100644 --- a/doc/sphinx/phk/sphinx.rst +++ b/doc/sphinx/phk/sphinx.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_sphinx: diff --git a/doc/sphinx/phk/ssl.rst b/doc/sphinx/phk/ssl.rst index 285d72197..b38d9847e 100644 --- a/doc/sphinx/phk/ssl.rst +++ b/doc/sphinx/phk/ssl.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2011-2014 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_ssl: diff --git a/doc/sphinx/phk/ssl_again.rst b/doc/sphinx/phk/ssl_again.rst index edf3c1c63..8e7b66b46 100644 --- a/doc/sphinx/phk/ssl_again.rst +++ b/doc/sphinx/phk/ssl_again.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2015-2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_ssl_again: diff --git a/doc/sphinx/phk/thatslow.rst b/doc/sphinx/phk/thatslow.rst index e5bd92a8b..7db085029 100644 --- a/doc/sphinx/phk/thatslow.rst +++ b/doc/sphinx/phk/thatslow.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_that_slow: diff --git a/doc/sphinx/phk/thetoolsweworkwith.rst b/doc/sphinx/phk/thetoolsweworkwith.rst index 536c719c8..60ccddff3 100644 --- a/doc/sphinx/phk/thetoolsweworkwith.rst +++ b/doc/sphinx/phk/thetoolsweworkwith.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2011-2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_thetoolsweworkwith: diff --git a/doc/sphinx/phk/thoughts.rst b/doc/sphinx/phk/thoughts.rst index b8f95ecdd..80683f9ce 100644 --- a/doc/sphinx/phk/thoughts.rst +++ b/doc/sphinx/phk/thoughts.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_thoughts: diff --git a/doc/sphinx/phk/three-zero.rst b/doc/sphinx/phk/three-zero.rst index 4c5902909..ca9fbfca9 100644 --- a/doc/sphinx/phk/three-zero.rst +++ b/doc/sphinx/phk/three-zero.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2011-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_3.0: diff --git a/doc/sphinx/phk/trialerror.rst b/doc/sphinx/phk/trialerror.rst index 79be80e70..690384e39 100644 --- a/doc/sphinx/phk/trialerror.rst +++ b/doc/sphinx/phk/trialerror.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016-2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_trialerror: diff --git a/doc/sphinx/phk/varnish_does_not_hash.rst b/doc/sphinx/phk/varnish_does_not_hash.rst index 832d67c95..6b35da166 100644 --- a/doc/sphinx/phk/varnish_does_not_hash.rst +++ b/doc/sphinx/phk/varnish_does_not_hash.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2013 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_varnish_does_not_hash: diff --git a/doc/sphinx/phk/vcl_expr.rst b/doc/sphinx/phk/vcl_expr.rst index 3a7028388..e2b18e9c8 100644 --- a/doc/sphinx/phk/vcl_expr.rst +++ b/doc/sphinx/phk/vcl_expr.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_vcl_expr: diff --git a/doc/sphinx/phk/vdd19q3.rst b/doc/sphinx/phk/vdd19q3.rst index 170460e54..b77832d85 100644 --- a/doc/sphinx/phk/vdd19q3.rst +++ b/doc/sphinx/phk/vdd19q3.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _vdd19q3: diff --git a/doc/sphinx/phk/wanton_destruction.rst b/doc/sphinx/phk/wanton_destruction.rst index 511e974ee..1bbf5779c 100644 --- a/doc/sphinx/phk/wanton_destruction.rst +++ b/doc/sphinx/phk/wanton_destruction.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _phk_wanton: diff --git a/doc/sphinx/reference/cli_protocol.rst b/doc/sphinx/reference/cli_protocol.rst index ff9e7d7d8..a99cb20e9 100644 --- a/doc/sphinx/reference/cli_protocol.rst +++ b/doc/sphinx/reference/cli_protocol.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/directors.rst b/doc/sphinx/reference/directors.rst index 8f9b82bdf..66c0f406c 100644 --- a/doc/sphinx/reference/directors.rst +++ b/doc/sphinx/reference/directors.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2015-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _ref-writing-a-director: diff --git a/doc/sphinx/reference/dp_vcl_recv_hash.rst b/doc/sphinx/reference/dp_vcl_recv_hash.rst index a3a548f92..e63607e1e 100644 --- a/doc/sphinx/reference/dp_vcl_recv_hash.rst +++ b/doc/sphinx/reference/dp_vcl_recv_hash.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _db_vcl_recv_hash: diff --git a/doc/sphinx/reference/dp_vcl_resp_status.rst b/doc/sphinx/reference/dp_vcl_resp_status.rst index 90415f4f1..00a98d7df 100644 --- a/doc/sphinx/reference/dp_vcl_resp_status.rst +++ b/doc/sphinx/reference/dp_vcl_resp_status.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _dp_vcl_resp_status: diff --git a/doc/sphinx/reference/index.rst b/doc/sphinx/reference/index.rst index 830541c04..11fe4737c 100644 --- a/doc/sphinx/reference/index.rst +++ b/doc/sphinx/reference/index.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _reference-index: diff --git a/doc/sphinx/reference/shell_tricks.rst b/doc/sphinx/reference/shell_tricks.rst index 35622abb3..065d8ac3c 100644 --- a/doc/sphinx/reference/shell_tricks.rst +++ b/doc/sphinx/reference/shell_tricks.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _ref-shell_tricks: diff --git a/doc/sphinx/reference/states.rst b/doc/sphinx/reference/states.rst index 4bc0910ba..b816c25d7 100644 --- a/doc/sphinx/reference/states.rst +++ b/doc/sphinx/reference/states.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2014-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _reference-states: diff --git a/doc/sphinx/reference/varnish-cli.rst b/doc/sphinx/reference/varnish-cli.rst index 58809d56f..80f9145d3 100644 --- a/doc/sphinx/reference/varnish-cli.rst +++ b/doc/sphinx/reference/varnish-cli.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2011-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/varnish-counters.rst b/doc/sphinx/reference/varnish-counters.rst index e6caebba2..461ff301d 100644 --- a/doc/sphinx/reference/varnish-counters.rst +++ b/doc/sphinx/reference/varnish-counters.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _varnish-counters(7): diff --git a/doc/sphinx/reference/varnishadm.rst b/doc/sphinx/reference/varnishadm.rst index 5214b3477..a0bb09c64 100644 --- a/doc/sphinx/reference/varnishadm.rst +++ b/doc/sphinx/reference/varnishadm.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/varnishd.rst b/doc/sphinx/reference/varnishd.rst index fca58cad0..f8088b90e 100644 --- a/doc/sphinx/reference/varnishd.rst +++ b/doc/sphinx/reference/varnishd.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/varnishhist.rst b/doc/sphinx/reference/varnishhist.rst index d02080a24..2055fee69 100644 --- a/doc/sphinx/reference/varnishhist.rst +++ b/doc/sphinx/reference/varnishhist.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/varnishlog.rst b/doc/sphinx/reference/varnishlog.rst index 55df8a2a2..345142375 100644 --- a/doc/sphinx/reference/varnishlog.rst +++ b/doc/sphinx/reference/varnishlog.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/varnishncsa.rst b/doc/sphinx/reference/varnishncsa.rst index 6cb30e3e0..489690866 100644 --- a/doc/sphinx/reference/varnishncsa.rst +++ b/doc/sphinx/reference/varnishncsa.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/varnishstat.rst b/doc/sphinx/reference/varnishstat.rst index 1ff603831..b475c8383 100644 --- a/doc/sphinx/reference/varnishstat.rst +++ b/doc/sphinx/reference/varnishstat.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/varnishtest.rst b/doc/sphinx/reference/varnishtest.rst index baaa6c288..d7c9d79fe 100644 --- a/doc/sphinx/reference/varnishtest.rst +++ b/doc/sphinx/reference/varnishtest.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/varnishtop.rst b/doc/sphinx/reference/varnishtop.rst index a8eeddab9..d08998164 100644 --- a/doc/sphinx/reference/varnishtop.rst +++ b/doc/sphinx/reference/varnishtop.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/vcl-backend.rst b/doc/sphinx/reference/vcl-backend.rst index dfd2296c6..4dea4dfa4 100644 --- a/doc/sphinx/reference/vcl-backend.rst +++ b/doc/sphinx/reference/vcl-backend.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/vcl-probe.rst b/doc/sphinx/reference/vcl-probe.rst index 01bea5a92..569c83566 100644 --- a/doc/sphinx/reference/vcl-probe.rst +++ b/doc/sphinx/reference/vcl-probe.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/vcl-var.rst b/doc/sphinx/reference/vcl-var.rst index e05f6c74c..150f6b103 100644 --- a/doc/sphinx/reference/vcl-var.rst +++ b/doc/sphinx/reference/vcl-var.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst index 186b75e86..02e2a64df 100644 --- a/doc/sphinx/reference/vcl.rst +++ b/doc/sphinx/reference/vcl.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/vcl_var.rst b/doc/sphinx/reference/vcl_var.rst index 5b7a4a1b5..e1a673ec9 100644 --- a/doc/sphinx/reference/vcl_var.rst +++ b/doc/sphinx/reference/vcl_var.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2018-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _vcl_variables: diff --git a/doc/sphinx/reference/vmod.rst b/doc/sphinx/reference/vmod.rst index 26aa38b01..1e3a2b422 100644 --- a/doc/sphinx/reference/vmod.rst +++ b/doc/sphinx/reference/vmod.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _ref-vmod: diff --git a/doc/sphinx/reference/vmod_blob.rst b/doc/sphinx/reference/vmod_blob.rst index 48e4f1ffc..931159827 100644 --- a/doc/sphinx/reference/vmod_blob.rst +++ b/doc/sphinx/reference/vmod_blob.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. include:: ../include/vmod_blob.generated.rst diff --git a/doc/sphinx/reference/vmod_cookie.rst b/doc/sphinx/reference/vmod_cookie.rst index fb48ee45b..582818150 100644 --- a/doc/sphinx/reference/vmod_cookie.rst +++ b/doc/sphinx/reference/vmod_cookie.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. include:: ../include/vmod_cookie.generated.rst diff --git a/doc/sphinx/reference/vmod_directors.rst b/doc/sphinx/reference/vmod_directors.rst index a1badfe96..7afc49fb9 100644 --- a/doc/sphinx/reference/vmod_directors.rst +++ b/doc/sphinx/reference/vmod_directors.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. include:: ../include/vmod_directors.generated.rst diff --git a/doc/sphinx/reference/vmod_proxy.rst b/doc/sphinx/reference/vmod_proxy.rst index fc78f8d23..efdf17402 100644 --- a/doc/sphinx/reference/vmod_proxy.rst +++ b/doc/sphinx/reference/vmod_proxy.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. include:: ../include/vmod_proxy.generated.rst diff --git a/doc/sphinx/reference/vmod_purge.rst b/doc/sphinx/reference/vmod_purge.rst index 0bd1738c2..0adf42903 100644 --- a/doc/sphinx/reference/vmod_purge.rst +++ b/doc/sphinx/reference/vmod_purge.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. include:: ../include/vmod_purge.generated.rst diff --git a/doc/sphinx/reference/vmod_std.rst b/doc/sphinx/reference/vmod_std.rst index 4c3571306..12a62ad08 100644 --- a/doc/sphinx/reference/vmod_std.rst +++ b/doc/sphinx/reference/vmod_std.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2011-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. include:: ../include/vmod_std.generated.rst diff --git a/doc/sphinx/reference/vmod_unix.rst b/doc/sphinx/reference/vmod_unix.rst index d31030813..f2e4e9a7d 100644 --- a/doc/sphinx/reference/vmod_unix.rst +++ b/doc/sphinx/reference/vmod_unix.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. include:: ../include/vmod_unix.generated.rst diff --git a/doc/sphinx/reference/vmod_vtc.rst b/doc/sphinx/reference/vmod_vtc.rst index ab76009c8..9273e2a1d 100644 --- a/doc/sphinx/reference/vmod_vtc.rst +++ b/doc/sphinx/reference/vmod_vtc.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. include:: ../include/vmod_vtc.generated.rst diff --git a/doc/sphinx/reference/vsl-query.rst b/doc/sphinx/reference/vsl-query.rst index 7c06dccca..e7778c186 100644 --- a/doc/sphinx/reference/vsl-query.rst +++ b/doc/sphinx/reference/vsl-query.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/vsl.rst b/doc/sphinx/reference/vsl.rst index 17074a633..cf63089db 100644 --- a/doc/sphinx/reference/vsl.rst +++ b/doc/sphinx/reference/vsl.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2011-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/vsm.rst b/doc/sphinx/reference/vsm.rst index 63bb8c758..13671045e 100644 --- a/doc/sphinx/reference/vsm.rst +++ b/doc/sphinx/reference/vsm.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2011-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% VSM: Shared Memory Logging and Statistics diff --git a/doc/sphinx/reference/vtc.rst b/doc/sphinx/reference/vtc.rst index 761eee323..e88b44305 100644 --- a/doc/sphinx/reference/vtc.rst +++ b/doc/sphinx/reference/vtc.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016-2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/reference/vtla.rst b/doc/sphinx/reference/vtla.rst index 571b2e297..0a6b04543 100644 --- a/doc/sphinx/reference/vtla.rst +++ b/doc/sphinx/reference/vtla.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. role:: ref(emphasis) diff --git a/doc/sphinx/tutorial/backend_servers.rst b/doc/sphinx/tutorial/backend_servers.rst index e29adab77..f7b84ac17 100644 --- a/doc/sphinx/tutorial/backend_servers.rst +++ b/doc/sphinx/tutorial/backend_servers.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _tutorial-backend_servers: diff --git a/doc/sphinx/tutorial/index.rst b/doc/sphinx/tutorial/index.rst index e9e710354..d998fb52d 100644 --- a/doc/sphinx/tutorial/index.rst +++ b/doc/sphinx/tutorial/index.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2014 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _tutorial-index: diff --git a/doc/sphinx/tutorial/introduction.rst b/doc/sphinx/tutorial/introduction.rst index cf38febfb..f300b4488 100644 --- a/doc/sphinx/tutorial/introduction.rst +++ b/doc/sphinx/tutorial/introduction.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _tutorial-intro: diff --git a/doc/sphinx/tutorial/now_what.rst b/doc/sphinx/tutorial/now_what.rst index a9e12299d..4f9db619c 100644 --- a/doc/sphinx/tutorial/now_what.rst +++ b/doc/sphinx/tutorial/now_what.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2014 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license diff --git a/doc/sphinx/tutorial/peculiarities.rst b/doc/sphinx/tutorial/peculiarities.rst index f5b01b7a9..8327c29ec 100644 --- a/doc/sphinx/tutorial/peculiarities.rst +++ b/doc/sphinx/tutorial/peculiarities.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Peculiarities diff --git a/doc/sphinx/tutorial/putting_varnish_on_port_80.rst b/doc/sphinx/tutorial/putting_varnish_on_port_80.rst index c899a9fe4..79f410b82 100644 --- a/doc/sphinx/tutorial/putting_varnish_on_port_80.rst +++ b/doc/sphinx/tutorial/putting_varnish_on_port_80.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Put Varnish on port 80 diff --git a/doc/sphinx/tutorial/starting_varnish.rst b/doc/sphinx/tutorial/starting_varnish.rst index a08451f0e..9aa5aeb86 100644 --- a/doc/sphinx/tutorial/starting_varnish.rst +++ b/doc/sphinx/tutorial/starting_varnish.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2010-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _tutorial-starting_varnish: diff --git a/doc/sphinx/users-guide/command-line.rst b/doc/sphinx/users-guide/command-line.rst index af80bc538..97f79b88b 100644 --- a/doc/sphinx/users-guide/command-line.rst +++ b/doc/sphinx/users-guide/command-line.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-command-line: diff --git a/doc/sphinx/users-guide/compression.rst b/doc/sphinx/users-guide/compression.rst index ed7f2efe9..3aca6f116 100644 --- a/doc/sphinx/users-guide/compression.rst +++ b/doc/sphinx/users-guide/compression.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-compression: diff --git a/doc/sphinx/users-guide/devicedetection.rst b/doc/sphinx/users-guide/devicedetection.rst index acac51cd9..7ae7ccc55 100644 --- a/doc/sphinx/users-guide/devicedetection.rst +++ b/doc/sphinx/users-guide/devicedetection.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-devicedetect: diff --git a/doc/sphinx/users-guide/esi.rst b/doc/sphinx/users-guide/esi.rst index a75864ce4..890b583d6 100644 --- a/doc/sphinx/users-guide/esi.rst +++ b/doc/sphinx/users-guide/esi.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-esi: diff --git a/doc/sphinx/users-guide/increasing-your-hitrate.rst b/doc/sphinx/users-guide/increasing-your-hitrate.rst index a36ff3d7a..10f4c47fb 100644 --- a/doc/sphinx/users-guide/increasing-your-hitrate.rst +++ b/doc/sphinx/users-guide/increasing-your-hitrate.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-increasing_your_hitrate: diff --git a/doc/sphinx/users-guide/index.rst b/doc/sphinx/users-guide/index.rst index 28602fff7..c399a5dd3 100644 --- a/doc/sphinx/users-guide/index.rst +++ b/doc/sphinx/users-guide/index.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-index: diff --git a/doc/sphinx/users-guide/intro.rst b/doc/sphinx/users-guide/intro.rst index 04d95c78f..735571d3c 100644 --- a/doc/sphinx/users-guide/intro.rst +++ b/doc/sphinx/users-guide/intro.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users_intro: diff --git a/doc/sphinx/users-guide/operation-logging.rst b/doc/sphinx/users-guide/operation-logging.rst index b37009c54..49854b93d 100644 --- a/doc/sphinx/users-guide/operation-logging.rst +++ b/doc/sphinx/users-guide/operation-logging.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-logging: diff --git a/doc/sphinx/users-guide/operation-statistics.rst b/doc/sphinx/users-guide/operation-statistics.rst index 92796c848..029b59681 100644 --- a/doc/sphinx/users-guide/operation-statistics.rst +++ b/doc/sphinx/users-guide/operation-statistics.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-statistics: diff --git a/doc/sphinx/users-guide/params.rst b/doc/sphinx/users-guide/params.rst index f4b64fe58..2d7e85b49 100644 --- a/doc/sphinx/users-guide/params.rst +++ b/doc/sphinx/users-guide/params.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license diff --git a/doc/sphinx/users-guide/performance.rst b/doc/sphinx/users-guide/performance.rst index a85c566c9..1b5ed440a 100644 --- a/doc/sphinx/users-guide/performance.rst +++ b/doc/sphinx/users-guide/performance.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users_performance: diff --git a/doc/sphinx/users-guide/purging.rst b/doc/sphinx/users-guide/purging.rst index 8a82dd2f4..4ca4eae30 100644 --- a/doc/sphinx/users-guide/purging.rst +++ b/doc/sphinx/users-guide/purging.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-purging: diff --git a/doc/sphinx/users-guide/report.rst b/doc/sphinx/users-guide/report.rst index 2349b935d..37239e2e6 100644 --- a/doc/sphinx/users-guide/report.rst +++ b/doc/sphinx/users-guide/report.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2014 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users_report: diff --git a/doc/sphinx/users-guide/run_cli.rst b/doc/sphinx/users-guide/run_cli.rst index a9e25123b..9ac130311 100644 --- a/doc/sphinx/users-guide/run_cli.rst +++ b/doc/sphinx/users-guide/run_cli.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _run_cli: diff --git a/doc/sphinx/users-guide/run_security.rst b/doc/sphinx/users-guide/run_security.rst index bd51f7b89..7265b1a7f 100644 --- a/doc/sphinx/users-guide/run_security.rst +++ b/doc/sphinx/users-guide/run_security.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _run_security: diff --git a/doc/sphinx/users-guide/running.rst b/doc/sphinx/users-guide/running.rst index 310e9043d..3d346a2dd 100644 --- a/doc/sphinx/users-guide/running.rst +++ b/doc/sphinx/users-guide/running.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2014 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users_running: diff --git a/doc/sphinx/users-guide/sizing-your-cache.rst b/doc/sphinx/users-guide/sizing-your-cache.rst index 3884f776f..20189474c 100644 --- a/doc/sphinx/users-guide/sizing-your-cache.rst +++ b/doc/sphinx/users-guide/sizing-your-cache.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Sizing your cache diff --git a/doc/sphinx/users-guide/storage-backends.rst b/doc/sphinx/users-guide/storage-backends.rst index cd6201dc1..7464c74fc 100644 --- a/doc/sphinx/users-guide/storage-backends.rst +++ b/doc/sphinx/users-guide/storage-backends.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _guide-storage: diff --git a/doc/sphinx/users-guide/troubleshooting.rst b/doc/sphinx/users-guide/troubleshooting.rst index 08af86fab..938cbf5c7 100644 --- a/doc/sphinx/users-guide/troubleshooting.rst +++ b/doc/sphinx/users-guide/troubleshooting.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users_trouble: diff --git a/doc/sphinx/users-guide/vcl-actions.rst b/doc/sphinx/users-guide/vcl-actions.rst index e4d0aae51..5eb13c799 100644 --- a/doc/sphinx/users-guide/vcl-actions.rst +++ b/doc/sphinx/users-guide/vcl-actions.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _user-guide-vcl_actions: diff --git a/doc/sphinx/users-guide/vcl-backends.rst b/doc/sphinx/users-guide/vcl-backends.rst index c87d4bc88..f6d7bcb09 100644 --- a/doc/sphinx/users-guide/vcl-backends.rst +++ b/doc/sphinx/users-guide/vcl-backends.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-backend_servers: diff --git a/doc/sphinx/users-guide/vcl-built-in-subs.rst b/doc/sphinx/users-guide/vcl-built-in-subs.rst index 6eb1095fa..3c0990910 100644 --- a/doc/sphinx/users-guide/vcl-built-in-subs.rst +++ b/doc/sphinx/users-guide/vcl-built-in-subs.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _vcl-built-in-subs: diff --git a/doc/sphinx/users-guide/vcl-example-acls.rst b/doc/sphinx/users-guide/vcl-example-acls.rst index 2a970f957..3699ac003 100644 --- a/doc/sphinx/users-guide/vcl-example-acls.rst +++ b/doc/sphinx/users-guide/vcl-example-acls.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license ACLs diff --git a/doc/sphinx/users-guide/vcl-example-manipulating-headers.rst b/doc/sphinx/users-guide/vcl-example-manipulating-headers.rst index 9cf26ba56..f6967e19e 100644 --- a/doc/sphinx/users-guide/vcl-example-manipulating-headers.rst +++ b/doc/sphinx/users-guide/vcl-example-manipulating-headers.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license diff --git a/doc/sphinx/users-guide/vcl-example-manipulating-responses.rst b/doc/sphinx/users-guide/vcl-example-manipulating-responses.rst index 4b59f9bdc..8edf0d193 100644 --- a/doc/sphinx/users-guide/vcl-example-manipulating-responses.rst +++ b/doc/sphinx/users-guide/vcl-example-manipulating-responses.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license diff --git a/doc/sphinx/users-guide/vcl-example-websockets.rst b/doc/sphinx/users-guide/vcl-example-websockets.rst index f2b33ae96..05fa54337 100644 --- a/doc/sphinx/users-guide/vcl-example-websockets.rst +++ b/doc/sphinx/users-guide/vcl-example-websockets.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Adding WebSockets support diff --git a/doc/sphinx/users-guide/vcl-examples.rst b/doc/sphinx/users-guide/vcl-examples.rst index 7a4ea5c86..210ac5463 100644 --- a/doc/sphinx/users-guide/vcl-examples.rst +++ b/doc/sphinx/users-guide/vcl-examples.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2014 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license VCL Examples diff --git a/doc/sphinx/users-guide/vcl-grace.rst b/doc/sphinx/users-guide/vcl-grace.rst index 4a65e035a..3198a6bf1 100644 --- a/doc/sphinx/users-guide/vcl-grace.rst +++ b/doc/sphinx/users-guide/vcl-grace.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2014-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-handling_misbehaving_servers: diff --git a/doc/sphinx/users-guide/vcl-hashing.rst b/doc/sphinx/users-guide/vcl-hashing.rst index a3bd1ab86..1f50a5e63 100644 --- a/doc/sphinx/users-guide/vcl-hashing.rst +++ b/doc/sphinx/users-guide/vcl-hashing.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Hashing ------- diff --git a/doc/sphinx/users-guide/vcl-inline-c.rst b/doc/sphinx/users-guide/vcl-inline-c.rst index e4b7c4fe2..f30774cda 100644 --- a/doc/sphinx/users-guide/vcl-inline-c.rst +++ b/doc/sphinx/users-guide/vcl-inline-c.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2015 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license diff --git a/doc/sphinx/users-guide/vcl-separate.rst b/doc/sphinx/users-guide/vcl-separate.rst index 0c6c675e7..225dc1c9a 100644 --- a/doc/sphinx/users-guide/vcl-separate.rst +++ b/doc/sphinx/users-guide/vcl-separate.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users-guide-separate_VCL: diff --git a/doc/sphinx/users-guide/vcl-syntax.rst b/doc/sphinx/users-guide/vcl-syntax.rst index 291093b72..b3334a4b7 100644 --- a/doc/sphinx/users-guide/vcl-syntax.rst +++ b/doc/sphinx/users-guide/vcl-syntax.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license VCL Syntax ---------- diff --git a/doc/sphinx/users-guide/vcl-variables.rst b/doc/sphinx/users-guide/vcl-variables.rst index f4df0f43a..8db0041b9 100644 --- a/doc/sphinx/users-guide/vcl-variables.rst +++ b/doc/sphinx/users-guide/vcl-variables.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license Request and response VCL objects diff --git a/doc/sphinx/users-guide/vcl.rst b/doc/sphinx/users-guide/vcl.rst index d34ad43e7..57e6f452b 100644 --- a/doc/sphinx/users-guide/vcl.rst +++ b/doc/sphinx/users-guide/vcl.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2012-2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _users_vcl: diff --git a/doc/sphinx/whats-new/changes-4.1.rst b/doc/sphinx/whats-new/changes-4.1.rst index b5b4508f3..298987a7c 100644 --- a/doc/sphinx/whats-new/changes-4.1.rst +++ b/doc/sphinx/whats-new/changes-4.1.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_changes_4_1: diff --git a/doc/sphinx/whats-new/changes-5.0.rst b/doc/sphinx/whats-new/changes-5.0.rst index a078c32c4..22ce305d8 100644 --- a/doc/sphinx/whats-new/changes-5.0.rst +++ b/doc/sphinx/whats-new/changes-5.0.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_changes_5.0: diff --git a/doc/sphinx/whats-new/changes-5.1.rst b/doc/sphinx/whats-new/changes-5.1.rst index 9d2c5cecb..19af7aa1c 100644 --- a/doc/sphinx/whats-new/changes-5.1.rst +++ b/doc/sphinx/whats-new/changes-5.1.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_changes_5.1: diff --git a/doc/sphinx/whats-new/changes-5.2.rst b/doc/sphinx/whats-new/changes-5.2.rst index ffd306271..3a2efc4e5 100644 --- a/doc/sphinx/whats-new/changes-5.2.rst +++ b/doc/sphinx/whats-new/changes-5.2.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_changes_5.2: diff --git a/doc/sphinx/whats-new/changes-6.0.rst b/doc/sphinx/whats-new/changes-6.0.rst index deb025964..db0143184 100644 --- a/doc/sphinx/whats-new/changes-6.0.rst +++ b/doc/sphinx/whats-new/changes-6.0.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2018 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_changes_6.0: diff --git a/doc/sphinx/whats-new/changes-6.1.rst b/doc/sphinx/whats-new/changes-6.1.rst index e12aaffa1..456576736 100644 --- a/doc/sphinx/whats-new/changes-6.1.rst +++ b/doc/sphinx/whats-new/changes-6.1.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2018 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_changes_6.1: diff --git a/doc/sphinx/whats-new/changes-6.2.rst b/doc/sphinx/whats-new/changes-6.2.rst index 90697fe18..683466edb 100644 --- a/doc/sphinx/whats-new/changes-6.2.rst +++ b/doc/sphinx/whats-new/changes-6.2.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_changes_2019_03: diff --git a/doc/sphinx/whats-new/changes-6.3.rst b/doc/sphinx/whats-new/changes-6.3.rst index 5c4eac672..4dadc44e8 100644 --- a/doc/sphinx/whats-new/changes-6.3.rst +++ b/doc/sphinx/whats-new/changes-6.3.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_changes_6.3: diff --git a/doc/sphinx/whats-new/changes-6.4.rst b/doc/sphinx/whats-new/changes-6.4.rst index b4d388b5b..971871243 100644 --- a/doc/sphinx/whats-new/changes-6.4.rst +++ b/doc/sphinx/whats-new/changes-6.4.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_changes_6.4: diff --git a/doc/sphinx/whats-new/changes-6.5.rst b/doc/sphinx/whats-new/changes-6.5.rst index a09a5e0be..42f841e0c 100644 --- a/doc/sphinx/whats-new/changes-6.5.rst +++ b/doc/sphinx/whats-new/changes-6.5.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_changes_6.5: diff --git a/doc/sphinx/whats-new/index.rst b/doc/sphinx/whats-new/index.rst index d04d542f6..9a62721f8 100644 --- a/doc/sphinx/whats-new/index.rst +++ b/doc/sphinx/whats-new/index.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2013-2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whats-new-index: diff --git a/doc/sphinx/whats-new/relnote-5.0.rst b/doc/sphinx/whats-new/relnote-5.0.rst index 631f2d9dd..cfa8b6aeb 100644 --- a/doc/sphinx/whats-new/relnote-5.0.rst +++ b/doc/sphinx/whats-new/relnote-5.0.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016-2017 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_relnote_5.0: diff --git a/doc/sphinx/whats-new/upgrading-4.0.rst b/doc/sphinx/whats-new/upgrading-4.0.rst index 2ab3a2da2..f97a28afb 100644 --- a/doc/sphinx/whats-new/upgrading-4.0.rst +++ b/doc/sphinx/whats-new/upgrading-4.0.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_4_0: diff --git a/doc/sphinx/whats-new/upgrading-4.1.rst b/doc/sphinx/whats-new/upgrading-4.1.rst index 47d9ceaf3..66b4d5a03 100644 --- a/doc/sphinx/whats-new/upgrading-4.1.rst +++ b/doc/sphinx/whats-new/upgrading-4.1.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_4_1: diff --git a/doc/sphinx/whats-new/upgrading-5.0.rst b/doc/sphinx/whats-new/upgrading-5.0.rst index 272257d7a..501d28b46 100644 --- a/doc/sphinx/whats-new/upgrading-5.0.rst +++ b/doc/sphinx/whats-new/upgrading-5.0.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2016 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_5.0: diff --git a/doc/sphinx/whats-new/upgrading-5.1.rst b/doc/sphinx/whats-new/upgrading-5.1.rst index 354e50934..aaf658bd5 100644 --- a/doc/sphinx/whats-new/upgrading-5.1.rst +++ b/doc/sphinx/whats-new/upgrading-5.1.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2017-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_5.1: diff --git a/doc/sphinx/whats-new/upgrading-5.2.rst b/doc/sphinx/whats-new/upgrading-5.2.rst index 09e90c73b..570a92c52 100644 --- a/doc/sphinx/whats-new/upgrading-5.2.rst +++ b/doc/sphinx/whats-new/upgrading-5.2.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2017-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_5.2: diff --git a/doc/sphinx/whats-new/upgrading-6.0.rst b/doc/sphinx/whats-new/upgrading-6.0.rst index bb4c0187c..07b1ed721 100644 --- a/doc/sphinx/whats-new/upgrading-6.0.rst +++ b/doc/sphinx/whats-new/upgrading-6.0.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2018-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_6.0: diff --git a/doc/sphinx/whats-new/upgrading-6.1.rst b/doc/sphinx/whats-new/upgrading-6.1.rst index 429da5eb5..28003fb1c 100644 --- a/doc/sphinx/whats-new/upgrading-6.1.rst +++ b/doc/sphinx/whats-new/upgrading-6.1.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2018-2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_6.1: diff --git a/doc/sphinx/whats-new/upgrading-6.2.rst b/doc/sphinx/whats-new/upgrading-6.2.rst index c5d92c54a..858b27833 100644 --- a/doc/sphinx/whats-new/upgrading-6.2.rst +++ b/doc/sphinx/whats-new/upgrading-6.2.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_2019_03: diff --git a/doc/sphinx/whats-new/upgrading-6.3.rst b/doc/sphinx/whats-new/upgrading-6.3.rst index 4608bcf89..efe47007e 100644 --- a/doc/sphinx/whats-new/upgrading-6.3.rst +++ b/doc/sphinx/whats-new/upgrading-6.3.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_6.3: diff --git a/doc/sphinx/whats-new/upgrading-6.4.rst b/doc/sphinx/whats-new/upgrading-6.4.rst index e7d391d66..79be9e779 100644 --- a/doc/sphinx/whats-new/upgrading-6.4.rst +++ b/doc/sphinx/whats-new/upgrading-6.4.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_6.4: diff --git a/doc/sphinx/whats-new/upgrading-6.5.rst b/doc/sphinx/whats-new/upgrading-6.5.rst index 12feae9f2..b22050a82 100644 --- a/doc/sphinx/whats-new/upgrading-6.5.rst +++ b/doc/sphinx/whats-new/upgrading-6.5.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2020 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license .. _whatsnew_upgrading_6.5: diff --git a/tools/coccinelle/README.rst b/tools/coccinelle/README.rst index c689da1ab..cb92f989b 100644 --- a/tools/coccinelle/README.rst +++ b/tools/coccinelle/README.rst @@ -1,7 +1,7 @@ .. Copyright (c) 2019-2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license This directory contains `coccinelle`_ semantic patches to facilitate code maintenance. diff --git a/vmod/VSC_debug.vsc b/vmod/VSC_debug.vsc index e4177de14..9c7472778 100644 --- a/vmod/VSC_debug.vsc +++ b/vmod/VSC_debug.vsc @@ -1,7 +1,7 @@ .. Copyright (c) 2021 Varnish Software AS SPDX-License-Identifier: BSD-2-Clause - See LICENSE file for full text of licens + See LICENSE file for full text of license # .. varnish_vsc_begin:: debug From phk at FreeBSD.org Wed Feb 24 13:22:06 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 24 Feb 2021 13:22:06 +0000 (UTC) Subject: [master] 7c2379d53 Add copyright & SPDX to flint.sh files Message-ID: <20210224132206.DCEA010E553@lists.varnish-cache.org> commit 7c2379d53e2fdc990201144e64d1f3128bb87437 Author: Poul-Henning Kamp Date: Wed Feb 24 13:21:06 2021 +0000 Add copyright & SPDX to flint.sh files diff --git a/bin/varnishadm/flint.sh b/bin/varnishadm/flint.sh old mode 100755 new mode 100644 index e214869e8..f4340eb51 --- a/bin/varnishadm/flint.sh +++ b/bin/varnishadm/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2017-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' *.c diff --git a/bin/varnishd/flint.sh b/bin/varnishd/flint.sh old mode 100755 new mode 100644 index 47ac810e3..24e329752 --- a/bin/varnishd/flint.sh +++ b/bin/varnishd/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2006-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' -I../../lib/libvgz diff --git a/bin/varnishhist/flint.sh b/bin/varnishhist/flint.sh old mode 100755 new mode 100644 index e214869e8..f4340eb51 --- a/bin/varnishhist/flint.sh +++ b/bin/varnishhist/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2017-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' *.c diff --git a/bin/varnishlog/flint.sh b/bin/varnishlog/flint.sh old mode 100755 new mode 100644 index 6a5decb69..a9039a3c0 --- a/bin/varnishlog/flint.sh +++ b/bin/varnishlog/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2010-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' -DVARNISH_STATE_DIR=\"foo\" diff --git a/bin/varnishncsa/flint.sh b/bin/varnishncsa/flint.sh old mode 100755 new mode 100644 index e214869e8..dc8d1adc5 --- a/bin/varnishncsa/flint.sh +++ b/bin/varnishncsa/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2006-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' *.c diff --git a/bin/varnishstat/flint.sh b/bin/varnishstat/flint.sh old mode 100755 new mode 100644 index 4663fc1de..a7ce10885 --- a/bin/varnishstat/flint.sh +++ b/bin/varnishstat/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2010-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' varnishstat.c diff --git a/bin/varnishtest/flint.sh b/bin/varnishtest/flint.sh old mode 100755 new mode 100644 index 0caf8a248..1d1192d60 --- a/bin/varnishtest/flint.sh +++ b/bin/varnishtest/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2008-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' -DVTEST_WITH_VTC_LOGEXPECT diff --git a/bin/varnishtop/flint.sh b/bin/varnishtop/flint.sh old mode 100755 new mode 100644 index e214869e8..e0503ed90 --- a/bin/varnishtop/flint.sh +++ b/bin/varnishtop/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2010-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' *.c diff --git a/lib/libvarnish/flint.sh b/lib/libvarnish/flint.sh old mode 100755 new mode 100644 index 80600044a..b0b86276c --- a/lib/libvarnish/flint.sh +++ b/lib/libvarnish/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2008-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' *.c diff --git a/lib/libvarnishapi/flint.sh b/lib/libvarnishapi/flint.sh old mode 100755 new mode 100644 index 80600044a..285bcf4d6 --- a/lib/libvarnishapi/flint.sh +++ b/lib/libvarnishapi/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2017-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' *.c diff --git a/lib/libvcc/flint.sh b/lib/libvcc/flint.sh old mode 100755 new mode 100644 index 80600044a..3fc056ecf --- a/lib/libvcc/flint.sh +++ b/lib/libvcc/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2013-2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license FLOPS=' *.c diff --git a/vmod/flint.sh b/vmod/flint.sh old mode 100755 new mode 100644 index 30896053c..19053bcae --- a/vmod/flint.sh +++ b/vmod/flint.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Copyright (c) 2021 Varnish Software AS +# SPDX-License-Identifier: BSD-2-Clause +# See LICENSE file for full text of license for vmod in vmod_*.vcc ; do vmod="${vmod%.vcc}" From phk at FreeBSD.org Thu Feb 25 09:26:08 2021 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 25 Feb 2021 09:26:08 +0000 (UTC) Subject: [master] a98c14896 Align code with with zlib 1.2.11. Message-ID: <20210225092608.4ECA1105948@lists.varnish-cache.org> commit a98c1489640c8098b8e6e80ebcd9831c0a7f087b Author: Poul-Henning Kamp Date: Thu Feb 25 09:24:22 2021 +0000 Align code with with zlib 1.2.11. FreeBSD's code is undergoing some compatibility adaptations so we go directly to the source from here. PS: Please keep cochinelle out of libvgz. diff --git a/lib/libvgz/adler32.c b/lib/libvgz/adler32.c index 436252be4..5f5e0decd 100644 --- a/lib/libvgz/adler32.c +++ b/lib/libvgz/adler32.c @@ -137,7 +137,7 @@ uLong ZEXPORT adler32(adler, buf, len) const Bytef *buf; uInt len; { - return (adler32_z(adler, buf, len)); + return adler32_z(adler, buf, len); } /* ========================================================================= */ @@ -152,7 +152,7 @@ local uLong adler32_combine_(adler1, adler2, len2) /* for negative len, return invalid adler32 as a clue for debugging */ if (len2 < 0) - return (0xffffffffUL); + return 0xffffffffUL; /* the derivation of this formula is left as an exercise for the reader */ MOD63(len2); /* assumes len2 >= 0 */ @@ -166,7 +166,7 @@ local uLong adler32_combine_(adler1, adler2, len2) if (sum1 >= BASE) sum1 -= BASE; if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1); if (sum2 >= BASE) sum2 -= BASE; - return (sum1 | (sum2 << 16)); + return sum1 | (sum2 << 16); } /* ========================================================================= */ @@ -175,7 +175,7 @@ uLong ZEXPORT adler32_combine(adler1, adler2, len2) uLong adler2; z_off_t len2; { - return (adler32_combine_(adler1, adler2, len2)); + return adler32_combine_(adler1, adler2, len2); } uLong ZEXPORT adler32_combine64(adler1, adler2, len2) @@ -183,7 +183,7 @@ uLong ZEXPORT adler32_combine64(adler1, adler2, len2) uLong adler2; z_off64_t len2; { - return (adler32_combine_(adler1, adler2, len2)); + return adler32_combine_(adler1, adler2, len2); } #else uLong ZEXPORT adler32(adler, buf, len) diff --git a/lib/libvgz/crc32.c b/lib/libvgz/crc32.c index 9ec56fc34..9580440c0 100644 --- a/lib/libvgz/crc32.c +++ b/lib/libvgz/crc32.c @@ -191,7 +191,7 @@ const z_crc_t FAR * ZEXPORT get_crc_table() if (crc_table_empty) make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ - return ((const z_crc_t FAR *)crc_table); + return (const z_crc_t FAR *)crc_table; } /* ========================================================================= */ @@ -204,7 +204,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) const unsigned char FAR *buf; z_size_t len; { - if (buf == Z_NULL) return (0UL); + if (buf == Z_NULL) return 0UL; #ifdef DYNAMIC_CRC_TABLE if (crc_table_empty) @@ -217,9 +217,9 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) endian = 1; if (*((unsigned char *)(&endian))) - return (crc32_little(crc, buf, len)); + return crc32_little(crc, buf, len); else - return (crc32_big(crc, buf, len)); + return crc32_big(crc, buf, len); } #endif /* BYFOUR */ crc = crc ^ 0xffffffffUL; @@ -230,7 +230,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len) if (len) do { DO1; } while (--len); - return (crc ^ 0xffffffffUL); + return crc ^ 0xffffffffUL; } /* ========================================================================= */ @@ -239,7 +239,7 @@ unsigned long ZEXPORT crc32(crc, buf, len) const unsigned char FAR *buf; uInt len; { - return (crc32_z(crc, buf, len)); + return crc32_z(crc, buf, len); } #ifdef BYFOUR @@ -381,7 +381,7 @@ local uLong crc32_combine_(crc1, crc2, len2) /* degenerate case (also disallow negative lengths) */ if (len2 <= 0) - return (crc1); + return crc1; /* put operator for one zero bit in odd */ odd[0] = 0xedb88320UL; /* CRC-32 polynomial */ @@ -421,7 +421,7 @@ local uLong crc32_combine_(crc1, crc2, len2) /* return combined crc */ crc1 ^= crc2; - return (crc1); + return crc1; } /* ========================================================================= */ @@ -430,7 +430,7 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2) uLong crc2; z_off_t len2; { - return (crc32_combine_(crc1, crc2, len2)); + return crc32_combine_(crc1, crc2, len2); } uLong ZEXPORT crc32_combine64(crc1, crc2, len2) @@ -438,5 +438,5 @@ uLong ZEXPORT crc32_combine64(crc1, crc2, len2) uLong crc2; z_off64_t len2; { - return (crc32_combine_(crc1, crc2, len2)); + return crc32_combine_(crc1, crc2, len2); } diff --git a/lib/libvgz/deflate.c b/lib/libvgz/deflate.c index 2a2544783..e4493c125 100644 --- a/lib/libvgz/deflate.c +++ b/lib/libvgz/deflate.c @@ -511,7 +511,7 @@ int ZEXPORT deflateResetKeep (strm) s->wrap == 2 ? crc32(0L, Z_NULL, 0) : #endif adler32(0L, Z_NULL, 0); - s->last_flush = -2; + s->last_flush = Z_NO_FLUSH; _tr_init(s); @@ -606,12 +606,12 @@ int ZEXPORT deflateParams(strm, level, strategy) func = configuration_table[s->level].func; if ((strategy != s->strategy || func != configuration_table[level].func) && - s->last_flush != -2) { + s->high_water) { /* Flush the last buffer: */ int err = deflate(strm, Z_BLOCK); if (err == Z_STREAM_ERROR) return err; - if (strm->avail_in || (s->strstart - s->block_start) + s->lookahead) + if (strm->avail_out == 0) return Z_BUF_ERROR; } if (s->level != level) { diff --git a/lib/libvgz/inflate.c b/lib/libvgz/inflate.c index 93730905a..ca7b6086d 100644 --- a/lib/libvgz/inflate.c +++ b/lib/libvgz/inflate.c @@ -246,7 +246,7 @@ z_streamp strm; const char *version; int stream_size; { - return (inflateInit2_(strm, DEF_WBITS, version, stream_size)); + return inflateInit2_(strm, DEF_WBITS, version, stream_size); } int ZEXPORT inflatePrime(strm, bits, value) diff --git a/lib/libvgz/trees.c b/lib/libvgz/trees.c index a08b09da3..a11cd0d48 100644 --- a/lib/libvgz/trees.c +++ b/lib/libvgz/trees.c @@ -823,7 +823,7 @@ local int build_bl_tree(s) Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", s->opt_len, s->static_len)); - return (max_blindex); + return max_blindex; } /* =========================================================================== @@ -1062,10 +1062,10 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc) Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ", s->last_lit, in_length, out_length, 100L - out_length*100L/in_length)); - if (s->matches < s->last_lit/2 && out_length < in_length/2) return (1); + if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1; } #endif - return (s->last_lit == s->lit_bufsize - 1); + return (s->last_lit == s->lit_bufsize-1); /* We avoid equality with lit_bufsize because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. @@ -1148,20 +1148,20 @@ local int detect_data_type(s) /* Check for non-textual ("black-listed") bytes. */ for (n = 0; n <= 31; n++, black_mask >>= 1) if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0)) - return (Z_BINARY); + return Z_BINARY; /* Check for textual ("white-listed") bytes. */ if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0 || s->dyn_ltree[13].Freq != 0) - return (Z_TEXT); + return Z_TEXT; for (n = 32; n < LITERALS; n++) if (s->dyn_ltree[n].Freq != 0) - return (Z_TEXT); + return Z_TEXT; /* There are no "black-listed" or "white-listed" bytes: * this stream either is empty or has tolerated ("gray-listed") bytes only. */ - return (Z_BINARY); + return Z_BINARY; } /* =========================================================================== diff --git a/lib/libvgz/vgz.h b/lib/libvgz/vgz.h index 1bb81009d..342a0fba5 100644 --- a/lib/libvgz/vgz.h +++ b/lib/libvgz/vgz.h @@ -717,12 +717,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression approach (which is a function of the level) or the - strategy is changed, and if there have been any deflate() calls since the - state was initialized or reset, then the input available so far is - compressed with the old level and strategy using deflate(strm, Z_BLOCK). - There are three approaches for the compression levels 0, 1..3, and 4..9 - respectively. The new level and strategy will take effect at the next call - of deflate(). + strategy is changed, and if any input has been consumed in a previous + deflate() call, then the input available so far is compressed with the old + level and strategy using deflate(strm, Z_BLOCK). There are three approaches + for the compression levels 0, 1..3, and 4..9 respectively. The new level + and strategy will take effect at the next call of deflate(). If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does not have enough output space to complete, then the parameter change will not diff --git a/lib/libvgz/zconf.h b/lib/libvgz/zconf.h index 1afeed62a..21f3eada7 100644 --- a/lib/libvgz/zconf.h +++ b/lib/libvgz/zconf.h @@ -3,7 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ -/* @(#) $FreeBSD: head/contrib/zlib/zconf.h 311285 2017-01-04 16:09:08Z delphij $ */ +/* @(#) $Id$ */ #ifndef ZCONF_H #define ZCONF_H @@ -431,7 +431,7 @@ typedef uLong FAR uLongf; typedef unsigned long z_crc_t; #endif -#if 0 /* was set to #if 0 by ./configure */ +#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ # define Z_HAVE_UNISTD_H #endif @@ -500,15 +500,8 @@ typedef uLong FAR uLongf; # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif -/* - * This is hard-configured for FreeBSD. - */ -#define z_off_t off_t -#ifndef _FILE_OFFSET_BITS -#define _FILE_OFFSET_BITS 64 -#endif - #ifndef z_off_t +# error "z_off_t missing" # define z_off_t long #endif diff --git a/lib/libvgz/zutil.c b/lib/libvgz/zutil.c index e65fd04b8..5b21eceda 100644 --- a/lib/libvgz/zutil.c +++ b/lib/libvgz/zutil.c @@ -27,7 +27,7 @@ z_const char * const z_errmsg[10] = { const char * ZEXPORT zlibVersion() { - return (ZLIB_VERSION); + return ZLIB_VERSION; } uLong ZEXPORT zlibCompileFlags() @@ -110,7 +110,7 @@ uLong ZEXPORT zlibCompileFlags() # endif # endif #endif - return (flags); + return flags; } #ifdef ZLIB_DEBUG @@ -134,7 +134,7 @@ void ZLIB_INTERNAL z_error (m) const char * ZEXPORT zError(err) int err; { - return (ERR_MSG(err)); + return ERR_MSG(err); } #if defined(_WIN32_WCE) @@ -166,9 +166,9 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len) uInt j; for (j = 0; j < len; j++) { - if (s1[j] != s2[j]) return (2 * (s1[j] > s2[j]) - 1); + if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; } - return (0); + return 0; } void ZLIB_INTERNAL zmemzero(dest, len) @@ -229,18 +229,18 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) */ if (bsize < 65520L) { buf = farmalloc(bsize); - if (*(ush*)&buf != 0) return (buf); + if (*(ush*)&buf != 0) return buf; } else { buf = farmalloc(bsize + 16L); } - if (buf == NULL || next_ptr >= MAX_PTR) return (NULL); + if (buf == NULL || next_ptr >= MAX_PTR) return NULL; table[next_ptr].org_ptr = buf; /* Normalize the pointer to seg:0 */ *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; *(ush*)&buf = 0; table[next_ptr++].new_ptr = buf; - return (buf); + return buf; } void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) @@ -283,7 +283,7 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) { (void)opaque; - return (_halloc((long)items, size)); + return _halloc((long)items, size); } void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)