From nils.goroll at uplex.de Sat Jul 1 11:08:05 2017 From: nils.goroll at uplex.de (Nils Goroll) Date: Sat, 01 Jul 2017 13:08:05 +0200 Subject: [master] c057498 tick off XXX Message-ID: commit c0574980ba8e94f0dbf1c5bdd0f162491db1f1cf Author: Nils Goroll Date: Sat Jul 1 13:07:38 2017 +0200 tick off XXX diff --git a/doc/sphinx/installation/bugs.rst b/doc/sphinx/installation/bugs.rst index 2305c1c..75fda83 100644 --- a/doc/sphinx/installation/bugs.rst +++ b/doc/sphinx/installation/bugs.rst @@ -154,5 +154,3 @@ You can also try setting the ``vsl_mask=+VCL_trace`` parameter (or use ``varnishadm param.set vsl_mask +VCL_trace`` on a running instance), that will generate log records with like and character number for each statement executed in your VCL program. - -.. XXX:Example of the command perhaps? benc From phk at FreeBSD.org Sun Jul 2 14:51:05 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Sun, 02 Jul 2017 16:51:05 +0200 Subject: [master] 60ed13d Modern(er) JEmalloc has removed opt.redzone and fail if you try to enable it. Message-ID: commit 60ed13d970a75dba20750654da3b7ce445b981fa Author: Poul-Henning Kamp Date: Sun Jul 2 14:49:52 2017 +0000 Modern(er) JEmalloc has removed opt.redzone and fail if you try to enable it. diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c index 975f0b8..611b41d 100644 --- a/bin/varnishtest/vtc_main.c +++ b/bin/varnishtest/vtc_main.c @@ -424,7 +424,7 @@ i_mode(void) /* * strict jemalloc checking */ - AZ(putenv(strdup("MALLOC_CONF=abort:true,redzone:true,junk:true"))); + AZ(putenv(strdup("MALLOC_CONF=abort:true,junk:true"))); } /********************************************************************** From dridi.boukelmoune at gmail.com Mon Jul 3 10:55:06 2017 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Mon, 03 Jul 2017 12:55:06 +0200 Subject: [master] fd4a927 Add extra locking to protect the pools list and refcounts Message-ID: commit fd4a9271f887e1568ba333b20699d65af9ebc07a Author: Martin Blix Grydeland Date: Tue Jun 27 15:33:41 2017 +0200 Add extra locking to protect the pools list and refcounts Probes currently running on a worker thread at the time they are deleted will delay the release of the refcount they hold on the TCP pool. Since this call will not be from the CLI thread we need locking to protect these datastructures. diff --git a/bin/varnishd/cache/cache_backend_tcp.c b/bin/varnishd/cache/cache_backend_tcp.c index 681834f..8f8a772 100644 --- a/bin/varnishd/cache/cache_backend_tcp.c +++ b/bin/varnishd/cache/cache_backend_tcp.c @@ -69,6 +69,7 @@ struct tcp_pool { }; +static struct lock pools_mtx; static VTAILQ_HEAD(, tcp_pool) pools = VTAILQ_HEAD_INITIALIZER(pools); /*-------------------------------------------------------------------- @@ -125,6 +126,7 @@ VBT_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6) { struct tcp_pool *tp; + Lck_Lock(&pools_mtx); VTAILQ_FOREACH(tp, &pools, list) { assert(tp->refcnt > 0); if (ip4 == NULL) { @@ -146,8 +148,10 @@ VBT_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6) continue; } tp->refcnt++; + Lck_Unlock(&pools_mtx); return (tp); } + Lck_Unlock(&pools_mtx); ALLOC_OBJ(tp, TCP_POOL_MAGIC); AN(tp); @@ -159,7 +163,11 @@ VBT_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6) Lck_New(&tp->mtx, lck_backend_tcp); VTAILQ_INIT(&tp->connlist); VTAILQ_INIT(&tp->killlist); + + Lck_Lock(&pools_mtx); VTAILQ_INSERT_HEAD(&pools, tp, list); + Lck_Unlock(&pools_mtx); + return (tp); } @@ -174,11 +182,17 @@ VBT_Rel(struct tcp_pool **tpp) struct vbc *vbc, *vbc2; TAKE_OBJ_NOTNULL(tp, tpp, TCP_POOL_MAGIC); + + Lck_Lock(&pools_mtx); assert(tp->refcnt > 0); - if (--tp->refcnt > 0) + if (--tp->refcnt > 0) { + Lck_Unlock(&pools_mtx); return; + } AZ(tp->n_used); VTAILQ_REMOVE(&pools, tp, list); + Lck_Unlock(&pools_mtx); + free(tp->name); free(tp->ip4); free(tp->ip6); @@ -400,3 +414,11 @@ VBT_Wait(struct worker *wrk, struct vbc *vbc) vbc->cond = NULL; Lck_Unlock(&tp->mtx); } + +/*--------------------------------------------------------------------*/ + +void +VBT_Init(void) +{ + Lck_New(&pools_mtx, lck_backend); +} diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c index 1467706..d6c8921 100644 --- a/bin/varnishd/cache/cache_main.c +++ b/bin/varnishd/cache/cache_main.c @@ -238,6 +238,7 @@ child_main(void) HTTP_Init(); VBO_Init(); + VBT_Init(); VBP_Init(); VBE_InitCfg(); Pool_Init(); diff --git a/bin/varnishd/cache/cache_priv.h b/bin/varnishd/cache/cache_priv.h index 215ebc9..66071b9 100644 --- a/bin/varnishd/cache/cache_priv.h +++ b/bin/varnishd/cache/cache_priv.h @@ -41,6 +41,9 @@ void VCA_Shutdown(void); void VBE_InitCfg(void); void VBE_Poll(void); +/* cache_backend_tcp.c */ +void VBT_Init(void); + /* cache_backend_poll.c */ void VBP_Init(void); From geoff at uplex.de Wed Jul 5 05:30:07 2017 From: geoff at uplex.de (Geoff Simmons) Date: Wed, 05 Jul 2017 07:30:07 +0200 Subject: [master] 0427742 Add the vtc feature ignore_unknown_macro. Message-ID: commit 0427742369501bd5e3c1b7aefa6795970c725bca Author: Geoff Simmons Date: Wed Jul 5 07:26:31 2017 +0200 Add the vtc feature ignore_unknown_macro. Closes: #2357 diff --git a/bin/varnishtest/tests/a00018.vtc b/bin/varnishtest/tests/a00018.vtc new file mode 100644 index 0000000..036aa45 --- /dev/null +++ b/bin/varnishtest/tests/a00018.vtc @@ -0,0 +1,35 @@ +varnishtest "feature ignore_unknown_macro" + +feature ignore_unknown_macro + +server s1 { + rxreq + expect req.http.Foo == "${foo}" + txresp -hdr "Bar: ${bar}" +} -start + +varnish v1 -vcl { + backend default { + .host = "${s1_addr}"; + .port = "${s1_port}"; + } + + sub vcl_deliver { + if (resp.http.Bar == "${bar}") { + set resp.http.Baz = "${baz}"; + } + } +} -start + +client c1 { + txreq -hdr "Foo: ${foo}" + rxresp + expect resp.status == 200 + expect resp.http.Bar == "${bar}" + expect resp.http.Baz == "${baz}" +} -run + +shell { + touch ${tmpdir}/tst + rm ${tmpdir}/tst +} diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c index feadd9f..d610421 100644 --- a/bin/varnishtest/vtc.c +++ b/bin/varnishtest/vtc.c @@ -58,6 +58,7 @@ volatile sig_atomic_t vtc_error; /* Error encountered */ int vtc_stop; /* Stops current test without error */ pthread_t vtc_thread; static struct vtclog *vltop; +static int ign_unknown_macro = 0; /********************************************************************** * Macro facility @@ -236,13 +237,18 @@ macro_expand(struct vtclog *vl, const char *text) p += 2; m = macro_get(p, q); if (m == NULL) { - VSB_destroy(&vsb); - vtc_fatal(vl, "Macro ${%.*s} not found", (int)(q - p), - p); - NEEDLESS(return (NULL)); + if (!ign_unknown_macro) { + VSB_destroy(&vsb); + vtc_fatal(vl, "Macro ${%.*s} not found", + (int)(q - p), p); + NEEDLESS(return (NULL)); + } + VSB_printf(vsb, "${%.*s}", (int)(q - p), p); + } + else { + VSB_printf(vsb, "%s", m); + free(m); } - VSB_printf(vsb, "%s", m); - free(m); text = q + 1; } AZ(VSB_finish(vsb)); @@ -662,8 +668,9 @@ cmd_delay(CMD_ARGS) /* SECTION: feature feature * - * Test that the required feature(s) for a test are available, and skip the test - * otherwise. feature takes any number of arguments from this list: + * Test that the required feature(s) for a test are available, and skip + * the test otherwise; or change the interpretation of the test, as + * documented below. feature takes any number of arguments from this list: * * SO_RCVTIMEO_WORKS * The SO_RCVTIMEO socket option is working @@ -685,6 +692,13 @@ cmd_delay(CMD_ARGS) * The varnish group is present * cmd * A command line that should execute with a zero exit status + * ignore_unknown_macro + * Do not fail the test if a string of the form ${...} is not + * recognized as a macro. + * + * Be careful with the last feature, because it may cause a test with a + * misspelled macro to fail silently. You should only need it if you must + * run a test with strings of the form "${...}". */ static void @@ -755,6 +769,9 @@ cmd_feature(CMD_ARGS) good = 1; else vtc_stop = 2; + } else if (!strcmp(*av, "ignore_unknown_macro")) { + ign_unknown_macro = 1; + good = 1; } if (good) continue; From fgsch at lodoss.net Thu Jul 6 00:01:06 2017 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Thu, 06 Jul 2017 02:01:06 +0200 Subject: [master] d6ad7f2 Initialise mutexes explicitly Message-ID: commit d6ad7f2169adddffb3d99def1fa2354141f28abc Author: Federico G. Schwindt Date: Thu Jul 6 00:36:26 2017 +0100 Initialise mutexes explicitly diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c index 8c3df12..9957b3e 100644 --- a/bin/varnishd/cache/cache_panic.c +++ b/bin/varnishd/cache/cache_panic.c @@ -58,7 +58,7 @@ */ static struct vsb pan_vsb_storage, *pan_vsb; -static pthread_mutex_t panicstr_mtx = PTHREAD_MUTEX_INITIALIZER; +static pthread_mutex_t panicstr_mtx; static void pan_sess(struct vsb *, const struct sess *); @@ -690,6 +690,7 @@ void PAN_Init(void) { + AZ(pthread_mutex_init(&panicstr_mtx, NULL)); VAS_Fail = pan_ic; pan_vsb = &pan_vsb_storage; AN(heritage.panic_str); diff --git a/bin/varnishd/storage/stevedore.c b/bin/varnishd/storage/stevedore.c index f8253cc..fb280af 100644 --- a/bin/varnishd/storage/stevedore.c +++ b/bin/varnishd/storage/stevedore.c @@ -43,6 +43,8 @@ #include "vrt_obj.h" +static pthread_mutex_t stv_mtx; + /*-------------------------------------------------------------------- * XXX: trust pointer writes to be atomic */ @@ -52,9 +54,8 @@ STV_next() { static struct stevedore *stv; struct stevedore *r; - static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; - AZ(pthread_mutex_lock(&mtx)); + AZ(pthread_mutex_lock(&stv_mtx)); if (!STV__iter(&stv)) AN(STV__iter(&stv)); if (stv == stv_transient) { @@ -62,7 +63,7 @@ STV_next() AN(STV__iter(&stv)); } r = stv; - AZ(pthread_mutex_unlock(&mtx)); + AZ(pthread_mutex_unlock(&stv_mtx)); AN(r); return (r); } @@ -102,6 +103,7 @@ STV_open(void) char buf[1024]; ASSERT_CLI(); + AZ(pthread_mutex_init(&stv_mtx, NULL)); STV_Foreach(stv) { bprintf(buf, "storage.%s", stv->ident); stv->vclname = strdup(buf); From fgsch at lodoss.net Thu Jul 6 00:01:06 2017 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Thu, 06 Jul 2017 02:01:06 +0200 Subject: [master] 7450697 pep8 love and cleanup Message-ID: commit 7450697c5cbf6d25c51249a799c859bea061a256 Author: Federico G. Schwindt Date: Thu Jul 6 00:43:40 2017 +0100 pep8 love and cleanup diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py index 015a9e6..7faf58c 100755 --- a/lib/libvcc/generate.py +++ b/lib/libvcc/generate.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -#- +# # Copyright (c) 2006 Verdens Gang AS # Copyright (c) 2006-2015 Varnish Software AS # All rights reserved. @@ -1177,7 +1177,6 @@ def restrict(fo, spec): assert j in vcls d[j] = True p = "" - n = 0 l = list(d.keys()) l.sort() w = 0 diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py index c8214e4..90b888e 100755 --- a/lib/libvcc/vmodtool.py +++ b/lib/libvcc/vmodtool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -#- +# # Copyright (c) 2010-2016 Varnish Software # All rights reserved. # @@ -42,12 +42,8 @@ import re import optparse import unittest import random -from os import fdopen, rename, unlink -from os.path import dirname, exists, join, realpath -from pprint import pprint, pformat -from tempfile import mkstemp -rstfmt=False +rstfmt = False ctypes = { 'ACL': "VCL_ACL", @@ -91,10 +87,10 @@ def write_rst_file_warning(fo): write_file_warning(fo, "..", "..", "..") def write_rst_hdr(fo, s, below="-", above=None): - if above != None: + if above is not None: fo.write(above * len(s) + "\n") fo.write(s + "\n") - if below != None: + if below is not None: fo.write(below * len(s) + "\n") ####################################################################### @@ -121,7 +117,7 @@ def lwrap(s, width=64): def quote(s): return s.replace("\"", "\\\"") -def indent(p,n): +def indent(p, n): n = len(p.expandtabs()) + n p = "\t" * int(n / 8) p += " " * int(n % 8) @@ -129,33 +125,12 @@ def indent(p,n): ####################################################################### -def is_c_name(s): - return re.match("^[a-zA-Z][a-zA-Z0-9_]*$", s) is not None - - -class ParseError(Exception): - "An error reading the input file." - pass - -class FormatError(Exception): - """ - Raised if the content of the (otherwise well-formed) input file - is invalid. - """ - def __init__(self, msg, details): - self.msg = msg - self.details = details - Exception.__init__(self) - -####################################################################### - def err(str, warn=True): if opts.strict or not warn: - print("ERROR: " + str, file = sys.stderr) + print("ERROR: " + str, file=sys.stderr) exit(1) - raise FormatError(str, "") else: - print("WARNING: " + str, file = sys.stderr) + print("WARNING: " + str, file=sys.stderr) def fmt_cstruct(fo, mn, x): a = "\ttd_" + mn + "_" + x @@ -175,18 +150,18 @@ class ctype(object): def __str__(self): s = "<" + self.vt - if self.nm != None: + if self.nm is not None: s += " " + self.nm - if self.defval != None: + if self.defval is not None: s += " VAL=" + self.defval - if self.spec != None: + if self.spec is not None: s += " SPEC=" + str(self.spec) return s + ">" def vcl(self): if self.vt == "STRING_LIST": return "STRING" - if self.spec == None: + if self.spec is None: return self.vt return self.vt + " {" + ",".join(self.spec) + "}" @@ -194,7 +169,7 @@ class ctype(object): fo.write(p + '"' + self.vt) fo.write('\\0"\n') p = indent(p, 4) - if self.spec != None: + if self.spec is not None: fo.write(p + '"\\1"\n') p = indent(p, 4) for i in self.spec: @@ -203,9 +178,9 @@ class ctype(object): # This terminating \1 is necessary to ensure that # a prototype always ends with three \0's fo.write(p + '"\\1\\0"\n') - if self.nm != None: + if self.nm is not None: fo.write(p + '"\\2" "' + self.nm + '\\0"\n') - if self.defval != None: + if self.defval is not None: fo.write(p + '"\\3" "' + quote(self.defval) + '\\0"\n') def vtype(txt): @@ -231,9 +206,9 @@ def vtype(txt): return ct, r def arg(txt): - a,s = vtype(txt) + a, s = vtype(txt) if len(s) == 0 or s[0] == ',': - return a,s + return a, s i = s.find('=') j = s.find(',') @@ -250,7 +225,7 @@ def arg(txt): return a, s a.nm = s[:i].rstrip() - s = s[i+1:].lstrip() + s = s[i + 1:].lstrip() if s[0] == '"' or s[0] == "'": m = re.match("(['\"]).*?(\\1)", s) if not m: @@ -264,7 +239,7 @@ def arg(txt): a.defval = s[:i].rstrip() s = s[i:] - return a,s + return a, s # XXX cant have ( or ) in an argument default value class prototype(object): @@ -280,7 +255,7 @@ class prototype(object): st.doc = n[1] if retval: - self.retval,s = vtype(l) + self.retval, s = vtype(l) else: self.retval = None s = l @@ -293,11 +268,11 @@ class prototype(object): s = s[1:-1].lstrip() self.args = [] while len(s) > 0: - a,s = arg(s) + a, s = arg(s) self.args.append(a) s = s.lstrip() if len(s) == 0: - break; + break assert s[0] == ',' s = s[1:].lstrip() @@ -306,16 +281,16 @@ class prototype(object): def vcl_proto(self, short): s = "" - if self.retval != None: + if self.retval is not None: s += self.retval.vcl() + " " s += self.name + "(" l = [] for i in self.args: t = i.vcl() if not short: - if i.nm != None: + if i.nm is not None: t += " " + i.nm - if i.defval != None: + if i.defval is not None: t += "=" + i.defval l.append(t) s += ", ".join(l) + ")" @@ -333,13 +308,13 @@ class prototype(object): return ", ".join(l) def specstr(self, fo, cfunc, p): - if self.retval == None: + if self.retval is None: fo.write(p + '"VOID\\0"\n') else: self.retval.specstr(fo, p) fo.write(p + '"' + cfunc + '\\0"\n') p = indent(p, 4) - if self.args != None: + if self.args is not None: for i in self.args: i.specstr(fo, p) fo.write(p + '"\\0"\n') @@ -363,7 +338,7 @@ class stanza(object): print(type(self), self.line) def rstfile(self, fo, man): - if self.rstlbl != None: + if self.rstlbl is not None: fo.write(".. _" + self.rstlbl + ":\n\n") self.rsthead(fo, man) @@ -371,7 +346,7 @@ class stanza(object): self.rsttail(fo, man) def rsthead(self, fo, man): - if self.proto == None: + if self.proto is None: return if rstfmt: s = self.proto.vcl_proto(short=False) @@ -436,7 +411,7 @@ class s_module(stanza): if man: for i in self.vcc.contents[1:]: - if i.rstlbl == None: + if i.rstlbl is None: continue fo.write("* %s\n" % i.proto.vcl_proto(short=True)) @@ -446,9 +421,9 @@ class s_module(stanza): l = [] for i in self.vcc.contents[1:]: j = i.rstlbl - if j != None: + if j is not None: l.append([j.split("_", 1)[1], j]) - if i.methods == None: + if i.methods is None: continue for x in i.methods: j = x.rstlbl @@ -580,7 +555,6 @@ class s_object(stanza): self.chfile(fo, False) def cstruct(self, fo): - td = "td_" + self.vcc.modname + "_" + self.proto.name + "_" fmt_cstruct(fo, self.vcc.modname, self.proto.name + "__init") fmt_cstruct(fo, self.vcc.modname, self.proto.name + "__fini") for i in self.methods: @@ -672,7 +646,7 @@ class vcc(object): else: self.copyright = a[0] continue - if i == 1 and self.copyright != None: + if i == 1 and self.copyright is not None: if c[0] != "Module": err("$Module must be first stanze") if c[0] == "Module": @@ -700,7 +674,7 @@ class vcc(object): fo.write(a + "\n") def rstfile(self, man=False): - fn = join(self.rstdir, "vmod_" + self.modname) + fn = os.path.join(self.rstdir, "vmod_" + self.modname) if man: fn += ".man" fn += ".rst" @@ -712,7 +686,7 @@ class vcc(object): for i in self.contents: i.rstfile(fo, man) - if self.copyright != None: + if self.copyright is not None: self.rst_copyright(fo) fo.close() @@ -867,9 +841,9 @@ if __name__ == "__main__": exit() i_vcc = None - if len(args) == 1 and exists(args[0]): + if len(args) == 1 and os.path.exists(args[0]): i_vcc = args[0] - elif exists("vmod.vcc"): + elif os.path.exists("vmod.vcc"): if not i_vcc: i_vcc = "vmod.vcc" else: From dridi.boukelmoune at gmail.com Thu Jul 13 13:15:15 2017 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Thu, 13 Jul 2017 15:15:15 +0200 Subject: [master] 7268e67 Typo Message-ID: commit 7268e67c8207da3350273bae5468501d990593a3 Author: Dridi Boukelmoune Date: Thu Jul 13 15:10:55 2017 +0200 Typo Refs #1899 diff --git a/doc/sphinx/reference/varnish-cli.rst b/doc/sphinx/reference/varnish-cli.rst index 58c80ef..6557284 100644 --- a/doc/sphinx/reference/varnish-cli.rst +++ b/doc/sphinx/reference/varnish-cli.rst @@ -54,7 +54,7 @@ Syntax The Varnish CLI is similar to another command line interface, the Bourne Shell. Commands are usually terminated with a newline, and they may take arguments. The command and its arguments are *tokenized* before parsing, -and as such arguments containing must must be enclosed in double quotes. +and as such arguments containing spaces must be enclosed in double quotes. It means that command parsing of From dridi.boukelmoune at gmail.com Fri Jul 14 15:00:08 2017 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Fri, 14 Jul 2017 17:00:08 +0200 Subject: [4.1] 342d19f Both sections live in the same manual Message-ID: commit 342d19f3eeede272c4c621e4e58f42a5082124a8 Author: Dridi Boukelmoune Date: Fri Jul 14 16:55:46 2017 +0200 Both sections live in the same manual diff --git a/include/tbl/vsl_tags.h b/include/tbl/vsl_tags.h index 2b2dc0c..7e59f30 100644 --- a/include/tbl/vsl_tags.h +++ b/include/tbl/vsl_tags.h @@ -451,8 +451,8 @@ SLTM(Timestamp, 0, "Timing information", "Time stamps are issued by Varnish on certain events," " and show the absolute time of the event, the time spent since the" " start of the work unit, and the time spent since the last timestamp" - " was logged. See vsl(7) for information about the individual" - " timestamps.\n\n" + " was logged. See the TIMESTAMPS section below for information about" + " the individual time stamps.\n\n" "The format is::\n\n" "\t%s: %f %f %f\n" "\t| | | |\n" From fgsch at lodoss.net Fri Jul 21 10:20:06 2017 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Fri, 21 Jul 2017 12:20:06 +0200 Subject: [master] 3457ded Both Upgrade and Connection headers are needed now Message-ID: commit 3457dedc45a08a925fea05dc20850882c7049ab1 Author: Federico G. Schwindt Date: Fri Jul 21 11:18:21 2017 +0100 Both Upgrade and Connection headers are needed now Related to #2337 and #2366. diff --git a/doc/sphinx/users-guide/vcl-example-websockets.rst b/doc/sphinx/users-guide/vcl-example-websockets.rst index 9401b37..f4aed70 100644 --- a/doc/sphinx/users-guide/vcl-example-websockets.rst +++ b/doc/sphinx/users-guide/vcl-example-websockets.rst @@ -6,7 +6,7 @@ WebSockets is a technology for creating a bidirectional stream-based channel over HTTP. To run WebSockets through Varnish you need to pipe the request and copy -the Upgrade header as follows:: +the Upgrade and Connection headers as follows:: sub vcl_recv { if (req.http.upgrade ~ "(?i)websocket") { @@ -17,5 +17,6 @@ the Upgrade header as follows:: sub vcl_pipe { if (req.http.upgrade) { set bereq.http.upgrade = req.http.upgrade; + set bereq.http.connection = req.http.connection; } } From Maria at varnish-cache.org Thu Jul 27 14:54:53 2017 From: Maria at varnish-cache.org (Maria) Date: Thu, 27 Jul 2017 15:54:53 +0100 Subject: Emailing: 72151519 Message-ID: <000c01d1666f$957c2840$c07478c0$@fontesromero.com.br> Your message is ready to be sent with the following file or link attachments: 72151519 Note: To protect against computer viruses, e-mail programs may prevent sending or receiving certain types of file attachments. Check your e-mail security settings to determine how attachments are handled. -------------- next part -------------- A non-text attachment was scrubbed... Name: 72151519.doc Type: application/octet-stream Size: 15963 bytes Desc: not available URL: From fgsch at lodoss.net Fri Jul 28 11:24:16 2017 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Fri, 28 Jul 2017 13:24:16 +0200 Subject: [master] d17b812 Limit the number of fields up to 255 Message-ID: commit d17b8129f01350c67cdeb9037b5b4d329532a89c Author: Federico G. Schwindt Date: Fri Jul 28 12:03:52 2017 +0100 Limit the number of fields up to 255 Part of #2344. diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c index 04efbda..99413a1 100644 --- a/bin/varnishncsa/varnishncsa.c +++ b/bin/varnishncsa/varnishncsa.c @@ -591,8 +591,8 @@ static void parse_x_format(char *buf) { char *e, *r, *s; + long lval; int slt; - intmax_t i; if (!strcmp(buf, "Varnish:time_firstbyte")) { addf_fragment(&CTX.frag[F_ttfb], ""); @@ -632,23 +632,18 @@ parse_x_format(char *buf) if (r == buf || r[1] == ']') VUT_Error(1, "Syntax error: VSL:%s", buf); e[-1] = '\0'; - i = strtoimax(r + 1, &s, 10); + lval = strtol(r + 1, &s, 10); if (s != e - 1) VUT_Error(1, "Syntax error: VSL:%s]", buf); - if (i <= 0) + if (lval <= 0 || lval > 255) { VUT_Error(1, "Syntax error. Field specifier must be" - " positive: %s]", + " between 1 and 255: %s]", buf); - if (i > INT_MAX) { - VUT_Error(1, - "Field specifier %jd for the tag VSL:%s]" - " is probably too high", - i, buf); } *r = '\0'; } else - i = 0; + lval = 0; r = buf; while (r < e && *r != ':') r++; @@ -665,7 +660,7 @@ parse_x_format(char *buf) VUT_Error(1, "Unknown log tag: %s", buf); assert(slt >= 0); - addf_vsl(slt, i, r); + addf_vsl(slt, lval, r); return; } VUT_Error(1, "Unknown formatting extension: %s", buf); diff --git a/bin/varnishtest/tests/u00003.vtc b/bin/varnishtest/tests/u00003.vtc index 4b026c7..e824961 100644 --- a/bin/varnishtest/tests/u00003.vtc +++ b/bin/varnishtest/tests/u00003.vtc @@ -90,10 +90,10 @@ shell -err -expect "Unknown log tag: Begin[a" \ shell -err -expect "Syntax error: VSL:Begin[a]" \ {varnishncsa -F "%{VSL:Begin[a]}x"} shell -err -match {Syntax error. (?# -)Field specifier must be positive: Begin\[0\]} \ +)Field specifier must be between 1 and 255: Begin\[0\]} \ {varnishncsa -F "%{VSL:Begin[0]}x"} -shell -err -match {Field specifier 999999999999 for the tag (?# -)VSL:Begin\[999999999999\] is probably too high} \ +shell -err -match {Syntax error. (?# +)Field specifier must be between 1 and 255: Begin\[999999999999\]} \ {varnishncsa -F "%{VSL:Begin[999999999999]}x"} shell -err -expect "Can't open format file (No such file or directory)" \ {varnishncsa -f /nonexistent/file} diff --git a/doc/sphinx/reference/varnishncsa.rst b/doc/sphinx/reference/varnishncsa.rst index 2f9492f..07a8b79 100644 --- a/doc/sphinx/reference/varnishncsa.rst +++ b/doc/sphinx/reference/varnishncsa.rst @@ -184,7 +184,8 @@ Supported formatters are: The field will, if present, treat the log record as a white space separated list of fields, and only the nth part of the - record will be matched against. Fields start counting at 1. + record will be matched against. Fields start counting at 1 and + run up to 255. Defaults to '-' when the tag is not seen, the record prefix does not match or the field is out of bounds. If a tag appears From vm at varnish-cache.org Fri Jul 28 12:23:25 2017 From: vm at varnish-cache.org (vm at varnish-cache.org) Date: Fri, 28 Jul 2017 17:53:25 +0530 Subject: Voice Message Attached from 01258866726 - name unavailable Message-ID: Time: Fri, 28 Jul 2017 17:53:25 +0530 Click attachment to listen to Voice Message -------------- next part -------------- A non-text attachment was scrubbed... Name: 01258866726_4282808_788239.zip Type: application/octet-stream Size: 1892 bytes Desc: not available URL: From nils.goroll at uplex.de Fri Jul 28 20:12:10 2017 From: nils.goroll at uplex.de (Nils Goroll) Date: Fri, 28 Jul 2017 22:12:10 +0200 Subject: [master] b8290db Close a race in the round robin director - for real now Message-ID: commit b8290db410c511f58d4c14d6daa9f4af3de5711b Author: Nils Goroll Date: Fri Jul 28 22:01:26 2017 +0200 Close a race in the round robin director - for real now The previous code allowed the compiler to re-read nxt from rr->nxt which could have been incremented cocurrently. Fixes #2378 diff --git a/lib/libvmod_directors/round_robin.c b/lib/libvmod_directors/round_robin.c index 59f7332..3932938 100644 --- a/lib/libvmod_directors/round_robin.c +++ b/lib/libvmod_directors/round_robin.c @@ -70,9 +70,9 @@ vmod_rr_resolve(const struct director *dir, struct worker *wrk, CAST_OBJ_NOTNULL(rr, dir->priv, VMOD_DIRECTORS_ROUND_ROBIN_MAGIC); vdir_rdlock(rr->vd); for (u = 0; u < rr->vd->n_backend; u++) { - nxt = rr->nxt %= rr->vd->n_backend; + nxt = rr->nxt % rr->vd->n_backend; + rr->nxt = nxt + 1; be = rr->vd->backend[nxt]; - rr->nxt++; CHECK_OBJ_NOTNULL(be, DIRECTOR_MAGIC); if (be->healthy(be, bo, NULL)) break; From scanner at varnish-cache.org Mon Jul 31 18:31:56 2017 From: scanner at varnish-cache.org (scanner at varnish-cache.org) Date: Mon, 31 Jul 2017 21:31:56 +0300 Subject: Scan Data Message-ID: <843955.260071@varnish-cache.org> Number of images: 1 Attachment File Type: PDF -------------- next part -------------- A non-text attachment was scrubbed... Name: Scan_432721.zip Type: application/octet-stream Size: 1759 bytes Desc: not available URL: