From phk at FreeBSD.org Wed Nov 1 08:51:06 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 1 Nov 2017 08:51:06 +0000 (UTC) Subject: [master] d19ce7d Flexelinting Message-ID: <20171101085106.31EE0A6E6F@lists.varnish-cache.org> commit d19ce7dd6f703bbe07532ea5e1003d857bdedf1a Author: Poul-Henning Kamp Date: Wed Nov 1 08:50:10 2017 +0000 Flexelinting diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c index 84a0cb1..16e51e3 100644 --- a/bin/varnishd/cache/cache_backend_cfg.c +++ b/bin/varnishd/cache/cache_backend_cfg.c @@ -49,7 +49,7 @@ #include "VSC_vbe.h" -static const char *vbe_proto_ident = "HTTP Backend"; +static const char * const vbe_proto_ident = "HTTP Backend"; static VTAILQ_HEAD(, backend) backends = VTAILQ_HEAD_INITIALIZER(backends); static VTAILQ_HEAD(, backend) cool_backends = diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c index e84c4b7..75faef9 100644 --- a/bin/varnishd/cache/cache_panic.c +++ b/bin/varnishd/cache/cache_panic.c @@ -45,7 +45,6 @@ #include "common/heritage.h" #include "waiter/waiter.h" -#include "cache_director.h" #include "storage/storage.h" #include "vcli_serve.h" diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c index e61fa76..203ee18 100644 --- a/bin/varnishd/cache/cache_vcl.c +++ b/bin/varnishd/cache/cache_vcl.c @@ -39,7 +39,6 @@ #include "common/heritage.h" #include "vcl.h" -#include "waiter/waiter.h" #include "cache_director.h" #include "cache_backend.h" diff --git a/bin/varnishd/http2/cache_http2_send.c b/bin/varnishd/http2/cache_http2_send.c index 0c5344d..a369df7 100644 --- a/bin/varnishd/http2/cache_http2_send.c +++ b/bin/varnishd/http2/cache_http2_send.c @@ -165,8 +165,7 @@ h2_win_limit(const struct h2_req *r2, const struct h2_sess *h2) } static void -h2_win_charge(struct h2_req *r2, struct h2_sess *h2, - uint32_t w) +h2_win_charge(struct h2_req *r2, const struct h2_sess *h2, uint32_t w) { CHECK_OBJ_NOTNULL(r2, H2_REQ_MAGIC); CHECK_OBJ_NOTNULL(h2, H2_SESS_MAGIC); diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c index a24dd1e..e75120f 100644 --- a/bin/varnishtest/vtc_http2.c +++ b/bin/varnishtest/vtc_http2.c @@ -931,7 +931,7 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) CHECK_LAST_FRAME(PING); return (f->md.ping.data); } - else if (!strcmp(spec, "ping.ack")) { + if (!strcmp(spec, "ping.ack")) { CHECK_LAST_FRAME(PING); snprintf(buf, 20, (f->flags & ACK) ? "true" : "false"); return (buf); @@ -940,7 +940,7 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) * winup.size * The size of the upgrade given by the WINDOW_UPDATE frame. */ - else if (!strcmp(spec, "winup.size")) { + if (!strcmp(spec, "winup.size")) { CHECK_LAST_FRAME(WINDOW_UPDATE); RETURN_BUFFED(f->md.winup_size); } @@ -954,16 +954,16 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) * prio.weight * The dependency weight. */ - else if (!strcmp(spec, "prio.stream")) { + if (!strcmp(spec, "prio.stream")) { CHECK_LAST_FRAME(PRIORITY); RETURN_BUFFED(f->md.prio.stream); } - else if (!strcmp(spec, "prio.exclusive")) { + if (!strcmp(spec, "prio.exclusive")) { CHECK_LAST_FRAME(PRIORITY); snprintf(buf, 20, f->md.prio.exclusive ? "true" : "false"); return (buf); } - else if (!strcmp(spec, "prio.weight")) { + if (!strcmp(spec, "prio.weight")) { CHECK_LAST_FRAME(PRIORITY); RETURN_BUFFED(f->md.prio.weight); } @@ -971,7 +971,7 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) * rst.err * The error code (as integer) of the RESET_STREAM frame. */ - else if (!strcmp(spec, "rst.err")) { + if (!strcmp(spec, "rst.err")) { CHECK_LAST_FRAME(RST_STREAM); RETURN_BUFFED(f->md.rst_err); } @@ -999,14 +999,14 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) * settings.hdrsize * Value of MAX_HEADER_LIST_SIZE if set, otherwise. */ - else if (!strncmp(spec, "settings.", 9)) { + if (!strncmp(spec, "settings.", 9)) { CHECK_LAST_FRAME(SETTINGS); spec += 9; if (!strcmp(spec, "ack")) { snprintf(buf, 20, (f->flags & ACK) ? "true" : "false"); return (buf); } - else if (!strcmp(spec, "push")) { + if (!strcmp(spec, "push")) { if (isnan(f->md.settings[2])) return (NULL); else if (f->md.settings[2] == 1) @@ -1015,17 +1015,17 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) snprintf(buf, 20, "false"); return (buf); } - else if (!strcmp(spec, "hdrtbl")) { RETURN_SETTINGS(1); } - else if (!strcmp(spec, "maxstreams")) { RETURN_SETTINGS(3); } - else if (!strcmp(spec, "winsize")) { RETURN_SETTINGS(4); } - else if (!strcmp(spec, "framesize")) { RETURN_SETTINGS(5); } - else if (!strcmp(spec, "hdrsize")) { RETURN_SETTINGS(6); } + if (!strcmp(spec, "hdrtbl")) { RETURN_SETTINGS(1); } + if (!strcmp(spec, "maxstreams")) { RETURN_SETTINGS(3); } + if (!strcmp(spec, "winsize")) { RETURN_SETTINGS(4); } + if (!strcmp(spec, "framesize")) { RETURN_SETTINGS(5); } + if (!strcmp(spec, "hdrsize")) { RETURN_SETTINGS(6); } } /* SECTION: stream.spec.zexpect.push PUSH_PROMISE specific * push.id * The id of the promised stream. */ - else if (!strcmp(spec, "push.id")) { + if (!strcmp(spec, "push.id")) { CHECK_LAST_FRAME(PUSH_PROMISE); RETURN_BUFFED(f->md.promised); } @@ -1039,7 +1039,7 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) * goaway.debug * Debug data, if any. */ - else if (!strncmp(spec, "goaway.", 7)) { + if (!strncmp(spec, "goaway.", 7)) { spec += 7; CHECK_LAST_FRAME(GOAWAY); @@ -1067,7 +1067,7 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) * frame.padding (for DATA, HEADERS, PUSH_PROMISE frames) * Number of padded bytes. */ - else if (!strncmp(spec, "frame.", 6)) { + if (!strncmp(spec, "frame.", 6)) { spec += 6; if (!f) vtc_fatal(s->hp->vl, "No frame received yet."); @@ -1096,19 +1096,19 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) * stream.dependency * Id of the stream this one depends on. */ - else if (!strcmp(spec, "stream.window")) { + if (!strcmp(spec, "stream.window")) { snprintf(buf, 20, "%jd", (intmax_t)(s->id ? s->ws : s->hp->ws)); return (buf); } - else if (!strcmp(spec, "stream.weight")) { + if (!strcmp(spec, "stream.weight")) { if (s->id) { snprintf(buf, 20, "%d", s->weight); return (buf); } else return (NULL); } - else if (!strcmp(spec, "stream.dependency")) { + if (!strcmp(spec, "stream.dependency")) { if (s->id) { snprintf(buf, 20, "%d", s->dependency); return (buf); @@ -1133,7 +1133,7 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) * Value of the header at index INT of the decoding/encoding * table. */ - else if (!strncmp(spec, "tbl.dec", 7) || !strncmp(spec, "tbl.enc", 7)) { + if (!strncmp(spec, "tbl.dec", 7) || !strncmp(spec, "tbl.enc", 7)) { if (spec[4] == 'd') ctx = s->hp->decctx; else @@ -1186,7 +1186,7 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) * req.scheme / resp.scheme * :method pseudo-header's value. */ - else if (!strncmp(spec, "req.", 4) || !strncmp(spec, "resp.", 5)) { + if (!strncmp(spec, "req.", 4) || !strncmp(spec, "resp.", 5)) { if (spec[2] == 'q') { h = s->req; spec += 4; @@ -1214,11 +1214,9 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf) return (NULL); } #define H2_ERROR(U,v,sc,t) \ - else if (!strcmp(spec, #U)) { return (#v); } + if (!strcmp(spec, #U)) { return (#v); } #include "tbl/h2_error.h" - else - return (spec); - return (NULL); + return (spec); } /* SECTION: stream.spec.frame_sendhex sendhex diff --git a/flint.lnt b/flint.lnt index aab7299..5f57bef 100644 --- a/flint.lnt +++ b/flint.lnt @@ -16,6 +16,8 @@ +libh(../../config.h) +-esym(768, vmod_priv) // global struct member '___' (___) not referenced + /////////////////////////////////////////////////////////////////////// // Thread/locking, too many false positives still -e454 // A thread mutex has been locked but not unlocked___ @@ -77,7 +79,6 @@ -esym(534, sleep) -esym(534, usleep) --esym(768, vmod_priv) // global struct member '___' (___) not referenced /////////////////////////////////////////////////////////////////////// // From phk at FreeBSD.org Wed Nov 1 11:07:05 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 1 Nov 2017 11:07:05 +0000 (UTC) Subject: [master] 0b95ce0 Include file and other polishing Message-ID: <20171101110705.B173FA6861@lists.varnish-cache.org> commit 0b95ce01636c7db9702956a87475851ffead0584 Author: Poul-Henning Kamp Date: Wed Nov 1 11:06:02 2017 +0000 Include file and other polishing diff --git a/include/vrt.h b/include/vrt.h index 391a9e3..2c661a0 100644 --- a/include/vrt.h +++ b/include/vrt.h @@ -193,19 +193,6 @@ struct vmod_data { }; /*********************************************************************** - * Enum for which HTTP header-sets we can access - */ - -enum gethdr_e { - HDR_REQ, - HDR_REQ_TOP, - HDR_RESP, - HDR_OBJ, - HDR_BEREQ, - HDR_BERESP -}; - -/*********************************************************************** * Enum for events sent to compiled VCL and from there to Vmods */ @@ -218,13 +205,6 @@ enum vcl_event_e { /***********************************************************************/ -struct gethdr_s { - enum gethdr_e where; - const char *what; -}; - -/***********************************************************************/ - extern const void * const vrt_magic_string_end; extern const void * const vrt_magic_string_unset; @@ -299,11 +279,8 @@ struct vrt_backend_probe { VRT_BACKEND_PROBE_FIELDS(const) }; -/***********************************************************************/ - -/* - * other stuff. - * XXX: document when bored +/*********************************************************************** + * VRT_count() refers to this structure for coordinates into the VCL source. */ struct vrt_ref { @@ -314,8 +291,11 @@ struct vrt_ref { const char *token; }; -/* ACL related */ -#define VRT_ACL_MAXADDR 16 /* max(IPv4, IPv6) */ +void VRT_count(VRT_CTX, unsigned); + +/*********************************************************************** + * Implementation details of ACLs + */ typedef int acl_match_f(VRT_CTX, const VCL_IP); @@ -325,28 +305,53 @@ struct vrt_acl { acl_match_f *match; }; -void VRT_acl_log(VRT_CTX, const char *msg); +void VRT_acl_log(VRT_CTX, const char *); int VRT_acl_match(VRT_CTX, VCL_ACL, VCL_IP); -/* req related */ +/*********************************************************************** + * Compile time regexp + */ + +void VRT_re_init(void **, const char *); +void VRT_re_fini(void *); +int VRT_re_match(VRT_CTX, const char *, void *); + +/*********************************************************************** + * Getting hold of the various struct http + */ + +enum gethdr_e { + HDR_REQ, + HDR_REQ_TOP, + HDR_RESP, + HDR_OBJ, + HDR_BEREQ, + HDR_BERESP +}; + +struct gethdr_s { + enum gethdr_e where; + const char *what; +}; + +struct http *VRT_selecthttp(VRT_CTX, enum gethdr_e); +const char *VRT_GetHdr(VRT_CTX, const struct gethdr_s *); + +/*********************************************************************** + * req related + */ VCL_BYTES VRT_CacheReqBody(VRT_CTX, VCL_BYTES maxsize); /* Regexp related */ -void VRT_re_init(void **, const char *); -void VRT_re_fini(void *); -int VRT_re_match(VRT_CTX, const char *, void *re); -const char *VRT_regsub(VRT_CTX, int all, const char *, void *, const char *); +const char *VRT_regsub(VRT_CTX, int all, const char *, void *, const char *); void VRT_ban_string(VRT_CTX, const char *); unsigned VRT_purge(VRT_CTX, double ttl, double grace, double keep); -void VRT_count(VRT_CTX, unsigned); void VRT_synth(VRT_CTX, unsigned, const char *); void VRT_hit_for_pass(VRT_CTX, VCL_DURATION); -struct http *VRT_selecthttp(VRT_CTX, enum gethdr_e); -const char *VRT_GetHdr(VRT_CTX, const struct gethdr_s *); void VRT_SetHdr(VRT_CTX, const struct gethdr_s *, const char *, ...); void VRT_handling(VRT_CTX, unsigned hand); void VRT_fail(VRT_CTX, const char *fmt, ...) __v_printflike(2,3); @@ -385,6 +390,8 @@ VCL_VCL VRT_vcl_get(VRT_CTX, const char *); void VRT_vcl_rel(VRT_CTX, VCL_VCL); void VRT_vcl_select(VRT_CTX, VCL_VCL); +typedef int vmod_event_f(VRT_CTX, struct vmod_priv *, enum vcl_event_e); + typedef void vmod_priv_free_f(void *); struct vmod_priv { void *priv; @@ -415,12 +422,6 @@ const char *VRT_BACKEND_string(VCL_BACKEND); const char *VRT_STEVEDORE_string(VCL_STEVEDORE); const char *VRT_CollectString(VRT_CTX, const char *p, ...); -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); -typedef int vmod_event_f(VRT_CTX, struct vmod_priv *, enum vcl_event_e); - #ifdef va_start // XXX: hackish void *VRT_VSC_Alloc(const char *, size_t, size_t, const unsigned char *, size_t, const char *, va_list); diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py index fa03724..d1c7dd4 100755 --- a/lib/libvcc/generate.py +++ b/lib/libvcc/generate.py @@ -1144,6 +1144,12 @@ fo.write("\n" + tbl40("#define VCL_RET_MAX", "%d\n" % n)) 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; #define VCL_CONF_MAGIC 0x7406c509 /* from /dev/random */ @@ -1151,7 +1157,7 @@ struct VCL_conf { struct director **default_director; const struct vrt_backend_probe *default_probe; unsigned nref; - struct vrt_ref *ref; + const struct vrt_ref *ref; unsigned nsrc; const char **srcname; @@ -1161,7 +1167,7 @@ struct VCL_conf { """) for i in returns: - fo.write("\tvcl_func_f\t*" + i[0] + "_func;\n") + fo.write("\tvcl_func_f\t\t\t*" + i[0] + "_func;\n") fo.write("\n};\n") fo.close() diff --git a/lib/libvcc/vcc_acl.c b/lib/libvcc/vcc_acl.c index 9dd361e..1c80487 100644 --- a/lib/libvcc/vcc_acl.c +++ b/lib/libvcc/vcc_acl.c @@ -39,9 +39,11 @@ #include "vcc_compile.h" +#define ACL_MAXADDR (sizeof(struct in6_addr) + 1) + struct acl_e { VTAILQ_ENTRY(acl_e) list; - unsigned char data[VRT_ACL_MAXADDR + 1]; + unsigned char data[ACL_MAXADDR]; unsigned mask; unsigned not; unsigned para; @@ -121,7 +123,8 @@ vcc_acl_add_entry(struct vcc *tl, const struct acl_e *ae, int l, aen->data[0] = fam & 0xff; aen->mask += 8; - memcpy(aen->data + 1, u, l); + assert(l + 1L <= sizeof aen->data); + memcpy(aen->data + 1L, u, l); VTAILQ_FOREACH(ae2, &tl->acl, list) { i = vcl_acl_cmp(aen, ae2); @@ -344,7 +347,7 @@ vcc_acl_emit(struct vcc *tl, const char *name, const char *rname, int anon) { struct acl_e *ae; int depth, l, m, i; - unsigned at[VRT_ACL_MAXADDR + 1]; + unsigned at[ACL_MAXADDR]; struct token *t; struct inifin *ifp; struct vsb *func; diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index 468a4c5..fcf1665 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -219,9 +219,9 @@ EmitCoordinates(const struct vcc *tl, struct vsb *vsb) VSB_printf(vsb, "/* ---===### Location Counters ###===---*/\n"); - VSB_printf(vsb, "\n#define VGC_NREFS %u\n", tl->cnt + 1); + VSB_printf(vsb, "\n#define VGC_NREFS %u\n\n", tl->cnt + 1); - VSB_printf(vsb, "\nstatic struct vrt_ref VGC_ref[VGC_NREFS] = {\n"); + VSB_printf(vsb, "static const struct vrt_ref VGC_ref[VGC_NREFS] = {\n"); lin = 1; pos = 0; sp = 0; diff --git a/tools/include_wash.py b/tools/include_wash.py index 6dd12f6..1284e30 100644 --- a/tools/include_wash.py +++ b/tools/include_wash.py @@ -28,7 +28,7 @@ def check(fn): for i in ("stddef.h", "stdint.h", "cache/cache.h", "cache.h"): if i in l: print(fn, i + " included with vrt.h") - + for i in ("cache/cache.h", "cache.h"): if i in l: for i in ( From nils.goroll at uplex.de Thu Nov 2 10:47:05 2017 From: nils.goroll at uplex.de (Nils Goroll) Date: Thu, 2 Nov 2017 10:47:05 +0000 (UTC) Subject: [master] 97781c1 mark a minor issue Message-ID: <20171102104705.8BB71A7229@lists.varnish-cache.org> commit 97781c12146a16ad75439ccec681807115d6d7c0 Author: Nils Goroll Date: Thu Nov 2 11:31:25 2017 +0100 mark a minor issue diff --git a/bin/varnishd/http1/cache_http1_line.c b/bin/varnishd/http1/cache_http1_line.c index 476c8e3..cb86c83 100644 --- a/bin/varnishd/http1/cache_http1_line.c +++ b/bin/varnishd/http1/cache_http1_line.c @@ -30,6 +30,11 @@ * We try to use writev() if possible in order to minimize number of * syscalls made and packets sent. It also just might allow the worker * thread to complete the request without holding stuff locked. + * + * XXX: chunked header (generated in Flush) and Tail (EndChunk) + * are not accounted by means of the size_t returned. Obvious ideas: + * - add size_t return value to Flush and EndChunk + * - base accounting on (struct v1l).cnt */ #include "config.h" From phk at FreeBSD.org Thu Nov 2 12:02:25 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 2 Nov 2017 12:02:25 +0000 (UTC) Subject: [master] 0245af8 Add an optional $Prefix stanza, which substitutes another string for the default symbolname prefix ("vmod_") Message-ID: <20171102120225.17947A799B@lists.varnish-cache.org> commit 0245af844aeb386c3cb8c8be98cf54f53366fa86 Author: Poul-Henning Kamp Date: Thu Nov 2 07:12:12 2017 +0000 Add an optional $Prefix stanza, which substitutes another string for the default symbolname prefix ("vmod_") diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py index 6e40650..6698a9d 100755 --- a/lib/libvcc/vmodtool.py +++ b/lib/libvcc/vmodtool.py @@ -434,7 +434,7 @@ class s_module(stanza): def rsthead(self, fo, man): - write_rst_hdr(fo, "vmod_" + self.vcc.modname, "=", "=") + write_rst_hdr(fo, self.vcc.sympfx + self.vcc.modname, "=", "=") fo.write("\n") write_rst_hdr(fo, self.vcc.moddesc, "-", "-") @@ -486,6 +486,11 @@ class s_abi(stanza): strict_abi = self.line[1] == 'strict' self.vcc.contents.append(self) +class s_prefix(stanza): + def parse(self): + self.vcc.sympfx = self.line[1] + "_" + self.vcc.contents.append(self) + class s_event(stanza): def parse(self): self.event_func = self.line[1] @@ -516,7 +521,7 @@ class s_function(stanza): self.vcc.contents.append(self) def hfile(self, fo): - fn = "vmod_" + self.proto.name + fn = self.vcc.sympfx + self.proto.name s = "%s %s(VRT_CTX" % (self.proto.c_ret(), fn) s += self.proto.c_args() + ");" for i in lwrap(s): @@ -533,7 +538,7 @@ class s_function(stanza): fmt_cstruct(fo, self.vcc.modname, self.proto.cname()) def cstruct_init(self, fo): - fo.write("\tvmod_" + self.proto.cname() + ",\n") + fo.write("\t" + self.vcc.sympfx + self.proto.cname() + ",\n") def specstr(self, fo): fo.write('\t"$FUNC\\0"\t"%s.%s\\0"\n\n' % @@ -567,12 +572,12 @@ class s_object(stanza): return def chfile(self, fo, h): - sn = "vmod_" + self.vcc.modname + "_" + self.proto.name + sn = self.vcc.sympfx + self.vcc.modname + "_" + self.proto.name fo.write("struct %s;\n" % sn) if h: def p(x): - return x + " vmod_" + return x + " " + self.vcc.sympfx else: def p(x): return "typedef " + x + \ @@ -611,7 +616,7 @@ class s_object(stanza): i.cstruct(fo) def cstruct_init(self, fo): - p = "\tvmod_" + p = "\t" + self.vcc.sympfx fo.write(p + self.proto.name + "__init,\n") fo.write(p + self.proto.name + "__fini,\n") for i in self.methods: @@ -623,8 +628,8 @@ class s_object(stanza): fo.write('\t"$OBJ\\0"\t"%s.%s\\0"\n\n' % (self.vcc.modname, self.proto.name)) - fo.write('\t "struct vmod_%s_%s\\0"\n' % - (self.vcc.modname, self.proto.name)) + fo.write('\t "struct %s%s_%s\\0"\n' % + (self.vcc.sympfx, self.vcc.modname, self.proto.name)) fo.write("\n") self.proto.specstr(fo, 'Vmod_%s_Func.%s__init' % @@ -659,7 +664,7 @@ class s_method(stanza): fmt_cstruct(fo, self.vcc.modname, self.proto.cname()) def cstruct_init(self, fo): - fo.write('\t' + "vmod_" + self.proto.cname() + ",\n") + fo.write('\t' + self.vcc.sympfx + self.proto.cname() + ",\n") def specstr(self, fo): fo.write('\t "%s.%s\\0"\n' % @@ -675,6 +680,7 @@ class vcc(object): self.inputfile = inputvcc self.rstdir = rstdir self.pfx = outputprefix + self.sympfx = "vmod_" self.contents = [] self.commit_files = [] self.copyright = None @@ -701,6 +707,8 @@ class vcc(object): err("$Module must be first stanze") if c[0] == "Module": s_module(c, b[1:], self) + elif c[0] == "Prefix": + s_prefix(c, b[1:], self) elif c[0] == "ABI": s_abi(c, b[1:], self) elif c[0] == "Event": From phk at FreeBSD.org Thu Nov 2 12:02:07 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 2 Nov 2017 12:02:07 +0000 (UTC) Subject: [master] 483bc96 Flexelinting Message-ID: <20171102120225.064A9A7999@lists.varnish-cache.org> commit 483bc96522f5cfc4045bd5e0fbb06b915222d079 Author: Poul-Henning Kamp Date: Thu Nov 2 06:52:06 2017 +0000 Flexelinting diff --git a/bin/varnishd/http2/cache_http2.h b/bin/varnishd/http2/cache_http2.h index fd720e6..2883789 100644 --- a/bin/varnishd/http2/cache_http2.h +++ b/bin/varnishd/http2/cache_http2.h @@ -223,7 +223,7 @@ h2_error H2_Send(struct worker *, struct h2_req *, /* cache_http2_proto.c */ struct h2_req * h2_new_req(const struct worker *, struct h2_sess *, unsigned stream, struct req *); -void h2_del_req(struct worker *, struct h2_req *); +void h2_del_req(struct worker *, const struct h2_req *); void h2_kill_req(struct worker *, const struct h2_sess *, struct h2_req *, h2_error); int h2_rxframe(struct worker *, struct h2_sess *); diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c index 0358acd..90b4b6d 100644 --- a/bin/varnishd/http2/cache_http2_proto.c +++ b/bin/varnishd/http2/cache_http2_proto.c @@ -161,7 +161,7 @@ h2_new_req(const struct worker *wrk, struct h2_sess *h2, } void -h2_del_req(struct worker *wrk, struct h2_req *r2) +h2_del_req(struct worker *wrk, const struct h2_req *r2) { struct h2_sess *h2; struct sess *sp; diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c index 5ed5cd0..6b0586d 100644 --- a/lib/libvmod_debug/vmod_debug.c +++ b/lib/libvmod_debug/vmod_debug.c @@ -396,6 +396,10 @@ vmod_workspace_allocate(VRT_CTX, VCL_ENUM which, VCL_INT size) size += WS_Reserve(ws, 0); WS_Release(ws, 0); } + if (size <= 0) { + VRT_fail(ctx, "Attempted negative WS allocation"); + return; + } s = WS_Alloc(ws, size); if (!s) return; diff --git a/lib/libvmod_vtc/vmod_vtc.c b/lib/libvmod_vtc/vmod_vtc.c index 9f8bbf9..04e79c6 100644 --- a/lib/libvmod_vtc/vmod_vtc.c +++ b/lib/libvmod_vtc/vmod_vtc.c @@ -151,7 +151,10 @@ vmod_workspace_alloc(VRT_CTX, VCL_ENUM which, VCL_INT size) size += WS_Reserve(ws, 0); WS_Release(ws, 0); } - + if (size <= 0) { + VRT_fail(ctx, "Attempted negative WS allocation"); + return; + } p = WS_Alloc(ws, size); if (p == NULL) VRT_fail(ctx, "vtc.workspace_alloc"); From phk at FreeBSD.org Thu Nov 2 12:02:25 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 2 Nov 2017 12:02:25 +0000 (UTC) Subject: [master] 7cdb71a Use $Prefix to avoid symbol clashes with libvmod_vtc Message-ID: <20171102120225.3503FA799E@lists.varnish-cache.org> commit 7cdb71aa00444001f58cd3828282bf627ff39b80 Author: Poul-Henning Kamp Date: Thu Nov 2 07:16:10 2017 +0000 Use $Prefix to avoid symbol clashes with libvmod_vtc diff --git a/lib/libvmod_debug/vmod.vcc b/lib/libvmod_debug/vmod.vcc index 324d389..b33e0d9 100644 --- a/lib/libvmod_debug/vmod.vcc +++ b/lib/libvmod_debug/vmod.vcc @@ -27,6 +27,7 @@ $Module debug 3 Development, test and debug $ABI strict +$Prefix xyzzy DESCRIPTION =========== diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c index 6b0586d..74718e7 100644 --- a/lib/libvmod_debug/vmod_debug.c +++ b/lib/libvmod_debug/vmod_debug.c @@ -65,7 +65,7 @@ struct priv_vcl { static VCL_DURATION vcl_release_delay = 0.0; VCL_VOID __match_proto__(td_debug_panic) -vmod_panic(VRT_CTX, const char *str, ...) +xyzzy_panic(VRT_CTX, const char *str, ...) { va_list ap; const char *b; @@ -79,7 +79,7 @@ vmod_panic(VRT_CTX, const char *str, ...) } VCL_STRING __match_proto__(td_debug_author) -vmod_author(VRT_CTX, VCL_ENUM person, VCL_ENUM someone) +xyzzy_author(VRT_CTX, VCL_ENUM person, VCL_ENUM someone) { (void)someone; @@ -96,7 +96,7 @@ vmod_author(VRT_CTX, VCL_ENUM person, VCL_ENUM someone) } VCL_VOID __match_proto__(td_debug_test_priv_call) -vmod_test_priv_call(VRT_CTX, struct vmod_priv *priv) +xyzzy_test_priv_call(VRT_CTX, struct vmod_priv *priv) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -109,7 +109,7 @@ vmod_test_priv_call(VRT_CTX, struct vmod_priv *priv) } VCL_STRING __match_proto__(td_debug_test_priv_task) -vmod_test_priv_task(VRT_CTX, struct vmod_priv *priv, VCL_STRING s) +xyzzy_test_priv_task(VRT_CTX, struct vmod_priv *priv, VCL_STRING s) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -131,7 +131,7 @@ vmod_test_priv_task(VRT_CTX, struct vmod_priv *priv, VCL_STRING s) } VCL_STRING __match_proto__(td_debug_test_priv_top) -vmod_test_priv_top(VRT_CTX, struct vmod_priv *priv, VCL_STRING s) +xyzzy_test_priv_top(VRT_CTX, struct vmod_priv *priv, VCL_STRING s) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -143,7 +143,7 @@ vmod_test_priv_top(VRT_CTX, struct vmod_priv *priv, VCL_STRING s) } VCL_VOID __match_proto__(td_debug_test_priv_vcl) -vmod_test_priv_vcl(VRT_CTX, struct vmod_priv *priv) +xyzzy_test_priv_vcl(VRT_CTX, struct vmod_priv *priv) { struct priv_vcl *priv_vcl; @@ -155,7 +155,7 @@ vmod_test_priv_vcl(VRT_CTX, struct vmod_priv *priv) } VCL_BACKEND -vmod_no_backend(VRT_CTX) +xyzzy_no_backend(VRT_CTX) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -164,7 +164,7 @@ vmod_no_backend(VRT_CTX) } VCL_STEVEDORE __match_proto__(td_debug_no_stevedore) -vmod_no_stevedore(VRT_CTX) +xyzzy_no_stevedore(VRT_CTX) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -173,7 +173,7 @@ vmod_no_stevedore(VRT_CTX) } VCL_VOID __match_proto__(td_debug_rot52) -vmod_rot52(VRT_CTX, VCL_HTTP hp) +xyzzy_rot52(VRT_CTX, VCL_HTTP hp) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -183,7 +183,7 @@ vmod_rot52(VRT_CTX, VCL_HTTP hp) } VCL_STRING __match_proto__(td_debug_argtest) -vmod_argtest(VRT_CTX, VCL_STRING one, VCL_REAL two, VCL_STRING three, +xyzzy_argtest(VRT_CTX, VCL_STRING one, VCL_REAL two, VCL_STRING three, VCL_STRING comma, VCL_INT four) { char buf[100]; @@ -193,7 +193,7 @@ vmod_argtest(VRT_CTX, VCL_STRING one, VCL_REAL two, VCL_STRING three, } VCL_INT __match_proto__(td_debug_vre_limit) -vmod_vre_limit(VRT_CTX) +xyzzy_vre_limit(VRT_CTX) { (void)ctx; return (cache_param->vre_limits.match); @@ -220,7 +220,7 @@ obj_cb(struct worker *wrk, void *priv, struct objcore *oc, unsigned event) } VCL_VOID __match_proto__(td_debug_register_obj_events) -vmod_register_obj_events(VRT_CTX, struct vmod_priv *priv) +xyzzy_register_obj_events(VRT_CTX, struct vmod_priv *priv) { struct priv_vcl *priv_vcl; @@ -233,7 +233,7 @@ vmod_register_obj_events(VRT_CTX, struct vmod_priv *priv) } VCL_VOID __match_proto__(td_debug_fail) -vmod_fail(VRT_CTX) +xyzzy_fail(VRT_CTX) { VRT_fail(ctx, "Forced failure"); @@ -356,7 +356,7 @@ event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) } VCL_VOID __match_proto__(td_debug_sleep) -vmod_sleep(VRT_CTX, VCL_DURATION t) +xyzzy_sleep(VRT_CTX, VCL_DURATION t) { CHECK_OBJ_ORNULL(ctx, VRT_CTX_MAGIC); @@ -380,7 +380,7 @@ wsfind(VRT_CTX, VCL_ENUM which) } void -vmod_workspace_allocate(VRT_CTX, VCL_ENUM which, VCL_INT size) +xyzzy_workspace_allocate(VRT_CTX, VCL_ENUM which, VCL_INT size) { struct ws *ws; char *s; @@ -407,7 +407,7 @@ vmod_workspace_allocate(VRT_CTX, VCL_ENUM which, VCL_INT size) } VCL_INT -vmod_workspace_free(VRT_CTX, VCL_ENUM which) +xyzzy_workspace_free(VRT_CTX, VCL_ENUM which) { struct ws *ws; unsigned u; @@ -425,7 +425,7 @@ vmod_workspace_free(VRT_CTX, VCL_ENUM which) } VCL_BOOL -vmod_workspace_overflowed(VRT_CTX, VCL_ENUM which) +xyzzy_workspace_overflowed(VRT_CTX, VCL_ENUM which) { struct ws *ws; CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -440,7 +440,7 @@ vmod_workspace_overflowed(VRT_CTX, VCL_ENUM which) static uintptr_t debug_ws_snap; void -vmod_workspace_snap(VRT_CTX, VCL_ENUM which) +xyzzy_workspace_snap(VRT_CTX, VCL_ENUM which) { struct ws *ws; CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -453,7 +453,7 @@ vmod_workspace_snap(VRT_CTX, VCL_ENUM which) } void -vmod_workspace_reset(VRT_CTX, VCL_ENUM which) +xyzzy_workspace_reset(VRT_CTX, VCL_ENUM which) { struct ws *ws; CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -466,7 +466,7 @@ vmod_workspace_reset(VRT_CTX, VCL_ENUM which) } void -vmod_workspace_overflow(VRT_CTX, VCL_ENUM which) +xyzzy_workspace_overflow(VRT_CTX, VCL_ENUM which) { struct ws *ws; CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -479,7 +479,7 @@ vmod_workspace_overflow(VRT_CTX, VCL_ENUM which) } VCL_VOID __match_proto__(td_debug_vcl_release_delay) -vmod_vcl_release_delay(VRT_CTX, VCL_DURATION delay) +xyzzy_vcl_release_delay(VRT_CTX, VCL_DURATION delay) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -488,7 +488,7 @@ vmod_vcl_release_delay(VRT_CTX, VCL_DURATION delay) } VCL_BOOL __match_proto__(td_debug_match_acl) -vmod_match_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip) +xyzzy_match_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip) { CHECK_OBJ_ORNULL(ctx, VRT_CTX_MAGIC); @@ -499,7 +499,7 @@ vmod_match_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip) } VCL_BOOL -vmod_barrier_sync(VRT_CTX, VCL_STRING addr) +xyzzy_barrier_sync(VRT_CTX, VCL_STRING addr) { const char *err; char buf[32]; @@ -532,7 +532,7 @@ vmod_barrier_sync(VRT_CTX, VCL_STRING addr) } VCL_VOID __match_proto__(td_debug_test_probe) -vmod_test_probe(VRT_CTX, VCL_PROBE probe, VCL_PROBE same) +xyzzy_test_probe(VRT_CTX, VCL_PROBE probe, VCL_PROBE same) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -542,7 +542,7 @@ vmod_test_probe(VRT_CTX, VCL_PROBE probe, VCL_PROBE same) } VCL_INT -vmod_typesize(VRT_CTX, VCL_STRING s) +xyzzy_typesize(VRT_CTX, VCL_STRING s) { size_t i = 0; const char *p; diff --git a/lib/libvmod_debug/vmod_debug_dyn.c b/lib/libvmod_debug/vmod_debug_dyn.c index 8742ff9..ad2dd29 100644 --- a/lib/libvmod_debug/vmod_debug_dyn.c +++ b/lib/libvmod_debug/vmod_debug_dyn.c @@ -39,7 +39,7 @@ #include "vsa.h" #include "vcc_if.h" -struct vmod_debug_dyn { +struct xyzzy_debug_dyn { unsigned magic; #define VMOD_DEBUG_DYN_MAGIC 0x9b77ccbd pthread_mutex_t mtx; @@ -48,7 +48,7 @@ struct vmod_debug_dyn { }; static void -dyn_dir_init(VRT_CTX, struct vmod_debug_dyn *dyn, +dyn_dir_init(VRT_CTX, struct xyzzy_debug_dyn *dyn, VCL_STRING addr, VCL_STRING port) { struct addrinfo hints, *res = NULL; @@ -104,10 +104,10 @@ dyn_dir_init(VRT_CTX, struct vmod_debug_dyn *dyn, } VCL_VOID -vmod_dyn__init(VRT_CTX, struct vmod_debug_dyn **dynp, +xyzzy_dyn__init(VRT_CTX, struct xyzzy_debug_dyn **dynp, const char *vcl_name, VCL_STRING addr, VCL_STRING port) { - struct vmod_debug_dyn *dyn; + struct xyzzy_debug_dyn *dyn; ASSERT_CLI(); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -134,9 +134,9 @@ vmod_dyn__init(VRT_CTX, struct vmod_debug_dyn **dynp, } VCL_VOID -vmod_dyn__fini(struct vmod_debug_dyn **dynp) +xyzzy_dyn__fini(struct xyzzy_debug_dyn **dynp) { - struct vmod_debug_dyn *dyn; + struct xyzzy_debug_dyn *dyn; AN(dynp); if (*dynp == NULL) @@ -151,7 +151,7 @@ vmod_dyn__fini(struct vmod_debug_dyn **dynp) } VCL_BACKEND __match_proto__() -vmod_dyn_backend(VRT_CTX, struct vmod_debug_dyn *dyn) +xyzzy_dyn_backend(VRT_CTX, struct xyzzy_debug_dyn *dyn) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(dyn, VMOD_DEBUG_DYN_MAGIC); @@ -160,7 +160,7 @@ vmod_dyn_backend(VRT_CTX, struct vmod_debug_dyn *dyn) } VCL_VOID -vmod_dyn_refresh(VRT_CTX, struct vmod_debug_dyn *dyn, +xyzzy_dyn_refresh(VRT_CTX, struct xyzzy_debug_dyn *dyn, VCL_STRING addr, VCL_STRING port) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); diff --git a/lib/libvmod_debug/vmod_debug_obj.c b/lib/libvmod_debug/vmod_debug_obj.c index 3364092..63f2e44 100644 --- a/lib/libvmod_debug/vmod_debug_obj.c +++ b/lib/libvmod_debug/vmod_debug_obj.c @@ -35,7 +35,7 @@ #include "vcc_if.h" -struct vmod_debug_obj { +struct xyzzy_debug_obj { unsigned magic; #define VMOD_DEBUG_OBJ_MAGIC 0xccbd9b77 int foobar; @@ -43,10 +43,10 @@ struct vmod_debug_obj { }; VCL_VOID -vmod_obj__init(VRT_CTX, struct vmod_debug_obj **op, +xyzzy_obj__init(VRT_CTX, struct xyzzy_debug_obj **op, const char *vcl_name, VCL_STRING s, VCL_ENUM e) { - struct vmod_debug_obj *o; + struct xyzzy_debug_obj *o; CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); (void)vcl_name; @@ -62,7 +62,7 @@ vmod_obj__init(VRT_CTX, struct vmod_debug_obj **op, } VCL_VOID -vmod_obj__fini(struct vmod_debug_obj **op) +xyzzy_obj__fini(struct xyzzy_debug_obj **op) { AN(op); @@ -72,7 +72,7 @@ vmod_obj__fini(struct vmod_debug_obj **op) } VCL_VOID __match_proto__() -vmod_obj_enum(VRT_CTX, struct vmod_debug_obj *o, VCL_ENUM e) +xyzzy_obj_enum(VRT_CTX, struct xyzzy_debug_obj *o, VCL_ENUM e) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -81,7 +81,7 @@ vmod_obj_enum(VRT_CTX, struct vmod_debug_obj *o, VCL_ENUM e) } VCL_STRING __match_proto__() -vmod_obj_foo(VRT_CTX, struct vmod_debug_obj *o, VCL_STRING s) +xyzzy_obj_foo(VRT_CTX, struct xyzzy_debug_obj *o, VCL_STRING s) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -92,7 +92,7 @@ vmod_obj_foo(VRT_CTX, struct vmod_debug_obj *o, VCL_STRING s) } VCL_TIME __match_proto__() -vmod_obj_date(VRT_CTX, struct vmod_debug_obj *o) +xyzzy_obj_date(VRT_CTX, struct xyzzy_debug_obj *o) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -102,7 +102,7 @@ vmod_obj_date(VRT_CTX, struct vmod_debug_obj *o) } VCL_STRING __match_proto__() -vmod_obj_string(VRT_CTX, struct vmod_debug_obj *o) +xyzzy_obj_string(VRT_CTX, struct xyzzy_debug_obj *o) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -112,7 +112,7 @@ vmod_obj_string(VRT_CTX, struct vmod_debug_obj *o) } VCL_STRING __match_proto__() -vmod_obj_number(VRT_CTX, struct vmod_debug_obj *o) +xyzzy_obj_number(VRT_CTX, struct xyzzy_debug_obj *o) { CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); @@ -122,30 +122,30 @@ vmod_obj_number(VRT_CTX, struct vmod_debug_obj *o) } VCL_VOID __match_proto__() -vmod_obj_test_priv_call(VRT_CTX, - struct vmod_debug_obj *o, struct vmod_priv *priv) +xyzzy_obj_test_priv_call(VRT_CTX, + struct xyzzy_debug_obj *o, struct vmod_priv *priv) { (void)o; - vmod_test_priv_call(ctx, priv); + xyzzy_test_priv_call(ctx, priv); } VCL_VOID __match_proto__() -vmod_obj_test_priv_vcl(VRT_CTX, - struct vmod_debug_obj *o, struct vmod_priv *priv) +xyzzy_obj_test_priv_vcl(VRT_CTX, + struct xyzzy_debug_obj *o, struct vmod_priv *priv) { (void)o; - vmod_test_priv_vcl(ctx, priv); + xyzzy_test_priv_vcl(ctx, priv); } VCL_STRING __match_proto__() -vmod_obj_test_priv_task(VRT_CTX, - struct vmod_debug_obj *o, struct vmod_priv *priv, VCL_STRING s) +xyzzy_obj_test_priv_task(VRT_CTX, + struct xyzzy_debug_obj *o, struct vmod_priv *priv, VCL_STRING s) { (void)o; - return (vmod_test_priv_task(ctx, priv, s)); + return (xyzzy_test_priv_task(ctx, priv, s)); } VCL_STRING __match_proto__() -vmod_obj_test_priv_top(VRT_CTX, - struct vmod_debug_obj *o, struct vmod_priv *priv, VCL_STRING s) +xyzzy_obj_test_priv_top(VRT_CTX, + struct xyzzy_debug_obj *o, struct vmod_priv *priv, VCL_STRING s) { (void)o; - return (vmod_test_priv_top(ctx, priv, s)); + return (xyzzy_test_priv_top(ctx, priv, s)); } From phk at FreeBSD.org Thu Nov 2 12:02:25 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 2 Nov 2017 12:02:25 +0000 (UTC) Subject: [master] f80e7da Include all in-tree vmods Message-ID: <20171102120225.51812A79A1@lists.varnish-cache.org> commit f80e7da92b66307f3f1938301aabe3316f2bc44c Author: Poul-Henning Kamp Date: Thu Nov 2 07:16:37 2017 +0000 Include all in-tree vmods diff --git a/bin/varnishd/flint.sh b/bin/varnishd/flint.sh index 1de11ce..0be99fc 100755 --- a/bin/varnishd/flint.sh +++ b/bin/varnishd/flint.sh @@ -19,12 +19,18 @@ FLOPS=' ../../lib/libvarnish/*.c ../../lib/libvcc/flint.lnt ../../lib/libvcc/*.c - ../../lib/libvmod_std/flint.lnt - ../../lib/libvmod_std/*.c + ../../lib/libvmod_blob/flint.lnt + ../../lib/libvmod_blob/*.c ../../lib/libvmod_debug/flint.lnt ../../lib/libvmod_debug/*.c ../../lib/libvmod_directors/flint.lnt ../../lib/libvmod_directors/*.c + ../../lib/libvmod_purge/flint.lnt + ../../lib/libvmod_purge/*.c + ../../lib/libvmod_std/flint.lnt + ../../lib/libvmod_std/*.c + ../../lib/libvmod_vtc/flint.lnt + ../../lib/libvmod_vtc/*.c ' . ../../tools/flint_skel.sh From phk at FreeBSD.org Thu Nov 2 12:02:25 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 2 Nov 2017 12:02:25 +0000 (UTC) Subject: [master] f4d0280 Return early on failure Message-ID: <20171102120225.6F226A79A4@lists.varnish-cache.org> commit f4d02803c5dfded27b446d39039dc02f02b3717c Author: Poul-Henning Kamp Date: Thu Nov 2 07:44:16 2017 +0000 Return early on failure diff --git a/lib/libvmod_vtc/vmod_vtc.c b/lib/libvmod_vtc/vmod_vtc.c index 04e79c6..e8fbf61 100644 --- a/lib/libvmod_vtc/vmod_vtc.c +++ b/lib/libvmod_vtc/vmod_vtc.c @@ -145,6 +145,8 @@ vmod_workspace_alloc(VRT_CTX, VCL_ENUM which, VCL_INT size) CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); ws = vtc_ws_find(ctx, which); + if (ws == NULL) + return; WS_Assert(ws); if (size < 0) { @@ -171,6 +173,8 @@ vmod_workspace_free(VRT_CTX, VCL_ENUM which) CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); ws = vtc_ws_find(ctx, which); + if (ws == NULL) + return(-1); WS_Assert(ws); u = WS_Reserve(ws, 0); @@ -178,7 +182,7 @@ vmod_workspace_free(VRT_CTX, VCL_ENUM which) return (u); } -#define VTC_WS_OP(type, name, op) \ +#define VTC_WS_OP(type, def, name, op) \ VCL_##type __match_proto__(td_vtc_workspace_##name) \ vmod_workspace_##name(VRT_CTX, VCL_ENUM which) \ { \ @@ -187,14 +191,16 @@ vmod_workspace_##name(VRT_CTX, VCL_ENUM which) \ CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); \ \ ws = vtc_ws_find(ctx, which); \ + if (ws == NULL) \ + return def ; \ WS_Assert(ws); \ \ op; \ } -VTC_WS_OP(VOID, snapshot, (vtc_ws_snapshot = WS_Snapshot(ws))) -VTC_WS_OP(VOID, reset, WS_Reset(ws, vtc_ws_snapshot)) -VTC_WS_OP(VOID, overflow, WS_MarkOverflow(ws)) -VTC_WS_OP(BOOL, overflowed, return (WS_Overflowed(ws))) +VTC_WS_OP(VOID, , snapshot, (vtc_ws_snapshot = WS_Snapshot(ws))) +VTC_WS_OP(VOID, , reset, WS_Reset(ws, vtc_ws_snapshot)) +VTC_WS_OP(VOID, , overflow, WS_MarkOverflow(ws)) +VTC_WS_OP(BOOL, (0), overflowed, return (WS_Overflowed(ws))) #undef VTC_WS_OP /*--------------------------------------------------------------------*/ From phk at FreeBSD.org Thu Nov 2 12:02:25 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 2 Nov 2017 12:02:25 +0000 (UTC) Subject: [master] cc49731 Fix comparison Message-ID: <20171102120225.951DEA79A7@lists.varnish-cache.org> commit cc497311fb900fd8ad505c716876c6231b9d5c23 Author: Poul-Henning Kamp Date: Thu Nov 2 07:44:54 2017 +0000 Fix comparison diff --git a/lib/libvmod_blob/url.c b/lib/libvmod_blob/url.c index deb7355..7babb18 100644 --- a/lib/libvmod_blob/url.c +++ b/lib/libvmod_blob/url.c @@ -127,7 +127,7 @@ url_decode(const enum encoding dec, char *restrict const buf, AN(buf); assert(dec == URL); - if (n >= 0 && n < len) + if (n >= 0 && (size_t)n < len) len = n; for (const char *s = p; len > 0 && s != vrt_magic_string_end; From dridi at varni.sh Thu Nov 2 12:09:36 2017 From: dridi at varni.sh (Dridi Boukelmoune) Date: Thu, 2 Nov 2017 13:09:36 +0100 Subject: [master] f4d0280 Return early on failure In-Reply-To: <20171102120225.6F226A79A4@lists.varnish-cache.org> References: <20171102120225.6F226A79A4@lists.varnish-cache.org> Message-ID: On Thu, Nov 2, 2017 at 1:02 PM, Poul-Henning Kamp wrote: > > commit f4d02803c5dfded27b446d39039dc02f02b3717c > Author: Poul-Henning Kamp > Date: Thu Nov 2 07:44:16 2017 +0000 > > Return early on failure You might want to VRT_fail before returning too. Dridi From nils.goroll at uplex.de Thu Nov 2 13:12:06 2017 From: nils.goroll at uplex.de (Nils Goroll) Date: Thu, 2 Nov 2017 13:12:06 +0000 (UTC) Subject: [master] 6155df1 cleanup Message-ID: <20171102131206.DB28EA754F@lists.varnish-cache.org> commit 6155df1eee573bd7325d9155084d40e858530021 Author: Nils Goroll Date: Thu Nov 2 14:10:26 2017 +0100 cleanup diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_vrt.c index 7f95ccb..b975485 100644 --- a/bin/varnishd/cache/cache_vrt.c +++ b/bin/varnishd/cache/cache_vrt.c @@ -547,7 +547,7 @@ VRT_purge(VRT_CTX, double ttl, double grace, double keep) CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); - if (ctx->method != VCL_MET_HIT && ctx->method != VCL_MET_MISS) { + if ((ctx->method & (VCL_MET_HIT|VCL_MET_MISS)) == 0) { VSLb(ctx->vsl, SLT_VCL_Error, "purge can only happen in vcl_hit{} or vcl_miss{}"); VRT_handling(ctx, VCL_RET_FAIL); From nils.goroll at uplex.de Thu Nov 2 13:51:06 2017 From: nils.goroll at uplex.de (Nils Goroll) Date: Thu, 2 Nov 2017 13:51:06 +0000 (UTC) Subject: [master] 2e5f359 convenience masks for checking ctx->method against task Message-ID: <20171102135106.EB941A72A2@lists.varnish-cache.org> commit 2e5f359858176b0ce6b14ea8a7daf4b487c1b1d8 Author: Nils Goroll Date: Thu Nov 2 14:47:12 2017 +0100 convenience masks for checking ctx->method against task diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py index d1c7dd4..2ff3857 100755 --- a/lib/libvcc/generate.py +++ b/lib/libvcc/generate.py @@ -1125,14 +1125,23 @@ def tbl40(a, b): return a + b fo.write("\n/* VCL Methods */\n") +task = {} n = 1 for i in returns: fo.write(tbl40("#define VCL_MET_%s" % i[0].upper(), "(1U << %d)\n" % n)) + if not i[1] in task: + task[i[1]] = [] + task[i[1]].append("VCL_MET_" + i[0].upper()) n += 1 fo.write("\n" + tbl40("#define VCL_MET_MAX", "%d\n" % n)) fo.write("\n" + tbl40("#define VCL_MET_MASK", "0x%x\n" % ((1 << n) - 1))) +fo.write("\n") +for i in sorted(task.keys()): + fo.write(tbl40("#define VCL_MET_TASK_%s" % i.upper(), + "( " + (" | \\\n%42s" % "").join(task[i]) + " )\n")) + fo.write("\n/* VCL Returns */\n") n = 1 From phk at FreeBSD.org Thu Nov 2 15:06:07 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 2 Nov 2017 15:06:07 +0000 (UTC) Subject: [master] 8aa382f Flexelinting Message-ID: <20171102150607.BEA46A7B45@lists.varnish-cache.org> commit 8aa382fe436c0fe9e120c69201b4c3b6899b301f Author: Poul-Henning Kamp Date: Thu Nov 2 15:04:07 2017 +0000 Flexelinting diff --git a/lib/libvmod_blob/hex.c b/lib/libvmod_blob/hex.c index b65b07e..4124100 100644 --- a/lib/libvmod_blob/hex.c +++ b/lib/libvmod_blob/hex.c @@ -106,6 +106,7 @@ hex_decode(const enum encoding dec, char *restrict const buf, const char *restrict const p, va_list ap) { char *dest = buf; + const char *b; unsigned char extranib = 0; ssize_t len = 0; va_list ap2; @@ -116,13 +117,15 @@ hex_decode(const enum encoding dec, char *restrict const buf, va_copy(ap2, ap); for (const char *s = p; s != vrt_magic_string_end; s = va_arg(ap2, const char *)) { - const char *b = s; - if (s != NULL) - while (*s) - if (!isxdigit(*s++)) { - len = -1; - break; - } + if (s == NULL) + continue; + b = s; + while (*s) { + if (!isxdigit(*s++)) { + len = -1; + break; + } + } if (len == -1) break; len += s - b; From phk at FreeBSD.org Thu Nov 2 15:45:08 2017 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 2 Nov 2017 15:45:08 +0000 (UTC) Subject: [master] 7180e00 A little bit of vmod coverage Message-ID: <20171102154508.85958A7840@lists.varnish-cache.org> commit 7180e001171df9c74e678ddd61ea24043c3e950e Author: Poul-Henning Kamp Date: Thu Nov 2 15:44:21 2017 +0000 A little bit of vmod coverage diff --git a/bin/varnishtest/tests/m00000.vtc b/bin/varnishtest/tests/m00000.vtc index 57749aa..2dbe456 100644 --- a/bin/varnishtest/tests/m00000.vtc +++ b/bin/varnishtest/tests/m00000.vtc @@ -1,4 +1,4 @@ -varnishtest "Test std & debug vmod" +varnishtest "Test std, vtc & debug vmod" server s1 { rxreq @@ -9,6 +9,7 @@ server s1 { varnish v1 -vcl+backend { import std; import debug; + import vtc; sub vcl_init { new obj = debug.obj(); @@ -22,6 +23,7 @@ varnish v1 -vcl+backend { set resp.http.foo = std.toupper(resp.http.foo); set resp.http.bar = std.tolower(resp.http.bar); set resp.http.who = debug.author(phk); + set resp.http.what = vtc.typesize("dfijlopsz"); debug.test_priv_call(); debug.test_priv_vcl(); obj.test_priv_call(); @@ -40,6 +42,7 @@ client c1 { expect resp.http.foo == "BAR" expect resp.http.bar == "foo" expect resp.http.encrypted == "ROT52" + expect resp.http.what >= 16 } -run logexpect l1 -v v1 -g raw -d 1 { @@ -49,6 +52,7 @@ logexpect l1 -v v1 -g raw -d 1 { expect 0 = RespUnset {^bar: fOo} expect 0 = RespHeader {^bar: foo} expect 0 = RespHeader {^who: Poul-Henning} + expect 0 = RespHeader {^what: [1-9][0-9]} expect 0 = VCL_Log {^VCL initiated log} expect 0 = RespHeader {^Encrypted: ROT52} expect 0 = VCL_return {^deliver} diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c index 5a5951a..b2daae7 100644 --- a/bin/varnishtest/vtc_varnish.c +++ b/bin/varnishtest/vtc_varnish.c @@ -952,6 +952,7 @@ varnish_expect(const struct varnish *v, char * const *av) av[0], (uintmax_t)sp.val, av[1], av[2], (uintmax_t)ref); } } + /* SECTION: varnish varnish * * Define and interact with varnish instances. From fgsch at lodoss.net Fri Nov 3 02:19:40 2017 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 3 Nov 2017 11:19:40 +0900 Subject: [master] 6155df1 cleanup In-Reply-To: <20171102131206.DB28EA754F@lists.varnish-cache.org> References: <20171102131206.DB28EA754F@lists.varnish-cache.org> Message-ID: ctx->method is not a bit mask. This change makes it look like it is. Why are we changing this? On Thu, Nov 2, 2017 at 10:12 PM, Nils Goroll wrote: > > commit 6155df1eee573bd7325d9155084d40e858530021 > Author: Nils Goroll > Date: Thu Nov 2 14:10:26 2017 +0100 > > cleanup > > diff --git a/bin/varnishd/cache/cache_vrt.c b/bin/varnishd/cache/cache_ > vrt.c > index 7f95ccb..b975485 100644 > --- a/bin/varnishd/cache/cache_vrt.c > +++ b/bin/varnishd/cache/cache_vrt.c > @@ -547,7 +547,7 @@ VRT_purge(VRT_CTX, double ttl, double grace, double > keep) > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > > - if (ctx->method != VCL_MET_HIT && ctx->method != VCL_MET_MISS) { > + if ((ctx->method & (VCL_MET_HIT|VCL_MET_MISS)) == 0) { > VSLb(ctx->vsl, SLT_VCL_Error, > "purge can only happen in vcl_hit{} or vcl_miss{}"); > VRT_handling(ctx, VCL_RET_FAIL); > _______________________________________________ > varnish-commit mailing list > varnish-commit at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fgsch at lodoss.net Fri Nov 3 02:23:22 2017 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 3 Nov 2017 11:23:22 +0900 Subject: [master] 7cdb71a Use $Prefix to avoid symbol clashes with libvmod_vtc In-Reply-To: <20171102120225.3503FA799E@lists.varnish-cache.org> References: <20171102120225.3503FA799E@lists.varnish-cache.org> Message-ID: Wasn't the plan to remove this after the release? On Thu, Nov 2, 2017 at 9:02 PM, Poul-Henning Kamp wrote: > > commit 7cdb71aa00444001f58cd3828282bf627ff39b80 > Author: Poul-Henning Kamp > Date: Thu Nov 2 07:16:10 2017 +0000 > > Use $Prefix to avoid symbol clashes with libvmod_vtc > > diff --git a/lib/libvmod_debug/vmod.vcc b/lib/libvmod_debug/vmod.vcc > index 324d389..b33e0d9 100644 > --- a/lib/libvmod_debug/vmod.vcc > +++ b/lib/libvmod_debug/vmod.vcc > @@ -27,6 +27,7 @@ > > $Module debug 3 Development, test and debug > $ABI strict > +$Prefix xyzzy > > DESCRIPTION > =========== > diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_ > debug.c > index 6b0586d..74718e7 100644 > --- a/lib/libvmod_debug/vmod_debug.c > +++ b/lib/libvmod_debug/vmod_debug.c > @@ -65,7 +65,7 @@ struct priv_vcl { > static VCL_DURATION vcl_release_delay = 0.0; > > VCL_VOID __match_proto__(td_debug_panic) > -vmod_panic(VRT_CTX, const char *str, ...) > +xyzzy_panic(VRT_CTX, const char *str, ...) > { > va_list ap; > const char *b; > @@ -79,7 +79,7 @@ vmod_panic(VRT_CTX, const char *str, ...) > } > > VCL_STRING __match_proto__(td_debug_author) > -vmod_author(VRT_CTX, VCL_ENUM person, VCL_ENUM someone) > +xyzzy_author(VRT_CTX, VCL_ENUM person, VCL_ENUM someone) > { > (void)someone; > > @@ -96,7 +96,7 @@ vmod_author(VRT_CTX, VCL_ENUM person, VCL_ENUM someone) > } > > VCL_VOID __match_proto__(td_debug_test_priv_call) > -vmod_test_priv_call(VRT_CTX, struct vmod_priv *priv) > +xyzzy_test_priv_call(VRT_CTX, struct vmod_priv *priv) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -109,7 +109,7 @@ vmod_test_priv_call(VRT_CTX, struct vmod_priv *priv) > } > > VCL_STRING __match_proto__(td_debug_test_priv_task) > -vmod_test_priv_task(VRT_CTX, struct vmod_priv *priv, VCL_STRING s) > +xyzzy_test_priv_task(VRT_CTX, struct vmod_priv *priv, VCL_STRING s) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -131,7 +131,7 @@ vmod_test_priv_task(VRT_CTX, struct vmod_priv *priv, > VCL_STRING s) > } > > VCL_STRING __match_proto__(td_debug_test_priv_top) > -vmod_test_priv_top(VRT_CTX, struct vmod_priv *priv, VCL_STRING s) > +xyzzy_test_priv_top(VRT_CTX, struct vmod_priv *priv, VCL_STRING s) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -143,7 +143,7 @@ vmod_test_priv_top(VRT_CTX, struct vmod_priv *priv, > VCL_STRING s) > } > > VCL_VOID __match_proto__(td_debug_test_priv_vcl) > -vmod_test_priv_vcl(VRT_CTX, struct vmod_priv *priv) > +xyzzy_test_priv_vcl(VRT_CTX, struct vmod_priv *priv) > { > struct priv_vcl *priv_vcl; > > @@ -155,7 +155,7 @@ vmod_test_priv_vcl(VRT_CTX, struct vmod_priv *priv) > } > > VCL_BACKEND > -vmod_no_backend(VRT_CTX) > +xyzzy_no_backend(VRT_CTX) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -164,7 +164,7 @@ vmod_no_backend(VRT_CTX) > } > > VCL_STEVEDORE __match_proto__(td_debug_no_stevedore) > -vmod_no_stevedore(VRT_CTX) > +xyzzy_no_stevedore(VRT_CTX) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -173,7 +173,7 @@ vmod_no_stevedore(VRT_CTX) > } > > VCL_VOID __match_proto__(td_debug_rot52) > -vmod_rot52(VRT_CTX, VCL_HTTP hp) > +xyzzy_rot52(VRT_CTX, VCL_HTTP hp) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -183,7 +183,7 @@ vmod_rot52(VRT_CTX, VCL_HTTP hp) > } > > VCL_STRING __match_proto__(td_debug_argtest) > -vmod_argtest(VRT_CTX, VCL_STRING one, VCL_REAL two, VCL_STRING three, > +xyzzy_argtest(VRT_CTX, VCL_STRING one, VCL_REAL two, VCL_STRING three, > VCL_STRING comma, VCL_INT four) > { > char buf[100]; > @@ -193,7 +193,7 @@ vmod_argtest(VRT_CTX, VCL_STRING one, VCL_REAL two, > VCL_STRING three, > } > > VCL_INT __match_proto__(td_debug_vre_limit) > -vmod_vre_limit(VRT_CTX) > +xyzzy_vre_limit(VRT_CTX) > { > (void)ctx; > return (cache_param->vre_limits.match); > @@ -220,7 +220,7 @@ obj_cb(struct worker *wrk, void *priv, struct objcore > *oc, unsigned event) > } > > VCL_VOID __match_proto__(td_debug_register_obj_events) > -vmod_register_obj_events(VRT_CTX, struct vmod_priv *priv) > +xyzzy_register_obj_events(VRT_CTX, struct vmod_priv *priv) > { > struct priv_vcl *priv_vcl; > > @@ -233,7 +233,7 @@ vmod_register_obj_events(VRT_CTX, struct vmod_priv > *priv) > } > > VCL_VOID __match_proto__(td_debug_fail) > -vmod_fail(VRT_CTX) > +xyzzy_fail(VRT_CTX) > { > > VRT_fail(ctx, "Forced failure"); > @@ -356,7 +356,7 @@ event_function(VRT_CTX, struct vmod_priv *priv, enum > vcl_event_e e) > } > > VCL_VOID __match_proto__(td_debug_sleep) > -vmod_sleep(VRT_CTX, VCL_DURATION t) > +xyzzy_sleep(VRT_CTX, VCL_DURATION t) > { > > CHECK_OBJ_ORNULL(ctx, VRT_CTX_MAGIC); > @@ -380,7 +380,7 @@ wsfind(VRT_CTX, VCL_ENUM which) > } > > void > -vmod_workspace_allocate(VRT_CTX, VCL_ENUM which, VCL_INT size) > +xyzzy_workspace_allocate(VRT_CTX, VCL_ENUM which, VCL_INT size) > { > struct ws *ws; > char *s; > @@ -407,7 +407,7 @@ vmod_workspace_allocate(VRT_CTX, VCL_ENUM which, > VCL_INT size) > } > > VCL_INT > -vmod_workspace_free(VRT_CTX, VCL_ENUM which) > +xyzzy_workspace_free(VRT_CTX, VCL_ENUM which) > { > struct ws *ws; > unsigned u; > @@ -425,7 +425,7 @@ vmod_workspace_free(VRT_CTX, VCL_ENUM which) > } > > VCL_BOOL > -vmod_workspace_overflowed(VRT_CTX, VCL_ENUM which) > +xyzzy_workspace_overflowed(VRT_CTX, VCL_ENUM which) > { > struct ws *ws; > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -440,7 +440,7 @@ vmod_workspace_overflowed(VRT_CTX, VCL_ENUM which) > static uintptr_t debug_ws_snap; > > void > -vmod_workspace_snap(VRT_CTX, VCL_ENUM which) > +xyzzy_workspace_snap(VRT_CTX, VCL_ENUM which) > { > struct ws *ws; > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -453,7 +453,7 @@ vmod_workspace_snap(VRT_CTX, VCL_ENUM which) > } > > void > -vmod_workspace_reset(VRT_CTX, VCL_ENUM which) > +xyzzy_workspace_reset(VRT_CTX, VCL_ENUM which) > { > struct ws *ws; > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -466,7 +466,7 @@ vmod_workspace_reset(VRT_CTX, VCL_ENUM which) > } > > void > -vmod_workspace_overflow(VRT_CTX, VCL_ENUM which) > +xyzzy_workspace_overflow(VRT_CTX, VCL_ENUM which) > { > struct ws *ws; > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -479,7 +479,7 @@ vmod_workspace_overflow(VRT_CTX, VCL_ENUM which) > } > > VCL_VOID __match_proto__(td_debug_vcl_release_delay) > -vmod_vcl_release_delay(VRT_CTX, VCL_DURATION delay) > +xyzzy_vcl_release_delay(VRT_CTX, VCL_DURATION delay) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -488,7 +488,7 @@ vmod_vcl_release_delay(VRT_CTX, VCL_DURATION delay) > } > > VCL_BOOL __match_proto__(td_debug_match_acl) > -vmod_match_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip) > +xyzzy_match_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip) > { > > CHECK_OBJ_ORNULL(ctx, VRT_CTX_MAGIC); > @@ -499,7 +499,7 @@ vmod_match_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip) > } > > VCL_BOOL > -vmod_barrier_sync(VRT_CTX, VCL_STRING addr) > +xyzzy_barrier_sync(VRT_CTX, VCL_STRING addr) > { > const char *err; > char buf[32]; > @@ -532,7 +532,7 @@ vmod_barrier_sync(VRT_CTX, VCL_STRING addr) > } > > VCL_VOID __match_proto__(td_debug_test_probe) > -vmod_test_probe(VRT_CTX, VCL_PROBE probe, VCL_PROBE same) > +xyzzy_test_probe(VRT_CTX, VCL_PROBE probe, VCL_PROBE same) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -542,7 +542,7 @@ vmod_test_probe(VRT_CTX, VCL_PROBE probe, VCL_PROBE > same) > } > > VCL_INT > -vmod_typesize(VRT_CTX, VCL_STRING s) > +xyzzy_typesize(VRT_CTX, VCL_STRING s) > { > size_t i = 0; > const char *p; > diff --git a/lib/libvmod_debug/vmod_debug_dyn.c b/lib/libvmod_debug/vmod_ > debug_dyn.c > index 8742ff9..ad2dd29 100644 > --- a/lib/libvmod_debug/vmod_debug_dyn.c > +++ b/lib/libvmod_debug/vmod_debug_dyn.c > @@ -39,7 +39,7 @@ > #include "vsa.h" > #include "vcc_if.h" > > -struct vmod_debug_dyn { > +struct xyzzy_debug_dyn { > unsigned magic; > #define VMOD_DEBUG_DYN_MAGIC 0x9b77ccbd > pthread_mutex_t mtx; > @@ -48,7 +48,7 @@ struct vmod_debug_dyn { > }; > > static void > -dyn_dir_init(VRT_CTX, struct vmod_debug_dyn *dyn, > +dyn_dir_init(VRT_CTX, struct xyzzy_debug_dyn *dyn, > VCL_STRING addr, VCL_STRING port) > { > struct addrinfo hints, *res = NULL; > @@ -104,10 +104,10 @@ dyn_dir_init(VRT_CTX, struct vmod_debug_dyn *dyn, > } > > VCL_VOID > -vmod_dyn__init(VRT_CTX, struct vmod_debug_dyn **dynp, > +xyzzy_dyn__init(VRT_CTX, struct xyzzy_debug_dyn **dynp, > const char *vcl_name, VCL_STRING addr, VCL_STRING port) > { > - struct vmod_debug_dyn *dyn; > + struct xyzzy_debug_dyn *dyn; > > ASSERT_CLI(); > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -134,9 +134,9 @@ vmod_dyn__init(VRT_CTX, struct vmod_debug_dyn **dynp, > } > > VCL_VOID > -vmod_dyn__fini(struct vmod_debug_dyn **dynp) > +xyzzy_dyn__fini(struct xyzzy_debug_dyn **dynp) > { > - struct vmod_debug_dyn *dyn; > + struct xyzzy_debug_dyn *dyn; > > AN(dynp); > if (*dynp == NULL) > @@ -151,7 +151,7 @@ vmod_dyn__fini(struct vmod_debug_dyn **dynp) > } > > VCL_BACKEND __match_proto__() > -vmod_dyn_backend(VRT_CTX, struct vmod_debug_dyn *dyn) > +xyzzy_dyn_backend(VRT_CTX, struct xyzzy_debug_dyn *dyn) > { > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > CHECK_OBJ_NOTNULL(dyn, VMOD_DEBUG_DYN_MAGIC); > @@ -160,7 +160,7 @@ vmod_dyn_backend(VRT_CTX, struct vmod_debug_dyn *dyn) > } > > VCL_VOID > -vmod_dyn_refresh(VRT_CTX, struct vmod_debug_dyn *dyn, > +xyzzy_dyn_refresh(VRT_CTX, struct xyzzy_debug_dyn *dyn, > VCL_STRING addr, VCL_STRING port) > { > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > diff --git a/lib/libvmod_debug/vmod_debug_obj.c b/lib/libvmod_debug/vmod_ > debug_obj.c > index 3364092..63f2e44 100644 > --- a/lib/libvmod_debug/vmod_debug_obj.c > +++ b/lib/libvmod_debug/vmod_debug_obj.c > @@ -35,7 +35,7 @@ > > #include "vcc_if.h" > > -struct vmod_debug_obj { > +struct xyzzy_debug_obj { > unsigned magic; > #define VMOD_DEBUG_OBJ_MAGIC 0xccbd9b77 > int foobar; > @@ -43,10 +43,10 @@ struct vmod_debug_obj { > }; > > VCL_VOID > -vmod_obj__init(VRT_CTX, struct vmod_debug_obj **op, > +xyzzy_obj__init(VRT_CTX, struct xyzzy_debug_obj **op, > const char *vcl_name, VCL_STRING s, VCL_ENUM e) > { > - struct vmod_debug_obj *o; > + struct xyzzy_debug_obj *o; > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > (void)vcl_name; > @@ -62,7 +62,7 @@ vmod_obj__init(VRT_CTX, struct vmod_debug_obj **op, > } > > VCL_VOID > -vmod_obj__fini(struct vmod_debug_obj **op) > +xyzzy_obj__fini(struct xyzzy_debug_obj **op) > { > > AN(op); > @@ -72,7 +72,7 @@ vmod_obj__fini(struct vmod_debug_obj **op) > } > > VCL_VOID __match_proto__() > -vmod_obj_enum(VRT_CTX, struct vmod_debug_obj *o, VCL_ENUM e) > +xyzzy_obj_enum(VRT_CTX, struct xyzzy_debug_obj *o, VCL_ENUM e) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -81,7 +81,7 @@ vmod_obj_enum(VRT_CTX, struct vmod_debug_obj *o, > VCL_ENUM e) > } > > VCL_STRING __match_proto__() > -vmod_obj_foo(VRT_CTX, struct vmod_debug_obj *o, VCL_STRING s) > +xyzzy_obj_foo(VRT_CTX, struct xyzzy_debug_obj *o, VCL_STRING s) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -92,7 +92,7 @@ vmod_obj_foo(VRT_CTX, struct vmod_debug_obj *o, > VCL_STRING s) > } > > VCL_TIME __match_proto__() > -vmod_obj_date(VRT_CTX, struct vmod_debug_obj *o) > +xyzzy_obj_date(VRT_CTX, struct xyzzy_debug_obj *o) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -102,7 +102,7 @@ vmod_obj_date(VRT_CTX, struct vmod_debug_obj *o) > } > > VCL_STRING __match_proto__() > -vmod_obj_string(VRT_CTX, struct vmod_debug_obj *o) > +xyzzy_obj_string(VRT_CTX, struct xyzzy_debug_obj *o) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -112,7 +112,7 @@ vmod_obj_string(VRT_CTX, struct vmod_debug_obj *o) > } > > VCL_STRING __match_proto__() > -vmod_obj_number(VRT_CTX, struct vmod_debug_obj *o) > +xyzzy_obj_number(VRT_CTX, struct xyzzy_debug_obj *o) > { > > CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); > @@ -122,30 +122,30 @@ vmod_obj_number(VRT_CTX, struct vmod_debug_obj *o) > } > > VCL_VOID __match_proto__() > -vmod_obj_test_priv_call(VRT_CTX, > - struct vmod_debug_obj *o, struct vmod_priv *priv) > +xyzzy_obj_test_priv_call(VRT_CTX, > + struct xyzzy_debug_obj *o, struct vmod_priv *priv) > { > (void)o; > - vmod_test_priv_call(ctx, priv); > + xyzzy_test_priv_call(ctx, priv); > } > VCL_VOID __match_proto__() > -vmod_obj_test_priv_vcl(VRT_CTX, > - struct vmod_debug_obj *o, struct vmod_priv *priv) > +xyzzy_obj_test_priv_vcl(VRT_CTX, > + struct xyzzy_debug_obj *o, struct vmod_priv *priv) > { > (void)o; > - vmod_test_priv_vcl(ctx, priv); > + xyzzy_test_priv_vcl(ctx, priv); > } > VCL_STRING __match_proto__() > -vmod_obj_test_priv_task(VRT_CTX, > - struct vmod_debug_obj *o, struct vmod_priv *priv, VCL_STRING s) > +xyzzy_obj_test_priv_task(VRT_CTX, > + struct xyzzy_debug_obj *o, struct vmod_priv *priv, VCL_STRING s) > { > (void)o; > - return (vmod_test_priv_task(ctx, priv, s)); > + return (xyzzy_test_priv_task(ctx, priv, s)); > } > VCL_STRING __match_proto__() > -vmod_obj_test_priv_top(VRT_CTX, > - struct vmod_debug_obj *o, struct vmod_priv *priv, VCL_STRING s) > +xyzzy_obj_test_priv_top(VRT_CTX, > + struct xyzzy_debug_obj *o, struct vmod_priv *priv, VCL_STRING s) > { > (void)o; > - return (vmod_test_priv_top(ctx, priv, s)); > + return (xyzzy_test_priv_top(ctx, priv, s)); > } > _______________________________________________ > varnish-commit mailing list > varnish-commit at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From phk at phk.freebsd.dk Fri Nov 3 06:56:47 2017 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Fri, 03 Nov 2017 06:56:47 +0000 Subject: [master] 7cdb71a Use $Prefix to avoid symbol clashes with libvmod_vtc In-Reply-To: References: <20171102120225.3503FA799E@lists.varnish-cache.org> Message-ID: <80757.1509692207@critter.freebsd.dk> -------- In message , Federico Schwindt writes: >Wasn't the plan to remove this after the release? You mean the functions moved to vmod_vtc ? Yes. But I still think the "vmod_" prefix should be overridable. -- 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 Fri Nov 3 07:37:17 2017 From: nils.goroll at uplex.de (Nils Goroll) Date: Fri, 3 Nov 2017 08:37:17 +0100 Subject: [master] 6155df1 cleanup In-Reply-To: References: <20171102131206.DB28EA754F@lists.varnish-cache.org> Message-ID: <1c6920e5-8979-b317-f7d2-ec512105783c@uplex.de> On 03/11/17 03:19, Federico Schwindt wrote: > ctx->method is not a bit mask. have a look at vcl.h -- ** * * 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: 473 bytes Desc: OpenPGP digital signature URL: From fgsch at lodoss.net Fri Nov 3 09:25:53 2017 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 3 Nov 2017 18:25:53 +0900 Subject: [master] 6155df1 cleanup In-Reply-To: <1c6920e5-8979-b317-f7d2-ec512105783c@uplex.de> References: <20171102131206.DB28EA754F@lists.varnish-cache.org> <1c6920e5-8979-b317-f7d2-ec512105783c@uplex.de> Message-ID: Only in the context of vcc but you are correct though I don't agree with this change. On Fri, Nov 3, 2017 at 4:37 PM, Nils Goroll wrote: > On 03/11/17 03:19, Federico Schwindt wrote: > > ctx->method is not a bit mask. > > have a look at vcl.h > > -- > > ** * * 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 fgsch at lodoss.net Fri Nov 3 09:31:01 2017 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 3 Nov 2017 18:31:01 +0900 Subject: [master] 7cdb71a Use $Prefix to avoid symbol clashes with libvmod_vtc In-Reply-To: <80757.1509692207@critter.freebsd.dk> References: <20171102120225.3503FA799E@lists.varnish-cache.org> <80757.1509692207@critter.freebsd.dk> Message-ID: Ok, I didn't know we wanted to make that overridable. On Fri, Nov 3, 2017 at 3:56 PM, Poul-Henning Kamp wrote: > -------- > In message uftfUn_kPuira-Ug at mail.gmail.com> > , Federico Schwindt writes: > > >Wasn't the plan to remove this after the release? > > You mean the functions moved to vmod_vtc ? Yes. > > But I still think the "vmod_" prefix should be overridable. > > -- > 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. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From phk at phk.freebsd.dk Fri Nov 3 07:24:58 2017 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Fri, 03 Nov 2017 07:24:58 +0000 Subject: [master] f4d0280 Return early on failure In-Reply-To: References: <20171102120225.6F226A79A4@lists.varnish-cache.org> Message-ID: <81794.1509693898@critter.freebsd.dk> -------- In message , Dridi Boukelmoune writes: >On Thu, Nov 2, 2017 at 1:02 PM, Poul-Henning Kamp wrote: >> >> commit f4d02803c5dfded27b446d39039dc02f02b3717c >> Author: Poul-Henning Kamp >> Date: Thu Nov 2 07:44:16 2017 +0000 >> >> Return early on failure > >You might want to VRT_fail before returning too. We do that in vtc_ws_find() in the new functions in vmod_vrt, but the old (to be removed) functions in vmod_debug never did that. -- 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 dridi at varni.sh Fri Nov 3 14:24:39 2017 From: dridi at varni.sh (Dridi Boukelmoune) Date: Fri, 3 Nov 2017 15:24:39 +0100 Subject: [master] f4d0280 Return early on failure In-Reply-To: <81794.1509693898@critter.freebsd.dk> References: <20171102120225.6F226A79A4@lists.varnish-cache.org> <81794.1509693898@critter.freebsd.dk> Message-ID: On Fri, Nov 3, 2017 at 8:24 AM, Poul-Henning Kamp wrote: > -------- > In message > , Dridi Boukelmoune writes: >>On Thu, Nov 2, 2017 at 1:02 PM, Poul-Henning Kamp wrote: >>> >>> commit f4d02803c5dfded27b446d39039dc02f02b3717c >>> Author: Poul-Henning Kamp >>> Date: Thu Nov 2 07:44:16 2017 +0000 >>> >>> Return early on failure >> >>You might want to VRT_fail before returning too. > > We do that in vtc_ws_find() in the new functions in vmod_vrt, > but the old (to be removed) functions in vmod_debug never did that. Indeed, I polished the code for the debug-to-vtc transition, and apparently I took care of the VRT_fail call but not the early return. I assumed not since it wasn't in the diff, my bad... Dridi From nils.goroll at uplex.de Sat Nov 4 17:55:11 2017 From: nils.goroll at uplex.de (Nils Goroll) Date: Sat, 4 Nov 2017 17:55:11 +0000 (UTC) Subject: [master] b3f8a26 Stabilize position output for ESI_xmlerror & more e8.vtc coverage Message-ID: <20171104175511.8C34EA6030@lists.varnish-cache.org> commit b3f8a26e8582f9582f3d2ad33956d245da4c2a46 Author: Nils Goroll Date: Sat Nov 4 15:06:58 2017 +0100 Stabilize position output for ESI_xmlerror & more e8.vtc coverage ver_p depends on the amount of data we have read ahead, so it is not suitable to get predictable results for ESI testing diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c index f02a6df..0cef4dd 100644 --- a/bin/varnishd/cache/cache_esi_parse.c +++ b/bin/varnishd/cache/cache_esi_parse.c @@ -196,12 +196,9 @@ static struct vep_match vep_match_bom[] = { static void vep_error(const struct vep_state *vep, const char *p) { - intmax_t l; - VSC_C_main->esi_errors++; - l = (intmax_t)(vep->ver_p - vep->hack_p); - VSLb(vep->vc->wrk->vsl, SLT_ESI_xmlerror, "ERR at %jd %s", l, p); - + VSLb(vep->vc->wrk->vsl, SLT_ESI_xmlerror, "ERR after %zd %s", + vep->o_last, p); } /*-------------------------------------------------------------------- @@ -211,12 +208,9 @@ vep_error(const struct vep_state *vep, const char *p) static void vep_warn(const struct vep_state *vep, const char *p) { - intmax_t l; - VSC_C_main->esi_warnings++; - l = (intmax_t)(vep->ver_p - vep->hack_p); - VSLb(vep->vc->wrk->vsl, SLT_ESI_xmlerror, "WARN at %jd %s", l, p); - + VSLb(vep->vc->wrk->vsl, SLT_ESI_xmlerror, "WARN after %zd %s", + vep->o_last, p); } /*--------------------------------------------------------------------- diff --git a/bin/varnishtest/tests/e00006.vtc b/bin/varnishtest/tests/e00006.vtc index 6c9b5fd..95dd08d 100644 --- a/bin/varnishtest/tests/e00006.vtc +++ b/bin/varnishtest/tests/e00006.vtc @@ -68,9 +68,11 @@ varnish v1 -vcl+backend { varnish v1 -cliok "param.set feature +esi_ignore_https" logexpect l1 -v v1 -g raw { - expect * * ESI_xmlerror "ERR at 35 ESI 1.0 invalid src= URL" - expect * * ESI_xmlerror "WARN at 36 ESI 1.0 https:// treated as http://" - expect * * ESI_xmlerror "ERR at 36 ESI 1.0 invalid src= URL" + expect * * ESI_xmlerror "ERR after 0 ESI 1.0 invalid src= URL" + expect * * ESI_xmlerror "WARN after 0 ESI 1.0 https:// treated as http://" + expect * * ESI_xmlerror "ERR after 0 ESI 1.0 invalid src= URL" + + } -start client c1 { diff --git a/bin/varnishtest/tests/e00008.vtc b/bin/varnishtest/tests/e00008.vtc index 51c8c88..8767b73 100644 --- a/bin/varnishtest/tests/e00008.vtc +++ b/bin/varnishtest/tests/e00008.vtc @@ -64,6 +64,25 @@ varnish v1 -vcl+backend { } } -start +logexpect l1 -v v1 -g vxid { + expect * * BereqURL {^/$} + expect * * ESI_xmlerror {^ERR after 134 ESI 1.0 element$} + expect 0 = ESI_xmlerror {^ERR after 157 ESI 1.0 needs final '/'$} + expect 0 = ESI_xmlerror {^ERR after 192 ESI 1.0 illegal end-tag$} + expect 0 = ESI_xmlerror {^ERR after 251 ESI 1.0 element nested in $} + expect 0 = ESI_xmlerror {^ERR after 330 ESI 1.0 already open$} + expect 0 = ESI_xmlerror {^ERR after 407 ESI 1.0 not open$} + expect 0 = ESI_xmlerror {^ERR after 442 ESI 1.0 not legal$} + expect 0 = ESI_xmlerror {^ERR after 474 XML 1.0 Illegal attribute start char$} + expect 0 = ESI_xmlerror {^ERR after 525 ESI 1.0 lacks src attr$} + expect 0 = ESI_xmlerror {^ERR after 553 XML 1.0 Illegal attr char$} + expect 0 = ESI_xmlerror {^ERR after 581 ESI 1.0 lacks src attr$} + expect 0 = ESI_xmlerror {^ERR after 608 XML 1.0 Missing end attribute delimiter$} + expect 0 = ESI_xmlerror {^ERR after 636 XML 1.0 Illegal attribute delimiter$} + expect 0 = ESI_xmlerror {^ERR after 665 ESI 1.0 illegal end-tag$} + expect 0 = ESI_xmlerror {^ERR after 767 XML 1.0 Missing end attribute delimiter$} +} + varnish v1 -cliok "param.set debug +esi_chop" varnish v1 -cliok "param.set debug +syncvsl" @@ -75,5 +94,7 @@ client c1 { expect resp.bodylen == 464 } +logexpect l1 -start client c1 -run +logexpect l1 -wait varnish v1 -expect esi_errors == 15 From nils.goroll at uplex.de Sat Nov 4 17:55:11 2017 From: nils.goroll at uplex.de (Nils Goroll) Date: Sat, 4 Nov 2017 17:55:11 +0000 (UTC) Subject: [master] f1d60c1 ESI vtcs: coverage, fixes, check ESI_xmlerror, esi_disable_xml_check Message-ID: <20171104175511.C5F6DA6033@lists.varnish-cache.org> commit f1d60c1c7133f72c23bc7992212d8839acf93cf5 Author: Nils Goroll Date: Sat Nov 4 15:09:21 2017 +0100 ESI vtcs: coverage, fixes, check ESI_xmlerror, esi_disable_xml_check We were tolerating some unintentional ESI behaviour due to the xml check hitting. We now either avoid running into the xml check or specifically test that we are hitting it. In addition, add some logexpects to tighten checks diff --git a/bin/varnishtest/tests/e00000.vtc b/bin/varnishtest/tests/e00000.vtc index e17338f..8448550 100644 --- a/bin/varnishtest/tests/e00000.vtc +++ b/bin/varnishtest/tests/e00000.vtc @@ -14,6 +14,10 @@ varnish v1 -vcl+backend { } } -start +logexpect l1 -v v1 -g raw { + expect * * ESI_xmlerror esi_disable_xml_check +} -start + client c1 { txreq rxresp @@ -22,4 +26,5 @@ client c1 { } client c1 -run +logexpect l1 -wait varnish v1 -expect esi_errors == 0 diff --git a/bin/varnishtest/tests/e00001.vtc b/bin/varnishtest/tests/e00001.vtc index 660637d..be0b0c1 100644 --- a/bin/varnishtest/tests/e00001.vtc +++ b/bin/varnishtest/tests/e00001.vtc @@ -19,6 +19,11 @@ varnish v1 -vcl+backend { } } -start +logexpect l1 -v v1 -g raw { + expect * * ESI_xmlerror {^ERR after 3 ESI 1.0 element nested in } + expect 0 = ESI_xmlerror {^ERR after 3 ESI 1.0 Nested \0c} rxreq expect req.url == "/nullbefore" - txresp -body {\0c} + txresp -body {\0c} } -start varnish v1 -vcl+backend { diff --git a/bin/varnishtest/tests/r00590.vtc b/bin/varnishtest/tests/r00590.vtc index ce16ba5..ab0bba4 100644 --- a/bin/varnishtest/tests/r00590.vtc +++ b/bin/varnishtest/tests/r00590.vtc @@ -61,7 +61,9 @@ varnish v1 -vcl+backend { return (pass); } sub vcl_backend_response { - set beresp.do_esi = true; + if (bereq.url == "/") { + set beresp.do_esi = true; + } } } -start diff --git a/bin/varnishtest/tests/r00612.vtc b/bin/varnishtest/tests/r00612.vtc index d36e5a0..46ec702 100644 --- a/bin/varnishtest/tests/r00612.vtc +++ b/bin/varnishtest/tests/r00612.vtc @@ -32,7 +32,7 @@ server s1 { txresp -body "55555" } -start -varnish v1 -vcl+backend { +varnish v1 -arg "-p feature=+esi_disable_xml_check" -vcl+backend { sub vcl_recv { return (pass); } diff --git a/bin/varnishtest/tests/r00894.vtc b/bin/varnishtest/tests/r00894.vtc index 04a793d..4a81523 100644 --- a/bin/varnishtest/tests/r00894.vtc +++ b/bin/varnishtest/tests/r00894.vtc @@ -11,8 +11,16 @@ varnish v1 -vcl+backend { } } -start +logexpect l1 -v v1 -g raw { + expect * * Fetch_Body + expect 0 = ESI_xmlerror {^ERR after 5 ESI 1.0 has multiple src= attributes$} + expect 0 = BackendReuse +} -start + client c1 { txreq rxresp expect resp.bodylen == 10 } -run + +logexpect l1 -wait diff --git a/bin/varnishtest/tests/r00961.vtc b/bin/varnishtest/tests/r00961.vtc index c6e9209..320dc4f 100644 --- a/bin/varnishtest/tests/r00961.vtc +++ b/bin/varnishtest/tests/r00961.vtc @@ -37,7 +37,9 @@ varnish v1 -vcl+backend { return (pass); } sub vcl_backend_response { - set beresp.do_esi = true; + if (bereq.url == "/") { + set beresp.do_esi = true; + } } } -start diff --git a/bin/varnishtest/tests/r01029.vtc b/bin/varnishtest/tests/r01029.vtc index 7058ef4..23d25a6 100644 --- a/bin/varnishtest/tests/r01029.vtc +++ b/bin/varnishtest/tests/r01029.vtc @@ -13,8 +13,8 @@ server s1 { varnish v1 -vcl+backend { sub vcl_backend_response { - set beresp.do_esi = true; if (bereq.url == "/foo") { + set beresp.do_esi = true; set beresp.ttl = 0s; } else { set beresp.ttl = 10m; diff --git a/bin/varnishtest/tests/r01038.vtc b/bin/varnishtest/tests/r01038.vtc index 705e11c..540deb8 100644 --- a/bin/varnishtest/tests/r01038.vtc +++ b/bin/varnishtest/tests/r01038.vtc @@ -47,7 +47,9 @@ server s1 { varnish v1 -arg "-p workspace_backend=10k" -vcl+backend { sub vcl_backend_response { - set beresp.do_esi = true; + if (bereq.url == "/") { + set beresp.do_esi = true; + } } } -start @@ -62,4 +64,3 @@ client c1 { } -run varnish v1 -expect losthdr == 0 - diff --git a/bin/varnishtest/tests/r01092.vtc b/bin/varnishtest/tests/r01092.vtc index 7512ea4..a53b7ba 100644 --- a/bin/varnishtest/tests/r01092.vtc +++ b/bin/varnishtest/tests/r01092.vtc @@ -24,6 +24,12 @@ varnish v1 -vcl+backend { } } -start +logexpect l1 -v v1 -g raw { + expect * * Fetch_Body + expect 0 * ESI_xmlerror {^ERR after 66 ESI 1.0 Nested