From phk at FreeBSD.org Mon Nov 2 11:48:08 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 02 Nov 2015 12:48:08 +0100 Subject: [master] f861ad2 Fail if multiple -a arguments return the same suckaddr. Message-ID: commit f861ad2174ffc85700c591fda0aadffe843d2ecf Author: Poul-Henning Kamp Date: Mon Nov 2 11:47:44 2015 +0000 Fail if multiple -a arguments return the same suckaddr. Fixes #1813 diff --git a/bin/varnishd/mgt/mgt_acceptor.c b/bin/varnishd/mgt/mgt_acceptor.c index 658aca4..49cc0c8 100644 --- a/bin/varnishd/mgt/mgt_acceptor.c +++ b/bin/varnishd/mgt/mgt_acceptor.c @@ -128,6 +128,13 @@ mac_callback(void *priv, const struct suckaddr *sa) CAST_OBJ_NOTNULL(mh, priv, MAC_HELP_MAGIC); + VTAILQ_FOREACH(ls, &heritage.socks, list) { + if (!VSA_Compare(sa, ls->addr)) { + ARGV_ERR("-a arguments %s and %s have same address\n", + ls->name, mh->name); + return (-1); + } + } ALLOC_OBJ(ls, LISTEN_SOCK_MAGIC); AN(ls); ls->sock = -1; diff --git a/bin/varnishtest/tests/r01813.vtc b/bin/varnishtest/tests/r01813.vtc new file mode 100644 index 0000000..f37aa54 --- /dev/null +++ b/bin/varnishtest/tests/r01813.vtc @@ -0,0 +1,3 @@ +varnishtest "Duplicate -a arguments" + +err_shell {have same address} "${varnishd} -d -a 127.0.0.1:38484 -a 127.0.0.1:38484 -b localhost:80 2>&1" From phk at FreeBSD.org Mon Nov 2 15:25:19 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 02 Nov 2015 16:25:19 +0100 Subject: [master] 4f08082 Fix this test-case relative to the fix for #1813 Message-ID: commit 4f0808280fe3fc5086ae90e4e7bafc39bf4758fc Author: Poul-Henning Kamp Date: Mon Nov 2 15:24:38 2015 +0000 Fix this test-case relative to the fix for #1813 diff --git a/bin/varnishtest/tests/c00007.vtc b/bin/varnishtest/tests/c00007.vtc index 4edff4f..5238226 100644 --- a/bin/varnishtest/tests/c00007.vtc +++ b/bin/varnishtest/tests/c00007.vtc @@ -1,5 +1,5 @@ varnishtest "Test banning a hash" -varnish v1 \ - -arg "-b 127.0.0.1:80 -a 127.0.0.1:0" \ - -start -clierr 101 "ban.hash foo" +varnish v1 -arg "-b 127.0.0.1:80" -start + +varnish v1 -clierr 101 "ban.hash foo" From fgsch at lodoss.net Mon Nov 2 17:16:48 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Mon, 02 Nov 2015 18:16:48 +0100 Subject: [master] 76eb8d7 Use client.ip instead of client.identity Message-ID: commit 76eb8d740ca97be24200cbf05f303952dfed194d Author: Federico G. Schwindt Date: Mon Nov 2 12:41:04 2015 +0000 Use client.ip instead of client.identity Indentation while I'm here. diff --git a/lib/libvmod_directors/vmod.vcc b/lib/libvmod_directors/vmod.vcc index bb81751..02b5a3f 100644 --- a/lib/libvmod_directors/vmod.vcc +++ b/lib/libvmod_directors/vmod.vcc @@ -67,17 +67,17 @@ Example $Method VOID .add_backend(BACKEND) Description - Add a backend to the round-robin director. + Add a backend to the round-robin director. Example - vdir.add_backend(backend1); - vdir.add_backend(backend2); + vdir.add_backend(backend1); + vdir.add_backend(backend2); $Method BACKEND .backend() Description - Pick a backend from the director. + Pick a backend from the director. Example - set req.backend_hint = vdir.backend(); + set req.backend_hint = vdir.backend(); $Object fallback() @@ -106,9 +106,9 @@ Example $Method BACKEND .backend() Description - Pick a backend from the director. + Pick a backend from the director. Example - set req.backend_hint = vdir.backend(); + set req.backend_hint = vdir.backend(); $Object random() @@ -149,10 +149,10 @@ $Object hash() Description Create a hashing backend director. - The director chooses the backend server by computing a hash/digest of - the string given to .backend(). + The director chooses the backend server by computing a hash/digest + of the string given to .backend(). - Commonly used with ``client.identity`` or a session cookie to get + Commonly used with ``client.ip`` or a session cookie to get sticky sessions. Example From fgsch at lodoss.net Tue Nov 3 11:01:45 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Tue, 03 Nov 2015 12:01:45 +0100 Subject: [3.0] e894769 Reapply f6f75eac to the right file Message-ID: commit e894769252da377a91ebb259ed46a5fc9d46e14b Author: Federico G. Schwindt Date: Tue Oct 27 18:15:36 2015 +0000 Reapply f6f75eac to the right file diff --git a/lib/libjemalloc/jemalloc_linux.c b/lib/libjemalloc/jemalloc_linux.c index 170777b..1b68425 100644 --- a/lib/libjemalloc/jemalloc_linux.c +++ b/lib/libjemalloc/jemalloc_linux.c @@ -3929,6 +3929,7 @@ arena_dalloc(arena_t *arena, arena_chunk_t *chunk, void *ptr) arena_dalloc_small(arena, chunk, ptr, mapelm); malloc_spin_unlock(&arena->lock); + return; } mag_rack = rack; } From lkarsten at varnish-software.com Wed Nov 4 09:07:34 2015 From: lkarsten at varnish-software.com (Lasse Karstensen) Date: Wed, 04 Nov 2015 10:07:34 +0100 Subject: [master] e267c5f Squash trailing whitespace. Message-ID: commit e267c5fa3928983ed948ef0d1cb4c4f90066e58a Author: Lasse Karstensen Date: Wed Nov 4 10:06:53 2015 +0100 Squash trailing whitespace. diff --git a/configure.ac b/configure.ac index 77b61d4..5e46ce6 100644 --- a/configure.ac +++ b/configure.ac @@ -229,29 +229,29 @@ AC_CHECK_FUNCS([pthread_mutex_isowned_np]) AC_CHECK_FUNCS([pthread_timedjoin_np]) LIBS="${save_LIBS}" -# Support for visibility attribute -save_CFLAGS="${CFLAGS}" -CFLAGS="${CFLAGS} -Werror" - -AC_CACHE_CHECK([whether we have support for visibility attributes], - [ac_cv_have_viz], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM([[ - #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) - # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) - #else - # define ZLIB_INTERNAL - #endif - int ZLIB_INTERNAL foo; - ]],[])], - [ac_cv_have_viz=yes], - [ac_cv_have_viz=no]) +# Support for visibility attribute +save_CFLAGS="${CFLAGS}" +CFLAGS="${CFLAGS} -Werror" + +AC_CACHE_CHECK([whether we have support for visibility attributes], + [ac_cv_have_viz], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM([[ + #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) + # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) + #else + # define ZLIB_INTERNAL + #endif + int ZLIB_INTERNAL foo; + ]],[])], + [ac_cv_have_viz=yes], + [ac_cv_have_viz=no]) ]) -if test "$ac_cv_have_viz" = no; then - libvgz_extra_cflags="-DNO_VIZ" - AC_SUBST(libvgz_extra_cflags) +if test "$ac_cv_have_viz" = no; then + libvgz_extra_cflags="-DNO_VIZ" + AC_SUBST(libvgz_extra_cflags) fi -CFLAGS="${save_CFLAGS}" +CFLAGS="${save_CFLAGS}" # Use jemalloc on Linux JEMALLOC_LDADD= From fgsch at lodoss.net Wed Nov 4 12:55:21 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Wed, 04 Nov 2015 13:55:21 +0100 Subject: [master] a8067c7 Relax IP constant parsing Message-ID: commit a8067c730a180a1d044bce73ad87fc25a0f4995b Author: Federico G. Schwindt Date: Wed Nov 4 12:00:09 2015 +0000 Relax IP constant parsing Fixes #1801. diff --git a/bin/varnishtest/tests/r01801.vtc b/bin/varnishtest/tests/r01801.vtc new file mode 100644 index 0000000..7052ead --- /dev/null +++ b/bin/varnishtest/tests/r01801.vtc @@ -0,0 +1,58 @@ +varnishtest "Test parsing IP constants" + +server s1 { + rxreq + txresp +} -start + +varnish v1 -vcl+backend { + import ${vmod_std}; + + sub vcl_deliver { + set resp.http.foo1 = std.ip("..", "1.2.3.4"); + set resp.http.foo2 = std.ip("..", "1.2.3.4:8000"); + set resp.http.foo3 = std.ip("..", "1.2.3.4 8000"); + set resp.http.foo4 = std.ip("..", "::1"); + set resp.http.foo5 = std.ip("..", "[::1]"); + set resp.http.foo6 = std.ip("..", "[::1]:8000"); + set resp.http.bar1 = std.port("1.2.3.4"); + set resp.http.bar2 = std.port("1.2.3.4:8000"); + set resp.http.bar3 = std.port("1.2.3.4 8000"); + set resp.http.bar4 = std.port("::1"); + set resp.http.bar5 = std.port("[::1]"); + set resp.http.bar6 = std.port("[::1]:8000"); + } +} -start + +client c1 { + txreq + rxresp + expect resp.http.foo1 == "1.2.3.4" + expect resp.http.foo2 == "1.2.3.4" + expect resp.http.foo3 == "1.2.3.4" + expect resp.http.foo4 == "::1" + expect resp.http.foo5 == "::1" + expect resp.http.foo6 == "::1" + expect resp.http.bar1 == "80" + expect resp.http.bar2 == "8000" + expect resp.http.bar3 == "8000" + expect resp.http.bar4 == "80" + expect resp.http.bar5 == "80" + expect resp.http.bar6 == "8000" +} -run + +varnish v1 -errvcl "could not be resolved to an IP address" { + import ${vmod_std}; + + sub vcl_deliver { + set resp.http.foo = std.ip("..", "::1::2"); + } +} + +varnish v1 -errvcl "could not be resolved to an IP address" { + import ${vmod_std}; + + sub vcl_deliver { + set resp.http.foo = std.ip("..", "1.2.3.4::80"); + } +} diff --git a/lib/libvarnish/vss.c b/lib/libvarnish/vss.c index 6d1b809..3d40473 100644 --- a/lib/libvarnish/vss.c +++ b/lib/libvarnish/vss.c @@ -56,6 +56,7 @@ * "0.0.0.0" - "0.0.0.0:80" * "[::1]" - "[::1]:80" * "[::]" - "[::]:80" + * "::1" * * See also RFC5952 */ @@ -86,6 +87,8 @@ vss_parse(char *str, char **addr, char **port) p = strchr(str, ':'); if (p == NULL) return (NULL); + if (p[0] == ':' && strchr(&p[1], ':')) + return (NULL); if (p == str) *addr = NULL; } From phk at FreeBSD.org Thu Nov 5 09:47:41 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 05 Nov 2015 10:47:41 +0100 Subject: [master] a7bba54 Make vcc_expr0() do the stringification (if necessary) rather than have all (but one) caller do it. Message-ID: commit a7bba54aaa83d1a29cba08a0da101b4b09dc1e6e Author: Poul-Henning Kamp Date: Thu Nov 5 09:46:59 2015 +0000 Make vcc_expr0() do the stringification (if necessary) rather than have all (but one) caller do it. diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c index b498a53..5989f07 100644 --- a/lib/libvcc/vcc_expr.c +++ b/lib/libvcc/vcc_expr.c @@ -461,10 +461,6 @@ vcc_Eval_Regsub(struct vcc *tl, struct expr **e, const struct symbol *sym) vcc_expr0(tl, &e2, STRING); if (e2 == NULL) return; - if (e2->fmt != STRING) { - vcc_expr_tostring(tl, &e2, STRING); - ERRCHK(tl); - } SkipToken(tl, ','); ExpectErr(tl, CSTR); @@ -478,10 +474,6 @@ vcc_Eval_Regsub(struct vcc *tl, struct expr **e, const struct symbol *sym) vcc_expr0(tl, &e2, STRING); if (e2 == NULL) return; - if (e2->fmt != STRING) { - vcc_expr_tostring(tl, &e2, STRING); - ERRCHK(tl); - } *e = vcc_expr_edit(STRING, "\v1,\n\v2)\v-", *e, e2); SkipToken(tl, ')'); } @@ -626,9 +618,6 @@ vcc_do_arg(struct vcc *tl, struct func_arg *fa) } else { vcc_expr0(tl, &e2, fa->type); ERRCHK(tl); - if (e2->fmt != fa->type && - (fa->type == STRING || fa->type == STRING_LIST)) - vcc_expr_tostring(tl, &e2, fa->type); if (e2->fmt != fa->type) { VSB_printf(tl->sb, "Wrong argument type."); VSB_printf(tl->sb, " Expected %s.", @@ -1334,24 +1323,28 @@ vcc_expr0(struct vcc *tl, struct expr **e, enum var_type fmt) *e = NULL; vcc_expr_cand(tl, e, fmt); ERRCHK(tl); - if ((*e)->fmt != BOOL || tl->t->tok != T_COR) - return; - *e = vcc_expr_edit(BOOL, "(\v+\n\v1", *e, NULL); - while (tl->t->tok == T_COR) { - vcc_NextToken(tl); - tk = tl->t; - vcc_expr_cand(tl, &e2, fmt); - ERRCHK(tl); - if (e2->fmt != BOOL) { - VSB_printf(tl->sb, - "'||' must be followed by BOOL, found "); - VSB_printf(tl->sb, "%s.\n", vcc_Type(e2->fmt)); - vcc_ErrWhere2(tl, tk, tl->t); - return; + if ((*e)->fmt == BOOL && tl->t->tok == T_COR) { + *e = vcc_expr_edit(BOOL, "(\v+\n\v1", *e, NULL); + while (tl->t->tok == T_COR) { + vcc_NextToken(tl); + tk = tl->t; + vcc_expr_cand(tl, &e2, fmt); + ERRCHK(tl); + if (e2->fmt != BOOL) { + VSB_printf(tl->sb, + "'||' must be followed by BOOL, found "); + VSB_printf(tl->sb, "%s.\n", vcc_Type(e2->fmt)); + vcc_ErrWhere2(tl, tk, tl->t); + return; + } + *e = vcc_expr_edit(BOOL, "\v1\v-\n||\v+\n\v2", *e, e2); } - *e = vcc_expr_edit(BOOL, "\v1\v-\n||\v+\n\v2", *e, e2); + *e = vcc_expr_edit(BOOL, "\v1\v-\n)", *e, NULL); + } + if (fmt == STRING || fmt == STRING_LIST) { + vcc_expr_tostring(tl, e, fmt); + ERRCHK(tl); } - *e = vcc_expr_edit(BOOL, "\v1\v-\n)", *e, NULL); } /*-------------------------------------------------------------------- @@ -1373,10 +1366,6 @@ vcc_Expr(struct vcc *tl, enum var_type fmt) vcc_expr0(tl, &e, fmt); ERRCHK(tl); e->t1 = t1; - if (fmt == STRING || fmt == STRING_LIST) { - vcc_expr_tostring(tl, &e, fmt); - ERRCHK(tl); - } if (!tl->err && fmt != e->fmt) { VSB_printf(tl->sb, "Expression has type %s, expected %s\n", vcc_Type(e->fmt), vcc_Type(fmt)); From fgsch at lodoss.net Sat Nov 7 18:47:23 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Sat, 07 Nov 2015 19:47:23 +0100 Subject: [master] aa1b15b Fix proxy protocol v1 client port Message-ID: commit aa1b15b1caeda73910b72a2b11d5edf09e75782b Author: Federico G. Schwindt Date: Sat Nov 7 18:03:55 2015 +0000 Fix proxy protocol v1 client port Most likely missed when #1727 was addressed. Submitted by: Rafael Zalamena on varnish-dev diff --git a/bin/varnishd/proxy/cache_proxy_proto.c b/bin/varnishd/proxy/cache_proxy_proto.c index 604d796..6f64f3a 100644 --- a/bin/varnishd/proxy/cache_proxy_proto.c +++ b/bin/varnishd/proxy/cache_proxy_proto.c @@ -125,7 +125,7 @@ vpx_proto1(const struct worker *wrk, struct req *req) SES_Reserve_client_addr(req->sp, &sa); AN(VSA_Build(sa, res->ai_addr, res->ai_addrlen)); SES_Set_String_Attr(req->sp, SA_CLIENT_IP, fld[1]); - SES_Set_String_Attr(req->sp, SA_CLIENT_PORT, fld[2]); + SES_Set_String_Attr(req->sp, SA_CLIENT_PORT, fld[3]); freeaddrinfo(res); i = getaddrinfo(fld[2], fld[4], &hints, &res); diff --git a/bin/varnishtest/tests/o00000.vtc b/bin/varnishtest/tests/o00000.vtc index 0cb518a..7cebb63 100644 --- a/bin/varnishtest/tests/o00000.vtc +++ b/bin/varnishtest/tests/o00000.vtc @@ -134,6 +134,11 @@ client c1 { } -run delay .1 +logexpect l1 -v v1 { + expect * * ReqStart "1.2.3.4 1234" + expect * * ReqStart "1:f::2 1234" +} -start + # Finally try something which works... client c1 { send "PROXY TCP4 1.2.3.4 5.6.7.8 1234 5678\r\n" @@ -167,6 +172,8 @@ client c1 { } -run delay .1 +logexpect l1 -wait + # Try with appended request (See also: #1728) client c1 { send "PROXY TCP6 1:f::3 5:a::8 1234 5678\r\nGET /3 HTTP/1.1\r\nHdr1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n\r\n" From phk at FreeBSD.org Mon Nov 9 09:46:22 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 09 Nov 2015 10:46:22 +0100 Subject: [master] ab43f41 White space ocd Message-ID: commit ab43f413e71777d19a555ce16b6c833b791ea462 Author: Poul-Henning Kamp Date: Mon Nov 9 08:54:16 2015 +0000 White space ocd diff --git a/bin/varnishtest/tests/c00007.vtc b/bin/varnishtest/tests/c00007.vtc index 5238226..016ae78 100644 --- a/bin/varnishtest/tests/c00007.vtc +++ b/bin/varnishtest/tests/c00007.vtc @@ -1,5 +1,5 @@ varnishtest "Test banning a hash" -varnish v1 -arg "-b 127.0.0.1:80" -start +varnish v1 -arg "-b 127.0.0.1:80" -start varnish v1 -clierr 101 "ban.hash foo" diff --git a/bin/varnishtest/tests/o00000.vtc b/bin/varnishtest/tests/o00000.vtc index 7cebb63..ccfaa65 100644 --- a/bin/varnishtest/tests/o00000.vtc +++ b/bin/varnishtest/tests/o00000.vtc @@ -135,8 +135,8 @@ client c1 { delay .1 logexpect l1 -v v1 { - expect * * ReqStart "1.2.3.4 1234" - expect * * ReqStart "1:f::2 1234" + expect * * ReqStart "1.2.3.4 1234" + expect * * ReqStart "1:f::2 1234" } -start # Finally try something which works... diff --git a/bin/varnishtest/tests/r01810.vtc b/bin/varnishtest/tests/r01810.vtc index 77e84db..bf6d0f1 100644 --- a/bin/varnishtest/tests/r01810.vtc +++ b/bin/varnishtest/tests/r01810.vtc @@ -8,7 +8,7 @@ server s1 { delay .4 } -start -varnish v1 -vcl+backend { +varnish v1 -vcl+backend { sub vcl_backend_fetch { set bereq.proto = "HTTP/1.0"; } From phk at FreeBSD.org Mon Nov 9 09:46:22 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 09 Nov 2015 10:46:22 +0100 Subject: [master] 91755a0 Return 500 if we cannot decode the stored object into the resp.* This can happen in a number of obscure corner-cases, which do not warrant a panic. Message-ID: commit 91755a001a9691b3ce12c20ea1402164685c7ed9 Author: Poul-Henning Kamp Date: Mon Nov 9 09:45:13 2015 +0000 Return 500 if we cannot decode the stored object into the resp.* This can happen in a number of obscure corner-cases, which do not warrant a panic. Fixes: #1807 diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c index 9080641..8e3fe0f 100644 --- a/bin/varnishd/cache/cache_http.c +++ b/bin/varnishd/cache/cache_http.c @@ -863,26 +863,30 @@ HTTP_Decode(struct http *to, const uint8_t *fm) { CHECK_OBJ_NOTNULL(to, HTTP_MAGIC); + AN(to->vsl); AN(fm); - if (vbe16dec(fm) > to->shd) - return(-1); - to->status = vbe16dec(fm + 2); - fm += 4; - for (to->nhd = 0; to->nhd < to->shd; to->nhd++) { - if (to->nhd == HTTP_HDR_METHOD || to->nhd == HTTP_HDR_URL) { - to->hd[to->nhd].b = NULL; - to->hd[to->nhd].e = NULL; - continue; - } - if (*fm == '\0') - return (0); - to->hd[to->nhd].b = (const void*)fm; - fm = (const void*)strchr((const void*)fm, '\0'); - to->hd[to->nhd].e = (const void*)fm; - fm++; - if (to->vsl != NULL) + if (vbe16dec(fm) <= to->shd) { + to->status = vbe16dec(fm + 2); + fm += 4; + for (to->nhd = 0; to->nhd < to->shd; to->nhd++) { + if (to->nhd == HTTP_HDR_METHOD || + to->nhd == HTTP_HDR_URL) { + to->hd[to->nhd].b = NULL; + to->hd[to->nhd].e = NULL; + continue; + } + if (*fm == '\0') + return (0); + to->hd[to->nhd].b = (const void*)fm; + fm = (const void*)strchr((const void*)fm, '\0'); + to->hd[to->nhd].e = (const void*)fm; + fm++; http_VSLH(to, to->nhd); + } } + VSLb(to->vsl, SLT_Error, + "Too many headers to Decode object (%u vs. %u)", + vbe16dec(fm), to->shd); return (-1); } diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index b7afe84..da59078 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -129,8 +129,12 @@ cnt_deliver(struct worker *wrk, struct req *req) EXP_Touch(req->objcore, req->t_prev); HTTP_Setup(req->resp, req->ws, req->vsl, SLT_RespMethod); - AZ(HTTP_Decode(req->resp, - ObjGetattr(req->wrk, req->objcore, OA_HEADERS, NULL))); + if (HTTP_Decode(req->resp, + ObjGetattr(req->wrk, req->objcore, OA_HEADERS, NULL))) { + req->err_code = 500; + req->req_step = R_STP_SYNTH; + return (REQ_FSM_MORE); + } http_ForceField(req->resp, HTTP_HDR_PROTO, "HTTP/1.1"); if (req->is_hit) @@ -493,9 +497,9 @@ cnt_miss(struct worker *wrk, struct req *req) case VCL_RET_FETCH: wrk->stats->cache_miss++; VBF_Fetch(wrk, req, req->objcore, req->stale_oc, VBF_NORMAL); - req->req_step = R_STP_FETCH; if (req->stale_oc != NULL) (void)HSH_DerefObjCore(wrk, &req->stale_oc); + req->req_step = R_STP_FETCH; return (REQ_FSM_MORE); case VCL_RET_SYNTH: req->req_step = R_STP_SYNTH; diff --git a/bin/varnishtest/tests/r01807.vtc b/bin/varnishtest/tests/r01807.vtc new file mode 100644 index 0000000..4696cd1 --- /dev/null +++ b/bin/varnishtest/tests/r01807.vtc @@ -0,0 +1,50 @@ +varnishtest "Decreasing http_max_hdr" + +server s1 { + rxreq + txresp \ + -hdr "h00: 00" \ + -hdr "h01: 01" \ + -hdr "h02: 02" \ + -hdr "h03: 03" \ + -hdr "h04: 04" \ + -hdr "h05: 05" \ + -hdr "h06: 06" \ + -hdr "h07: 07" \ + -hdr "h08: 08" \ + -hdr "h09: 09" \ + -hdr "h10: 10" \ + -hdr "h11: 11" \ + -hdr "h12: 12" \ + -hdr "h13: 13" \ + -hdr "h14: 14" \ + -hdr "h15: 15" \ + -hdr "h16: 16" \ + -hdr "h17: 17" \ + -hdr "h18: 18" \ + -hdr "h19: 19" \ + -hdr "h20: 20" \ + -hdr "h21: 21" \ + -hdr "h22: 22" \ + -hdr "h23: 23" \ + -hdr "h24: 24" +} -start + +varnish v1 -vcl+backend { +} -start + +client c1 { + txreq + rxresp + expect resp.status == 200 + expect resp.http.h24 == 24 +} -run + +varnish v1 -cliok {param.set http_max_hdr 32} + +client c1 { + txreq + rxresp + expect resp.status == 500 +} -run + From fgsch at lodoss.net Mon Nov 9 10:32:19 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Mon, 09 Nov 2015 11:32:19 +0100 Subject: [master] d1fdd6b Add copyright notice and date where missing Message-ID: commit d1fdd6b4fe764789fa35c472858278eee17437f3 Author: Federico G. Schwindt Date: Mon Nov 9 10:31:28 2015 +0000 Add copyright notice and date where missing Also sort see also correctly. Fix #1795 diff --git a/doc/sphinx/reference/varnish-cli.rst b/doc/sphinx/reference/varnish-cli.rst index 934ff1e..c55ecf8 100644 --- a/doc/sphinx/reference/varnish-cli.rst +++ b/doc/sphinx/reference/varnish-cli.rst @@ -308,8 +308,8 @@ the backend contains "USERID=1663":: SEE ALSO ======== -* :ref:`varnishd(1)` * :ref:`varnishadm(1)` +* :ref:`varnishd(1)` * :ref:`vcl(7)` HISTORY diff --git a/doc/sphinx/reference/varnishd.rst b/doc/sphinx/reference/varnishd.rst index f76f031..3372939 100644 --- a/doc/sphinx/reference/varnishd.rst +++ b/doc/sphinx/reference/varnishd.rst @@ -350,12 +350,12 @@ The `varnishd` master process may also OR its exit code SEE ALSO ======== -* :ref:`varnish-cli(7)` * :ref:`varnishlog(1)` * :ref:`varnishhist(1)` * :ref:`varnishncsa(1)` * :ref:`varnishstat(1)` * :ref:`varnishtop(1)` +* :ref:`varnish-cli(7)` * :ref:`vcl(7)` HISTORY diff --git a/doc/sphinx/reference/vsl-query.rst b/doc/sphinx/reference/vsl-query.rst index 2c15453..e757285 100644 --- a/doc/sphinx/reference/vsl-query.rst +++ b/doc/sphinx/reference/vsl-query.rst @@ -278,3 +278,12 @@ HISTORY This document was written by Martin Blix Grydeland. + +COPYRIGHT +========= + +This document is licensed under the same licence as Varnish +itself. See LICENCE for details. + +* Copyright (c) 2006 Verdens Gang AS +* Copyright (c) 2006-2015 Varnish Software AS diff --git a/doc/sphinx/reference/vsl.rst b/doc/sphinx/reference/vsl.rst index 0e753b0..1aafd28 100644 --- a/doc/sphinx/reference/vsl.rst +++ b/doc/sphinx/reference/vsl.rst @@ -112,7 +112,16 @@ Martin Blix Grydeland. SEE ALSO ======== -* :ref:`varnishlog(1)` * :ref:`varnishhist(1)` +* :ref:`varnishlog(1)` * :ref:`varnishncsa(1)` * :ref:`varnishtop(1)` + +COPYRIGHT +========= + +This document is licensed under the same licence as Varnish +itself. See LICENCE for details. + +* Copyright (c) 2006 Verdens Gang AS +* Copyright (c) 2006-2015 Varnish Software AS diff --git a/lib/libvmod_directors/vmod.vcc b/lib/libvmod_directors/vmod.vcc index 02b5a3f..8522920 100644 --- a/lib/libvmod_directors/vmod.vcc +++ b/lib/libvmod_directors/vmod.vcc @@ -132,9 +132,9 @@ Description to this director. Example + # 2/3 to backend1, 1/3 to backend2. vdir.add_backend(backend1, 10.0); vdir.add_backend(backend2, 5.0); - # 2/3 to backend1, 1/3 to backend2. $Method BACKEND .backend() @@ -180,3 +180,11 @@ Description Example # pick a backend based on the cookie header from the client set req.backend_hint = vdir.backend(req.http.cookie); + +COPYRIGHT +========= + +This document is licensed under the same licence as Varnish +itself. See LICENCE for details. + +* Copyright (c) 2013-2015 Varnish Software AS diff --git a/lib/libvmod_std/vmod.vcc b/lib/libvmod_std/vmod.vcc index 2e20825..b0dba07 100644 --- a/lib/libvmod_std/vmod.vcc +++ b/lib/libvmod_std/vmod.vcc @@ -272,8 +272,8 @@ Example SEE ALSO ======== -* :ref:`vsl(7)` * :ref:`varnishd(1)` +* :ref:`vsl(7)` HISTORY ======= @@ -287,3 +287,5 @@ COPYRIGHT This document is licensed under the same licence as Varnish itself. See LICENCE for details. + +* Copyright (c) 2010-2015 Varnish Software AS diff --git a/man/vsc2rst.c b/man/vsc2rst.c index d9ad471..93950f0 100644 --- a/man/vsc2rst.c +++ b/man/vsc2rst.c @@ -118,5 +118,13 @@ int main(int argc, char **argv) #include "tbl/vsc_fields.h" #undef VSC_DO_LCK + P(""); + P("COPYRIGHT"); + P("========="); + P("This document is licensed under the same licence as Varnish"); + P("itself. See LICENCE for details."); + P(""); + P("* Copyright (c) 2006 Verdens Gang AS"); + P("* Copyright (c) 2006-2015 Varnish Software AS"); return (0); } From martin at varnish-software.com Mon Nov 9 14:11:15 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Mon, 09 Nov 2015 15:11:15 +0100 Subject: [master] e285623 Allow varnishncsa logformat to be read from a file. Adds supports to varnishncsa for specifying the logging format by reading the log format from a file using the option "-f". Since -f means prefer X-Forwarded-For over client.ip in Varnish 3, maybe we should use another option letter. Message-ID: commit e285623065145d41512659b3b99c4d6e54a57d78 Author: Kristian Gr?nfeldt S?rensen Date: Mon Dec 15 12:59:17 2014 +0100 Allow varnishncsa logformat to be read from a file. Adds supports to varnishncsa for specifying the logging format by reading the log format from a file using the option "-f". Since -f means prefer X-Forwarded-For over client.ip in Varnish 3, maybe we should use another option letter. diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c index b19b679..f9de015 100644 --- a/bin/varnishncsa/varnishncsa.c +++ b/bin/varnishncsa/varnishncsa.c @@ -933,6 +933,28 @@ sighup(void) return (1); } +static char * +read_format(const char *formatfile) +{ + FILE *fmtfile; + size_t len = 0; + char *fmt = NULL; + + fmtfile = fopen(formatfile, "r"); + if (fmtfile == NULL) + VUT_Error(1, "Can't open format file (%s)", strerror(errno)); + if (getline(&fmt, &len, fmtfile) == -1) { + free(fmt); + if (feof(fmtfile)) + VUT_Error(1, "Empty format file"); + else + VUT_Error(1, "Can't read format from file (%s)", + strerror(errno)); + } + fclose(fmtfile); + return (fmt); +} + int main(int argc, char * const *argv) { @@ -962,6 +984,13 @@ main(int argc, char * const *argv) format = strdup(optarg); AN(format); break; + case 'f': + /* Format string from file */ + if (format != NULL) + free(format); + format = read_format(optarg); + AN(format); + break; case 'h': /* Usage help */ usage(0); diff --git a/bin/varnishncsa/varnishncsa_options.h b/bin/varnishncsa/varnishncsa_options.h index 291a1c7..24567c2 100644 --- a/bin/varnishncsa/varnishncsa_options.h +++ b/bin/varnishncsa/varnishncsa_options.h @@ -40,6 +40,14 @@ "Set the output log format string." \ ) +#define NCSA_OPT_f \ + VOPT("f:", "[-f formatfile]", "Read output format from file", \ + "Read output format from a file. Will read a single line" \ + " from the specified file, and use that line as the" \ + " format." \ + ) + + #define NCSA_OPT_g \ VOPT("g:", "[-g ]", "Grouping mode (default: vxid)", \ "The grouping of the log records. The default is to group" \ @@ -60,6 +68,7 @@ VSL_OPT_C VUT_OPT_d VUT_OPT_D NCSA_OPT_F +NCSA_OPT_f NCSA_OPT_g VUT_OPT_h VUT_OPT_n From noreply at github.com Mon Nov 9 14:28:55 2015 From: noreply at github.com (GitHub) Date: Mon, 09 Nov 2015 06:28:55 -0800 Subject: [varnishcache/varnish-cache] e28562: Allow varnishncsa logformat to be read from a file... Message-ID: <5640ada751635_5d203fa4eacc12c01004e6@hookshot-fe6-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: e285623065145d41512659b3b99c4d6e54a57d78 https://github.com/varnishcache/varnish-cache/commit/e285623065145d41512659b3b99c4d6e54a57d78 Author: Kristian Gr?nfeldt S?rensen Date: 2015-11-09 (Mon, 09 Nov 2015) Changed paths: M bin/varnishncsa/varnishncsa.c M bin/varnishncsa/varnishncsa_options.h Log Message: ----------- Allow varnishncsa logformat to be read from a file. Adds supports to varnishncsa for specifying the logging format by reading the log format from a file using the option "-f". Since -f means prefer X-Forwarded-For over client.ip in Varnish 3, maybe we should use another option letter. From lkarsten at varnish-software.com Mon Nov 9 14:36:38 2015 From: lkarsten at varnish-software.com (Lasse Karstensen) Date: Mon, 09 Nov 2015 15:36:38 +0100 Subject: [master] 2dfef53 Testing commit hook. Message-ID: commit 2dfef5322d6048db8557ea206c72e53bf425bdd1 Author: Lasse Karstensen Date: Mon Nov 9 15:36:37 2015 +0100 Testing commit hook. diff --git a/CONTRIBUTING b/CONTRIBUTING index 43aba53..64d63d9 100644 --- a/CONTRIBUTING +++ b/CONTRIBUTING @@ -12,11 +12,9 @@ Official development tree is here: Patches can be sent to varnish-dev at varnish-cache.org. - Github pull requests -------------------- Documentation updates and other non-trivial items for the documentation team may be sent as Github pull requests. -Pull requests outside of this scope will be closed without review. From lkarsten at varnish-software.com Mon Nov 9 14:39:56 2015 From: lkarsten at varnish-software.com (Lasse Karstensen) Date: Mon, 09 Nov 2015 06:39:56 -0800 Subject: [varnishcache/varnish-cache] 2dfef5: Testing commit hook. Message-ID: <5640b03c48f96_20553fa576a232c09947c@hookshot-fe2-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 2dfef5322d6048db8557ea206c72e53bf425bdd1 https://github.com/varnishcache/varnish-cache/commit/2dfef5322d6048db8557ea206c72e53bf425bdd1 Author: Lasse Karstensen Date: 2015-11-09 (Mon, 09 Nov 2015) Changed paths: M CONTRIBUTING Log Message: ----------- Testing commit hook. From phk at FreeBSD.org Tue Nov 10 10:54:10 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 10 Nov 2015 11:54:10 +0100 Subject: [master] 91d77ac Modify the ban_lurker so we lift oc's as far up the ban-list as we can when we check a batch of lurkable bans. Message-ID: commit 91d77ac75fba9e8240966ce3e52771118e92b3a0 Author: Poul-Henning Kamp Date: Tue Nov 10 10:52:01 2015 +0000 Modify the ban_lurker so we lift oc's as far up the ban-list as we can when we check a batch of lurkable bans. For obj.* only bans, this should concentrate the entire list at the very top. If there are req.* bans, the oc's end up on the bans right below the req.* bans. Fixes #1635 (As much as we can fix it) diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c index 3bf9073..c8971bc 100644 --- a/bin/varnishd/cache/cache_ban.c +++ b/bin/varnishd/cache/cache_ban.c @@ -159,14 +159,16 @@ ban_mark_completed(struct ban *b) Lck_AssertHeld(&ban_mtx); AN(b->spec); - AZ(b->flags & BANS_FLAG_COMPLETED); - ln = ban_len(b->spec); - b->flags |= BANS_FLAG_COMPLETED; - b->spec[BANS_FLAGS] |= BANS_FLAG_COMPLETED; - VWMB(); - vbe32enc(b->spec + BANS_LENGTH, BANS_HEAD_LEN); - VSC_C_main->bans_completed++; - VSC_C_main->bans_persisted_fragmentation += ln - ban_len(b->spec); + if (!(b->flags & BANS_FLAG_COMPLETED)) { + ln = ban_len(b->spec); + b->flags |= BANS_FLAG_COMPLETED; + b->spec[BANS_FLAGS] |= BANS_FLAG_COMPLETED; + VWMB(); + vbe32enc(b->spec + BANS_LENGTH, BANS_HEAD_LEN); + VSC_C_main->bans_completed++; + VSC_C_main->bans_persisted_fragmentation += + ln - ban_len(b->spec); + } } /*-------------------------------------------------------------------- @@ -683,7 +685,7 @@ ccf_ban_list(struct cli *cli, const char * const *av, void *priv) o = bl == b ? 1 : 0; VCLI_Out(cli, "%10.6f %5ju %s", ban_time(b->spec), (intmax_t)b->refcount - o, - b->flags & BANS_FLAG_COMPLETED ? "C" : " "); + b->flags & BANS_FLAG_COMPLETED ? "C" : "-"); if (DO_DEBUG(DBG_LURKER)) { VCLI_Out(cli, "%s%s %p ", b->flags & BANS_FLAG_REQ ? "R" : "-", diff --git a/bin/varnishd/cache/cache_ban_lurker.c b/bin/varnishd/cache/cache_ban_lurker.c index 352b219..63371f8 100644 --- a/bin/varnishd/cache/cache_ban_lurker.c +++ b/bin/varnishd/cache/cache_ban_lurker.c @@ -112,7 +112,9 @@ ban_lurker_getfirst(struct vsl_log *vsl, struct ban *bt) } else { /* * We got the lock, and the oc is not being - * dismantled under our feet, run with it... + * dismantled under our feet. + * Take it off the ban and (optimistically) + * put it on the * destination ban */ AZ(oc->flags & OC_F_BUSY); oc->refcnt += 1; @@ -135,7 +137,7 @@ ban_lurker_getfirst(struct vsl_log *vsl, struct ban *bt) static void ban_lurker_test_ban(struct worker *wrk, struct vsl_log *vsl, struct ban *bt, - struct banhead_s *obans) + struct banhead_s *obans, struct ban *bd) { struct ban *bl, *bln; struct objcore *oc; @@ -182,6 +184,17 @@ ban_lurker_test_ban(struct worker *wrk, struct vsl_log *vsl, struct ban *bt, EXP_Rearm(oc, oc->exp.t_origin, 0, 0, 0); // XXX ^ fake now VSC_C_main->bans_lurker_obj_killed++; + } else { + if (oc->ban != bd) { + Lck_Lock(&ban_mtx); + oc->ban->refcount--; + VTAILQ_REMOVE(&oc->ban->objcore, oc, ban_list); + oc->ban = bd; + bd->refcount++; + VTAILQ_INSERT_TAIL(&bd->objcore, oc, ban_list); + Lck_Unlock(&ban_mtx); + ObjUpdateMeta(wrk, oc); + } } (void)HSH_DerefObjCore(wrk, &oc); } @@ -194,63 +207,43 @@ ban_lurker_test_ban(struct worker *wrk, struct vsl_log *vsl, struct ban *bt, static double ban_lurker_work(struct worker *wrk, struct vsl_log *vsl) { - struct ban *b, *bt; + struct ban *b, *bd; struct banhead_s obans; double d, dt, n; - int i; dt = 49.62; // Random, non-magic if (cache_param->ban_lurker_sleep == 0) return (dt); - /* Make a list of the bans we can do something about */ - VTAILQ_INIT(&obans); + Lck_Lock(&ban_mtx); b = ban_start; Lck_Unlock(&ban_mtx); - i = 0; d = VTIM_real() - cache_param->ban_lurker_age; + bd = NULL; + VTAILQ_INIT(&obans); for (; b != NULL; b = VTAILQ_NEXT(b, list)) { + if (bd != NULL) + ban_lurker_test_ban(wrk, vsl, b, &obans, bd); if (b->flags & BANS_FLAG_COMPLETED) continue; - if (b->flags & BANS_FLAG_REQ) + if (b->flags & BANS_FLAG_REQ) { + bd = VTAILQ_NEXT(b, list); continue; - if (b == VTAILQ_LAST(&ban_head, banhead_s)) - continue; // XXX: why ? + } n = ban_time(b->spec) - d; if (n < 0) { VTAILQ_INSERT_TAIL(&obans, b, l_list); - i++; + if (bd == NULL) + bd = b; } else if (n < dt) { dt = n; } } - if (DO_DEBUG(DBG_LURKER)) - VSLb(vsl, SLT_Debug, "lurker: %d actionable bans, dt = %lf", i, dt); - if (i == 0) - return (dt); - dt = cache_param->ban_lurker_sleep; - /* Go though all the bans to test the objects */ - VTAILQ_FOREACH_REVERSE(bt, &ban_head, banhead_s, list) { - if (bt == VTAILQ_LAST(&obans, banhead_s)) { - if (DO_DEBUG(DBG_LURKER)) - VSLb(vsl, SLT_Debug, - "Lurk bt completed %p", bt); - Lck_Lock(&ban_mtx); - /* We can be raced by a new ban */ - if (!(bt->flags & BANS_FLAG_COMPLETED)) - ban_mark_completed(bt); - Lck_Unlock(&ban_mtx); - VTAILQ_REMOVE(&obans, bt, l_list); - if (VTAILQ_EMPTY(&obans)) - break; - } - if (DO_DEBUG(DBG_LURKER)) - VSLb(vsl, SLT_Debug, "Lurk bt %p", bt); - ban_lurker_test_ban(wrk, vsl, bt, &obans); - if (VTAILQ_EMPTY(&obans)) - break; - } + Lck_Lock(&ban_mtx); + VTAILQ_FOREACH(b, &obans, l_list) + ban_mark_completed(b); + Lck_Unlock(&ban_mtx); return (dt); } @@ -268,9 +261,9 @@ ban_lurker(struct worker *wrk, void *priv) while (!ban_shutdown) { d = ban_lurker_work(wrk, &vsl); + ban_cleantail(); if (DO_DEBUG(DBG_LURKER)) VSLb(&vsl, SLT_Debug, "lurker: sleep = %lf", d); - ban_cleantail(); d += VTIM_real(); Lck_Lock(&ban_mtx); if (gen == ban_generation) { diff --git a/bin/varnishtest/tests/c00049.vtc b/bin/varnishtest/tests/c00049.vtc index 8d10e68..e86c513 100644 --- a/bin/varnishtest/tests/c00049.vtc +++ b/bin/varnishtest/tests/c00049.vtc @@ -94,7 +94,7 @@ client c1 { } -run # Get the VSL out of the way -delay .1 +delay 1 varnish v1 -cliok "ban.list" @@ -115,18 +115,20 @@ varnish v1 -expect bans_dups == 0 varnish v1 -cliok "param.set ban_lurker_sleep .01" +delay 1 + varnish v1 -cliok "ban.list" -delay 2 +delay 1 varnish v1 -cliok "ban.list" -varnish v1 -expect bans == 5 -varnish v1 -expect bans_completed == 4 +varnish v1 -expect bans == 4 +varnish v1 -expect bans_completed == 3 varnish v1 -expect bans_req == 1 -varnish v1 -expect bans_obj == 4 +varnish v1 -expect bans_obj == 3 varnish v1 -expect bans_added == 6 -varnish v1 -expect bans_deleted == 1 +varnish v1 -expect bans_deleted == 2 varnish v1 -expect bans_tested == 0 varnish v1 -expect bans_tests_tested == 0 varnish v1 -expect bans_obj_killed == 0 From phk at FreeBSD.org Tue Nov 10 10:55:13 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 10 Nov 2015 02:55:13 -0800 Subject: [varnishcache/varnish-cache] 91d77a: Modify the ban_lurker so we lift oc's as far up th... Message-ID: <5641cd11dc199_78443fe68fab529c5533@hookshot-fe4-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 91d77ac75fba9e8240966ce3e52771118e92b3a0 https://github.com/varnishcache/varnish-cache/commit/91d77ac75fba9e8240966ce3e52771118e92b3a0 Author: Poul-Henning Kamp Date: 2015-11-10 (Tue, 10 Nov 2015) Changed paths: M bin/varnishd/cache/cache_ban.c M bin/varnishd/cache/cache_ban_lurker.c M bin/varnishtest/tests/c00049.vtc Log Message: ----------- Modify the ban_lurker so we lift oc's as far up the ban-list as we can when we check a batch of lurkable bans. For obj.* only bans, this should concentrate the entire list at the very top. If there are req.* bans, the oc's end up on the bans right below the req.* bans. Fixes #1635 (As much as we can fix it) From phk at FreeBSD.org Wed Nov 11 10:04:55 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 11 Nov 2015 11:04:55 +0100 Subject: [master] cff85bf White space OCD Message-ID: commit cff85bf81b7871cc804226456a452413a2d7e05b Author: Poul-Henning Kamp Date: Wed Nov 11 10:04:23 2015 +0000 White space OCD diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c index f9de015..d46bee8 100644 --- a/bin/varnishncsa/varnishncsa.c +++ b/bin/varnishncsa/varnishncsa.c @@ -936,23 +936,23 @@ sighup(void) static char * read_format(const char *formatfile) { - FILE *fmtfile; - size_t len = 0; - char *fmt = NULL; - - fmtfile = fopen(formatfile, "r"); - if (fmtfile == NULL) - VUT_Error(1, "Can't open format file (%s)", strerror(errno)); - if (getline(&fmt, &len, fmtfile) == -1) { - free(fmt); - if (feof(fmtfile)) - VUT_Error(1, "Empty format file"); - else - VUT_Error(1, "Can't read format from file (%s)", + FILE *fmtfile; + size_t len = 0; + char *fmt = NULL; + + fmtfile = fopen(formatfile, "r"); + if (fmtfile == NULL) + VUT_Error(1, "Can't open format file (%s)", strerror(errno)); + if (getline(&fmt, &len, fmtfile) == -1) { + free(fmt); + if (feof(fmtfile)) + VUT_Error(1, "Empty format file"); + else + VUT_Error(1, "Can't read format from file (%s)", strerror(errno)); - } - fclose(fmtfile); - return (fmt); + } + fclose(fmtfile); + return (fmt); } int diff --git a/bin/varnishncsa/varnishncsa_options.h b/bin/varnishncsa/varnishncsa_options.h index 24567c2..f141ad0 100644 --- a/bin/varnishncsa/varnishncsa_options.h +++ b/bin/varnishncsa/varnishncsa_options.h @@ -40,10 +40,10 @@ "Set the output log format string." \ ) -#define NCSA_OPT_f \ - VOPT("f:", "[-f formatfile]", "Read output format from file", \ - "Read output format from a file. Will read a single line" \ - " from the specified file, and use that line as the" \ +#define NCSA_OPT_f \ + VOPT("f:", "[-f formatfile]", "Read output format from file", \ + "Read output format from a file. Will read a single line" \ + " from the specified file, and use that line as the" \ " format." \ ) From phk at FreeBSD.org Wed Nov 11 10:04:55 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 11 Nov 2015 11:04:55 +0100 Subject: [master] 8ca8f0b Make test r01576 depend on PCRE JIT being enabled. Message-ID: commit 8ca8f0b5a5d9ace7c45eb8458e21dcf0c0b24c2d Author: Poul-Henning Kamp Date: Wed Nov 11 10:04:32 2015 +0000 Make test r01576 depend on PCRE JIT being enabled. diff --git a/bin/varnishtest/tests/r01576.vtc b/bin/varnishtest/tests/r01576.vtc index 99398e3..b0fdb9f 100644 --- a/bin/varnishtest/tests/r01576.vtc +++ b/bin/varnishtest/tests/r01576.vtc @@ -1,5 +1,7 @@ varnishtest "Test recursive regexp's fail before consuming all the stack" +feature pcre_jit + server s1 { rxreq expect req.http.found == "1" diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c index f77f617..3c6c884 100644 --- a/bin/varnishtest/vtc.c +++ b/bin/varnishtest/vtc.c @@ -47,6 +47,7 @@ #include "vav.h" #include "vnum.h" +#include "vre.h" #include "vtim.h" #define MAX_TOKENS 200 @@ -578,6 +579,9 @@ cmd_feature(CMD_ARGS) if (sizeof(void*) == 8 && !strcmp(av[i], "64bit")) continue; + if (!strcmp(av[i], "pcre_jit") && VRE_has_jit) + continue; + if (!strcmp(av[i], "!OSX")) { #if !defined(__APPLE__) || !defined(__MACH__) continue; diff --git a/include/vre.h b/include/vre.h index a59e8d7..f19ff2c 100644 --- a/include/vre.h +++ b/include/vre.h @@ -48,6 +48,7 @@ typedef struct vre vre_t; #define VRE_ERROR_NOMATCH (-1) /* And those to PCRE options */ +extern const unsigned VRE_has_jit; extern const unsigned VRE_CASELESS; extern const unsigned VRE_NOTEMPTY; diff --git a/lib/libvarnish/vre.c b/lib/libvarnish/vre.c index 94400fa..0bf89f9 100644 --- a/lib/libvarnish/vre.c +++ b/lib/libvarnish/vre.c @@ -42,6 +42,8 @@ #define VRE_STUDY_JIT_COMPILE 0 #endif +const unsigned VRE_has_jit = VRE_STUDY_JIT_COMPILE; + #if PCRE_MAJOR < 8 || (PCRE_MAJOR == 8 && PCRE_MINOR < 20) # define pcre_free_study pcre_free #endif From phk at FreeBSD.org Wed Nov 11 10:05:13 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 11 Nov 2015 02:05:13 -0800 Subject: [varnishcache/varnish-cache] cff85b: White space OCD Message-ID: <564312d962b12_19523f9d5de0d2bc8872d@hookshot-fe2-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: cff85bf81b7871cc804226456a452413a2d7e05b https://github.com/varnishcache/varnish-cache/commit/cff85bf81b7871cc804226456a452413a2d7e05b Author: Poul-Henning Kamp Date: 2015-11-11 (Wed, 11 Nov 2015) Changed paths: M bin/varnishncsa/varnishncsa.c M bin/varnishncsa/varnishncsa_options.h Log Message: ----------- White space OCD Commit: 8ca8f0b5a5d9ace7c45eb8458e21dcf0c0b24c2d https://github.com/varnishcache/varnish-cache/commit/8ca8f0b5a5d9ace7c45eb8458e21dcf0c0b24c2d Author: Poul-Henning Kamp Date: 2015-11-11 (Wed, 11 Nov 2015) Changed paths: M bin/varnishtest/tests/r01576.vtc M bin/varnishtest/vtc.c M include/vre.h M lib/libvarnish/vre.c Log Message: ----------- Make test r01576 depend on PCRE JIT being enabled. Compare: https://github.com/varnishcache/varnish-cache/compare/91d77ac75fba...8ca8f0b5a5d9 From phk at FreeBSD.org Wed Nov 11 10:08:58 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 11 Nov 2015 11:08:58 +0100 Subject: [master] 59c6345 printf format fix Message-ID: commit 59c6345846dfe5cca62d99cfbb4e6934d64880a6 Author: Poul-Henning Kamp Date: Wed Nov 11 10:08:48 2015 +0000 printf format fix diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c index c8971bc..3042653 100644 --- a/bin/varnishd/cache/cache_ban.c +++ b/bin/varnishd/cache/cache_ban.c @@ -684,7 +684,7 @@ ccf_ban_list(struct cli *cli, const char * const *av, void *priv) VTAILQ_FOREACH(b, &ban_head, list) { o = bl == b ? 1 : 0; VCLI_Out(cli, "%10.6f %5ju %s", ban_time(b->spec), - (intmax_t)b->refcount - o, + (intmax_t)(b->refcount - o), b->flags & BANS_FLAG_COMPLETED ? "C" : "-"); if (DO_DEBUG(DBG_LURKER)) { VCLI_Out(cli, "%s%s %p ", From phk at FreeBSD.org Wed Nov 11 10:10:15 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 11 Nov 2015 02:10:15 -0800 Subject: [varnishcache/varnish-cache] 59c634: printf format fix Message-ID: <56431407768b0_7fb83f9a022092bc109310@hookshot-fe5-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 59c6345846dfe5cca62d99cfbb4e6934d64880a6 https://github.com/varnishcache/varnish-cache/commit/59c6345846dfe5cca62d99cfbb4e6934d64880a6 Author: Poul-Henning Kamp Date: 2015-11-11 (Wed, 11 Nov 2015) Changed paths: M bin/varnishd/cache/cache_ban.c Log Message: ----------- printf format fix From phk at FreeBSD.org Wed Nov 11 10:36:18 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 11 Nov 2015 11:36:18 +0100 Subject: [master] f0b60c0 init the condvar before we signal it Message-ID: commit f0b60c06b2de78b9833528d639445ca074990e88 Author: Poul-Henning Kamp Date: Wed Nov 11 10:36:06 2015 +0000 init the condvar before we signal it diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c index 3042653..565b5d1 100644 --- a/bin/varnishd/cache/cache_ban.c +++ b/bin/varnishd/cache/cache_ban.c @@ -761,8 +761,8 @@ BAN_Init(void) /* Add a placeholder ban */ bp = BAN_Build(); AN(bp); - AZ(BAN_Commit(bp)); AZ(pthread_cond_init(&ban_lurker_cond, NULL)); + AZ(BAN_Commit(bp)); Lck_Lock(&ban_mtx); ban_mark_completed(VTAILQ_FIRST(&ban_head)); Lck_Unlock(&ban_mtx); From phk at FreeBSD.org Wed Nov 11 10:40:15 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 11 Nov 2015 02:40:15 -0800 Subject: [varnishcache/varnish-cache] f0b60c: init the condvar before we signal it Message-ID: <56431b0f54829_fb63fcdc3ee72a03495@hookshot-fe2-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: f0b60c06b2de78b9833528d639445ca074990e88 https://github.com/varnishcache/varnish-cache/commit/f0b60c06b2de78b9833528d639445ca074990e88 Author: Poul-Henning Kamp Date: 2015-11-11 (Wed, 11 Nov 2015) Changed paths: M bin/varnishd/cache/cache_ban.c Log Message: ----------- init the condvar before we signal it From phk at FreeBSD.org Wed Nov 11 10:51:15 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 11 Nov 2015 11:51:15 +0100 Subject: [master] 8d0b30e Disable test r01576, it takes too much time and effort to keep it working across platforms. Message-ID: commit 8d0b30e77dbf5b1e87bfe147be37e0596323fe64 Author: Poul-Henning Kamp Date: Wed Nov 11 10:50:50 2015 +0000 Disable test r01576, it takes too much time and effort to keep it working across platforms. diff --git a/bin/varnishtest/tests.disabled/r01576.vtc b/bin/varnishtest/tests.disabled/r01576.vtc new file mode 100644 index 0000000..b0fdb9f --- /dev/null +++ b/bin/varnishtest/tests.disabled/r01576.vtc @@ -0,0 +1,51 @@ +varnishtest "Test recursive regexp's fail before consuming all the stack" + +feature pcre_jit + +server s1 { + rxreq + expect req.http.found == "1" + txresp + rxreq + expect req.http.found == + txresp +} -start + +# If you want to play around, uncomment the next lines and adjust +# the length of the aaaaaaaaaaa strings below to suit your needs. +# Better yet: Rewrite your regexps to avoid this madness. + +# varnish v1 -arg "-p thread_pool_stack=48k" +# varnish v1 -arg "-p pcre_match_limit=1000" +# varnish v1 -arg "-p pcre_match_limit_recursion=89" + +# Approximate formua for FreeBSD/amd64: +# pcre_match_limit_recursion = thread_pool_stack * 2 - 9 + +varnish v1 -vcl+backend { + sub vcl_recv { + if (req.url ~ "^/a((?!/.).)*$") { + set req.http.found = "1"; + } + } +} -start + +# This should succeed with default params and JIT/no-JIT +client c1 { + txreq -url /aaaaaaaa + rxresp +} -run + +# PCRE_ERROR_RECURSIONLIMIT (-21) +# PCRE_ERROR_JIT_STACKLIMIT (-27) +logexpect l1 -v v1 { + expect * * VCL_Error "Regexp matching returned -2[71]" +} -start + +# This should fail with default params and JIT/no-JIT +client c1 { + txreq -url /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + rxresp +} -run + +logexpect l1 -wait diff --git a/bin/varnishtest/tests/r01576.vtc b/bin/varnishtest/tests/r01576.vtc deleted file mode 100644 index b0fdb9f..0000000 --- a/bin/varnishtest/tests/r01576.vtc +++ /dev/null @@ -1,51 +0,0 @@ -varnishtest "Test recursive regexp's fail before consuming all the stack" - -feature pcre_jit - -server s1 { - rxreq - expect req.http.found == "1" - txresp - rxreq - expect req.http.found == - txresp -} -start - -# If you want to play around, uncomment the next lines and adjust -# the length of the aaaaaaaaaaa strings below to suit your needs. -# Better yet: Rewrite your regexps to avoid this madness. - -# varnish v1 -arg "-p thread_pool_stack=48k" -# varnish v1 -arg "-p pcre_match_limit=1000" -# varnish v1 -arg "-p pcre_match_limit_recursion=89" - -# Approximate formua for FreeBSD/amd64: -# pcre_match_limit_recursion = thread_pool_stack * 2 - 9 - -varnish v1 -vcl+backend { - sub vcl_recv { - if (req.url ~ "^/a((?!/.).)*$") { - set req.http.found = "1"; - } - } -} -start - -# This should succeed with default params and JIT/no-JIT -client c1 { - txreq -url /aaaaaaaa - rxresp -} -run - -# PCRE_ERROR_RECURSIONLIMIT (-21) -# PCRE_ERROR_JIT_STACKLIMIT (-27) -logexpect l1 -v v1 { - expect * * VCL_Error "Regexp matching returned -2[71]" -} -start - -# This should fail with default params and JIT/no-JIT -client c1 { - txreq -url /aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - rxresp -} -run - -logexpect l1 -wait From phk at FreeBSD.org Wed Nov 11 10:55:13 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 11 Nov 2015 02:55:13 -0800 Subject: [varnishcache/varnish-cache] 8d0b30: Disable test r01576, it takes too much time and ef... Message-ID: <56431e91316a_fc23fb5c243f2bc1044e3@hookshot-fe3-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 8d0b30e77dbf5b1e87bfe147be37e0596323fe64 https://github.com/varnishcache/varnish-cache/commit/8d0b30e77dbf5b1e87bfe147be37e0596323fe64 Author: Poul-Henning Kamp Date: 2015-11-11 (Wed, 11 Nov 2015) Changed paths: A bin/varnishtest/tests.disabled/r01576.vtc R bin/varnishtest/tests/r01576.vtc Log Message: ----------- Disable test r01576, it takes too much time and effort to keep it working across platforms. From fgsch at lodoss.net Wed Nov 11 23:50:38 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Thu, 12 Nov 2015 00:50:38 +0100 Subject: [master] 3b0b877 Retire varnishreplay for good Message-ID: commit 3b0b877080b79b37834b16d48c7c7c6356b25370 Author: Federico G. Schwindt Date: Wed Nov 11 12:50:05 2015 +0000 Retire varnishreplay for good diff --git a/bin/Makefile.am b/bin/Makefile.am index 8aa2ef9..157fbc8 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -2,7 +2,6 @@ # Disabling building of the tools while api is in flux -#SUBDIRS = varnishreplay SUBDIRS = \ varnishadm \ varnishd \ diff --git a/bin/Makefile.phk b/bin/Makefile.phk index 07ed226..ce538a1 100644 --- a/bin/Makefile.phk +++ b/bin/Makefile.phk @@ -2,7 +2,6 @@ SUBDIRS += varnishadm SUBDIRS += varnishd SUBDIRS += varnishlog SUBDIRS += varnishncsa -# varnishreplay SUBDIRS += varnishtest SUBDIRS += varnishstat SUBDIRS += varnishhist diff --git a/bin/varnishreplay/Makefile.am b/bin/varnishreplay/Makefile.am deleted file mode 100644 index 38d1c30..0000000 --- a/bin/varnishreplay/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -# - -AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_builddir)/include - -bin_PROGRAMS = varnishreplay - -varnishreplay_SOURCES = \ - varnishreplay.c \ - $(top_srcdir)/lib/libvarnish/vas.c \ - $(top_srcdir)/lib/libvarnish/vtcp.c \ - $(top_srcdir)/lib/libvarnish/vss.c - -varnishreplay_LDADD = \ - $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ - $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ - ${RT_LIBS} ${PTHREAD_LIBS} ${NET_LIBS} ${LIBM} diff --git a/bin/varnishreplay/Makefile.phk b/bin/varnishreplay/Makefile.phk deleted file mode 100644 index d69f03e..0000000 --- a/bin/varnishreplay/Makefile.phk +++ /dev/null @@ -1,7 +0,0 @@ -PROG_SRC = varnishreplay.c - -LD_ADD += ${LIB_VARNISH} -LD_ADD += ${LIB_VARNISHAPI} - -TOPDIR = $(CURDIR)/../.. -include $(TOPDIR)/Makefile.inc.phk diff --git a/bin/varnishreplay/varnishreplay.c b/bin/varnishreplay/varnishreplay.c deleted file mode 100644 index 12cdc0d..0000000 --- a/bin/varnishreplay/varnishreplay.c +++ /dev/null @@ -1,757 +0,0 @@ -/*- - * Copyright (c) 2010 Varnish Software AS - * All rights reserved. - * - * Author: Cecilie Fritzvold - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "config.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "vdef.h" -#include "vapi/vsl.h" -#include "vapi/vsm.h" -#include "vas.h" -#include "vcs.h" -#include "vqueue.h" -#include "vss.h" - -#define freez(x) do { if (x) free(x); x = NULL; } while (0); - -static struct vss_addr *addr_info; -static int debug; - -static int -isprefix(const char *str, const char *prefix, const char **next) -{ - - while (*str && *prefix && - tolower((int)*str) == tolower((int)*prefix)) - ++str, ++prefix; - if (*str && *str != ' ') - return (0); - if (next) { - while (*str && *str == ' ') - ++str; - *next = str; - } - return (1); -} - -#if 0 -static int -isequal(const char *str, const char *reference, const char *end) -{ - - while (str < end && *str && *reference && - tolower((int)*str) == tolower((int)*reference)) - ++str, ++reference; - if (str != end || *reference) - return (0); - return (1); -} -#endif - -/* - * mailbox toolkit - */ - -struct message { - enum VSL_tag_e tag; - size_t len; - char *ptr; - VSTAILQ_ENTRY(message) list; -}; - -#define MAX_MAILBOX_SIZE 30 - -struct mailbox { - pthread_mutex_t lock; - pthread_cond_t has_mail; - int open; - VSTAILQ_HEAD(msgq_head, message) messages; -}; - -static void -mailbox_create(struct mailbox *mbox) -{ - - VSTAILQ_INIT(&mbox->messages); - pthread_mutex_init(&mbox->lock, NULL); - pthread_cond_init(&mbox->has_mail, NULL); - mbox->open = 1; -} - -static void -mailbox_destroy(struct mailbox *mbox) -{ - struct message *msg; - - while ((msg = VSTAILQ_FIRST(&mbox->messages))) { - VSTAILQ_REMOVE_HEAD(&mbox->messages, list); - free(msg); - } - pthread_cond_destroy(&mbox->has_mail); - pthread_mutex_destroy(&mbox->lock); -} - -static void -mailbox_put(struct mailbox *mbox, struct message *msg) -{ - - pthread_mutex_lock(&mbox->lock); - VSTAILQ_INSERT_TAIL(&mbox->messages, msg, list); - pthread_cond_signal(&mbox->has_mail); - pthread_mutex_unlock(&mbox->lock); -} - -static struct message * -mailbox_get(struct mailbox *mbox) -{ - struct message *msg; - - pthread_mutex_lock(&mbox->lock); - while ((msg = VSTAILQ_FIRST(&mbox->messages)) == NULL && mbox->open) - pthread_cond_wait(&mbox->has_mail, &mbox->lock); - if (msg != NULL) - VSTAILQ_REMOVE_HEAD(&mbox->messages, list); - pthread_mutex_unlock(&mbox->lock); - return (msg); -} - -static void -mailbox_close(struct mailbox *mbox) -{ - pthread_mutex_lock(&mbox->lock); - mbox->open = 0; - pthread_cond_signal(&mbox->has_mail); - pthread_mutex_unlock(&mbox->lock); -} - -/* - * thread toolkit - */ - -static pthread_mutex_t log_mutex = PTHREAD_MUTEX_INITIALIZER; - -static void -thread_log(int lvl, int errcode, const char *fmt, ...) - __v_printflike(3, 4); - -static void -thread_log(int lvl, int errcode, const char *fmt, ...) -{ - va_list ap; - - if (lvl > debug) - return; - pthread_mutex_lock(&log_mutex); - fprintf(stderr, "%p ", (void *)(uintptr_t)pthread_self()); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - if (errcode) - fprintf(stderr, ": %s", strerror(errcode)); - fprintf(stderr, "\n"); - pthread_mutex_unlock(&log_mutex); -} - -struct replay_thread { - pthread_t thread_id; - struct mailbox mbox; - - int sock; - - int fd; /* original fd from logs */ - - char *method; /* Request method*/ - char *proto; /* Protocol version */ - char *url; /* URL and query string */ - const char *conn; /* Connection info (keep-alive, close) */ - char *hdr[64]; /* Headers */ - int nhdr; /* Number of headers */ - int bogus; /* bogus request */ - - char arena[4096]; - int top; - char line[2048]; - char temp[2048]; -}; - -static struct replay_thread **threads; -static size_t nthreads; - -/* - * Clear thread state - */ -static void -thread_clear(struct replay_thread *thr) -{ - - thr->method = thr->proto = thr->url = NULL; - thr->conn = NULL; - memset(&thr->hdr, 0, sizeof thr->hdr); - thr->nhdr = 0; - thr->bogus = 0; - memset(&thr->arena, 0, sizeof thr->arena); - thr->top = 0; - memset(&thr->line, 0, sizeof thr->line); - memset(&thr->temp, 0, sizeof thr->temp); - if (thr->sock != -1) - close(thr->sock); - thr->sock = -1; -} - -#define THREAD_FAIL ((struct replay_thread *)-1) - -static pthread_attr_t thread_attr; - -static struct replay_thread * -thread_get(int fd, void *(*thread_main)(void *)) -{ - - AN(fd); - if (fd >= nthreads) { - struct replay_thread **newthreads = threads; - size_t newnthreads = nthreads; - - while (fd >= newnthreads) - newnthreads += newnthreads + 1; - newthreads = realloc(newthreads, - newnthreads * sizeof *newthreads); - XXXAN(newthreads != NULL); - memset(newthreads + nthreads, 0, - (newnthreads - nthreads) * sizeof *newthreads); - threads = newthreads; - nthreads = newnthreads; - } - if (threads[fd] == NULL) { - threads[fd] = malloc(sizeof *threads[fd]); - assert(threads[fd] != NULL); - threads[fd]->sock = -1; - thread_clear(threads[fd]); - mailbox_create(&threads[fd]->mbox); - if (pthread_create(&threads[fd]->thread_id, &thread_attr, - thread_main, threads[fd]) != 0) { - thread_log(0, errno, "pthread_create()"); - mailbox_destroy(&threads[fd]->mbox); - freez(threads[fd]); - threads[fd] = THREAD_FAIL; - } else { - threads[fd]->fd = fd; - thread_log(0, 0, "thread %p:%d started", - (void *)(uintptr_t)threads[fd]->thread_id, fd); - } - } - if (threads[fd] == THREAD_FAIL) - return (NULL); - return (threads[fd]); -} - -static void -thread_close(int fd) -{ - - if (fd == -1) { - for (fd = 0; fd < nthreads; ++fd) - thread_close(fd); - return; - } - - assert(fd < nthreads); - - if (threads[fd] == NULL) - return; - mailbox_close(&threads[fd]->mbox); - pthread_join(threads[fd]->thread_id, NULL); - thread_log(0, 0, "thread %p stopped", - (void *)(uintptr_t)threads[fd]->thread_id); - thread_clear(threads[fd]); - mailbox_destroy(&threads[fd]->mbox); - freez(threads[fd]); -} - -/* - * Allocate from thread arena - */ -static void * -thread_alloc(struct replay_thread *thr, size_t len) -{ - void *ptr; - - if (sizeof thr->arena - thr->top < len) - return (NULL); - ptr = thr->arena + thr->top; - thr->top += len; - return (ptr); -} - -/* - * Returns a copy of the entire string with leading and trailing spaces - * trimmed. - */ -static char * -trimline(struct replay_thread *thr, const char *str) -{ - size_t len; - char *p; - - /* skip leading space */ - while (*str && *str == ' ') - ++str; - - /* seek to end of string */ - for (len = 0; str[len]; ++len) - /* nothing */ ; - - /* trim trailing space */ - while (len && str[len - 1] == ' ') - --len; - - /* copy and return */ - if ((p = thread_alloc(thr, len + 1)) == NULL) - return (NULL); - memcpy(p, str, len); - p[len] = '\0'; - return (p); -} - -/* Read a line from the socket and return the number of bytes read. - * After returning, line will point to the read bytes in memory. - * A line is terminated by \r\n - */ -static int -read_line(struct replay_thread *thr) -{ - int i, len; - - len = 0; - while (1) { - if (len + 2 > sizeof thr->line) { - thread_log(0, 0, "overflow"); - return (-1); - } - i = read(thr->sock, thr->line + len, 1); - if (i < 0) { - thread_log(0, errno, "read(%d, %p, %d)", - thr->sock, thr->line + len, 1); - return (-1); - } - if (i == 0) - break; - len += i; - if (len >= 2 && thr->line[len - 2] == '\r' && - thr->line[len - 1] == '\n') { - len -= 2; - break; - } - } - thr->line[len] = '\0'; - return (len); -} - -/* Read a block of data from the socket, and do nothing with it. - * length says how many bytes to read, and the function returns - * the number of bytes read. - */ -static int -read_block(struct replay_thread *thr, int len) -{ - int n, r, tot; - - for (tot = 0; tot < len; tot += r) { - n = len - tot; - if (n > sizeof thr->temp) - n = sizeof thr->temp; - r = read(thr->sock, thr->temp, n); - if (r < 0) { - thread_log(0, errno, "read(%d, %p, %d)", - thr->sock, thr->temp, n); - return (-1); - } - if (r == 0) - break; - } - return (tot); -} - -/* Receive the response after sending a request. - */ -static int -receive_response(struct replay_thread *thr) -{ - const char *next; - int line_len; - long chunk_length, content_length; - int chunked, connclose, failed; - int n, status; - - content_length = 0; - chunked = connclose = failed = 0; - - /* Read header */ - for (;;) { - line_len = read_line(thr); - if (line_len < 0) - return (-1); - thread_log(2, 0, "< %.*s", line_len, thr->line); - if (line_len == 0) - break; - if (strncmp(thr->line, "HTTP", 4) == 0) { - sscanf(thr->line, "%*s %d %*s\r\n", &status); - failed = (status != 200); - } else if (isprefix(thr->line, "content-length:", &next)) { - content_length = strtol(next, NULL, 10); - } else if (isprefix(thr->line, "transfer-encoding:", &next)) { - chunked = (strcasecmp(next, "chunked") == 0); - } else if (isprefix(thr->line, "connection:", &next)) { - connclose = (strcasecmp(next, "close") == 0); - } - } - - thread_log(1, 0, "status: %d", status); - - /* Read body */ - if (chunked) { - /* Chunked encoding, read size and bytes until no more */ - thread_log(1, 0, "chunked encoding"); - for (;;) { - line_len = read_line(thr); - if (line_len < 0) - return (-1); - /* read_line() guarantees null-termination */ - chunk_length = strtol(thr->line, NULL, 16); - if (chunk_length == 0) - break; - if ((n = read_block(thr, chunk_length)) < 0) - return (-1); - if (n < chunk_length) - thread_log(0, 0, "short read: %d/%ld", - n, chunk_length); - thread_log(1, 0, "chunk length: %ld", chunk_length); - thread_log(1, 0, "bytes read: %d", n); - /* trailing CR LF */ - if ((n = read_line(thr)) < 0) - return (-1); - } - /* trailing CR LF */ - n = read_line(thr); - if (n < 0) - return (-1); - } else if (content_length > 0) { - /* Fixed body size, read content_length bytes */ - thread_log(1, 0, "fixed length"); - thread_log(1, 0, "content length: %ld", content_length); - if ((n = read_block(thr, content_length)) < 0) - return (1); - if (n < content_length) - thread_log(0, 0, "short read: %d/%ld", - n, content_length); - thread_log(1, 0, "bytes read: %d", n); - } else { - /* No body --> stop reading. */ - thread_log(1, 0, "no body"); - return (-1); - } - - return (connclose); -} - -static void * -replay_thread(void *arg) -{ - struct iovec iov[6]; - char space[1] = " ", crlf[2] = "\r\n"; - struct replay_thread *thr = arg; - struct message *msg; - enum VSL_tag_e tag; - char *ptr; - const char *next; - - int i; - - int reopen = 1; - - while ((msg = mailbox_get(&thr->mbox)) != NULL) { - tag = msg->tag; - ptr = msg->ptr; - - thread_log(2, 0, "%s(%s)", VSL_tags[tag], msg->ptr); - - switch (tag) { - case SLT_ReqMethod: - if (thr->method != NULL) - thr->bogus = 1; - else - thr->method = trimline(thr, ptr); - break; - - case SLT_ReqURL: - if (thr->url != NULL) - thr->bogus = 1; - else - thr->url = trimline(thr, ptr); - break; - - case SLT_ReqProtocol: - if (thr->proto != NULL) - thr->bogus = 1; - else - thr->proto = trimline(thr, ptr); - break; - - case SLT_ReqHeader: - if (thr->nhdr >= sizeof thr->hdr / sizeof *thr->hdr) { - thr->bogus = 1; - } else { - thr->hdr[thr->nhdr++] = trimline(thr, ptr); - if (isprefix(ptr, "connection:", &next)) - thr->conn = trimline(thr, next); - } - break; - - default: - break; - } - - freez(msg->ptr); - freez(msg); - - if (tag != SLT_ReqEnd) - continue; - - if (!thr->method || !thr->url || !thr->proto) { - thr->bogus = 1; - } else if (strcmp(thr->method, "GET") != 0 && - strcmp(thr->method, "HEAD") != 0) { - thr->bogus = 1; - } else if (strcmp(thr->proto, "HTTP/1.0") == 0) { - reopen = !(thr->conn && - strcasecmp(thr->conn, "keep-alive") == 0); - } else if (strcmp(thr->proto, "HTTP/1.1") == 0) { - reopen = (thr->conn && - strcasecmp(thr->conn, "close") == 0); - } else { - thr->bogus = 1; - } - - if (thr->bogus) { - thread_log(1, 0, "bogus"); - goto clear; - } - - if (thr->sock == -1) { - for (;;) { - thread_log(1, 0, "sleeping before connect..."); - usleep(1000 * (thr->fd % 3001)); - thr->sock = VSS_connect(addr_info, 0); - if (thr->sock >= 0) - break; - thread_log(0, errno, "connect failed"); - } - } - - thread_log(1, 0, "%s %s %s", thr->method, thr->url, thr->proto); - - iov[0].iov_base = thr->method; - iov[0].iov_len = strlen(thr->method); - iov[2].iov_base = thr->url; - iov[2].iov_len = strlen(thr->url); - iov[4].iov_base = thr->proto; - iov[4].iov_len = strlen(thr->proto); - iov[1].iov_base = iov[3].iov_base = space; - iov[1].iov_len = iov[3].iov_len = 1; - iov[5].iov_base = crlf; - iov[5].iov_len = 2; - if (writev(thr->sock, iov, 6) == -1) { - thread_log(0, errno, "writev()"); - goto close; - } - - for (i = 0; i < thr->nhdr; ++i) { - thread_log(2, 0, "%d %s", i, thr->hdr[i]); - iov[0].iov_base = thr->hdr[i]; - iov[0].iov_len = strlen(thr->hdr[i]); - iov[1].iov_base = crlf; - iov[1].iov_len = 2; - if (writev(thr->sock, iov, 2) == -1) { - thread_log(0, errno, "writev()"); - goto close; - } - } - if (write(thr->sock, crlf, 2) == -1) { - thread_log(0, errno, "writev()"); - goto close; - } - if (receive_response(thr) || reopen) { -close: - thread_log(1, 0, "close"); - assert(thr->sock != -1); - close(thr->sock); - thr->sock = -1; - } - - sleep(1); -clear: - /* clean up */ - thread_clear(thr); - } - - /* leftovers */ - thread_clear(thr); - - return (0); -} - -static int -gen_traffic(void *priv, enum VSL_tag_e tag, unsigned fd, - unsigned len, unsigned spec, const char *ptr, uint64_t bitmap) -{ - struct replay_thread *thr; - struct message *msg; - - (void)priv; - (void)bitmap; - - if (fd == 0 || !(spec & VSL_S_CLIENT)) - return (0); - - thread_log(3, 0, "%d %s", fd, VSL_tags[tag]); - thr = thread_get(fd, replay_thread); - if (thr == NULL) - return (0); - msg = malloc(sizeof (struct message)); - msg->tag = tag; - msg->len = len; - msg->ptr = malloc(len); - AN(msg->ptr); - memcpy(msg->ptr, ptr, len); - mailbox_put(&thr->mbox, msg); - - return (0); -} - -/* Initiate a connection to
by resolving the - * hostname and returning a struct with necessary - * connection info. - */ -static struct vss_addr * -init_connection(const char *address) -{ - struct vss_addr **ta; - struct vss_addr *tap; - int i, n; - - n = VSS_resolve(address, NULL, &ta); - if (n == 0) { - thread_log(0, 0, "Could not connect to server"); - exit(2); - } - for (i = 1; i < n; ++i) { - free(ta[i]); - ta[i] = NULL; - } - tap = ta[0]; - free(ta); - - return (tap); -} - -/*--------------------------------------------------------------------*/ - -static void -usage(void) -{ - - fprintf(stderr, - "usage: varnishreplay [-D] -a address:port -r logfile\n"); - exit(1); -} - -int -main(int argc, char *argv[]) -{ - int c; - struct VSM_data *vd; - const char *address = NULL; - - vd = VSM_New(); - debug = 0; - - VSL_Arg(vd, 'c', NULL); - while ((c = getopt(argc, argv, "a:Dr:n:")) != -1) { - switch (c) { - case 'a': - address = optarg; - break; - case 'D': - ++debug; - break; - default: - if (VSL_Arg(vd, c, optarg) > 0) - break; - usage(); - } - } - - if (address == NULL) { - usage(); - } - - if (VSM_Open(vd)) { - fprintf(stderr, "%s\n", VSM_Error(vd)); - exit(1); - } - - addr_info = init_connection(address); - - signal(SIGPIPE, SIG_IGN); - - pthread_attr_init(&thread_attr); - - /* - * XXX: seting the stack size manually reduces the memory usage - * XXX: (allowing more threads) and increases speed (?) - */ - pthread_attr_setstacksize(&thread_attr, 32768); - - while (VSL_Dispatch(vd, gen_traffic, NULL) == 0) - /* nothing */ ; - thread_close(-1); - exit(0); -} diff --git a/man/Makefile.am b/man/Makefile.am index d791d1f..82f5471 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -64,9 +64,6 @@ varnishlog.1: \ $(top_srcdir)/doc/sphinx/include/varnishlog_synopsis.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishlog.rst $@ -varnishreplay.1: $(top_srcdir)/doc/sphinx/reference/varnishreplay.rst - ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishreplay.rst $@ - # XXX add _options.rst and _synopsis.rst here when it's been _opt2rst'ed varnishstat.1: $(top_srcdir)/doc/sphinx/reference/varnishstat.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishstat.rst $@ From fgsch at lodoss.net Wed Nov 11 23:50:38 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Thu, 12 Nov 2015 00:50:38 +0100 Subject: [master] 383c449 Move the pcre jit check to configure Message-ID: commit 383c4497c050d496c33cc6e03754000a6cc74254 Author: Federico G. Schwindt Date: Wed Nov 11 13:33:07 2015 +0000 Move the pcre jit check to configure Output whether pcre jit is usable at configure time. diff --git a/configure.ac b/configure.ac index 5e46ce6..c8c2064 100644 --- a/configure.ac +++ b/configure.ac @@ -151,6 +151,27 @@ fi AC_SUBST(PCRE_CFLAGS) AC_SUBST(PCRE_LIBS) +# --enable-pcre-jit +AC_ARG_ENABLE(pcre-jit, + AS_HELP_STRING([--enable-pcre-jit], + [use the PCRE JIT compiler (default is YES)]), + [], + [enable_pcre_jit=yes]) +if test "$enable_pcre_jit" = yes; then + AC_MSG_CHECKING(for PCRE JIT usability) + AC_PREPROC_IFELSE( + [AC_LANG_PROGRAM([[#include "pcre.h" + #if PCRE_MAJOR != 8 || PCRE_MINOR < 32 + #error no jit + #endif]])], + [AC_MSG_RESULT(yes) + AC_DEFINE([USE_PCRE_JIT], [1], [Use the PCRE JIT compiler]) + ], + [AC_MSG_RESULT(no)] + ) +fi + + AC_CHECK_HEADERS([edit/readline/readline.h], [AC_DEFINE([HAVE_LIBEDIT], [1], [Define if we have libedit]) LIBEDIT_LIBS="-ledit"], @@ -611,17 +632,6 @@ fi AC_DEFINE_UNQUOTED([VCC_CC],"$VCC_CC",[C compiler command line for VCL code]) -# --enable-pcre-jit -AC_ARG_ENABLE(pcre-jit, - AS_HELP_STRING([--enable-pcre-jit], - [use the PCRE JIT compiler (default is YES)]), - , - [enable_pcre_jit=yes]) - -if test "$enable_pcre_jit" = yes; then - AC_DEFINE([USE_PCRE_JIT],[1],[use the PCRE JIT compiler]) -fi - # Stupid automake needs this VTC_TESTS="$(cd $srcdir/bin/varnishtest && echo tests/*.vtc)" AC_SUBST(VTC_TESTS) diff --git a/lib/libvarnish/vre.c b/lib/libvarnish/vre.c index 0bf89f9..56abccf 100644 --- a/lib/libvarnish/vre.c +++ b/lib/libvarnish/vre.c @@ -36,7 +36,7 @@ #include "vre.h" -#if defined(USE_PCRE_JIT) && PCRE_MAJOR == 8 && PCRE_MINOR >= 32 +#if defined(USE_PCRE_JIT) #define VRE_STUDY_JIT_COMPILE PCRE_STUDY_JIT_COMPILE #else #define VRE_STUDY_JIT_COMPILE 0 From fgsch at lodoss.net Wed Nov 11 23:50:38 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Thu, 12 Nov 2015 00:50:38 +0100 Subject: [master] f540a81 Typos and grammar Message-ID: commit f540a812b267fabb4a1d305db2e271fd613e4a7a Author: Federico G. Schwindt Date: Wed Nov 11 13:36:07 2015 +0000 Typos and grammar Fixes #1814 and more. diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c index 1f02da9..12650b2 100644 --- a/bin/varnishadm/varnishadm.c +++ b/bin/varnishadm/varnishadm.c @@ -382,7 +382,7 @@ usage(void) fprintf(stderr, "usage: varnishadm [-n ident] [-t timeout] [-S secretfile] " "-T [address]:port command [...]\n"); - fprintf(stderr, "\t-n is mutually exlusive with -S and -T\n"); + fprintf(stderr, "\t-n is mutually exclusive with -S and -T\n"); exit(1); } diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c index aa31aa4..76591d0 100644 --- a/bin/varnishd/cache/cache_esi_parse.c +++ b/bin/varnishd/cache/cache_esi_parse.c @@ -1087,7 +1087,7 @@ VEP_Finish(struct vep_state *vep) lcb = vep->cb(vep->vc, vep->cb_priv, 0, VGZ_ALIGN); vep_emit_common(vep, lcb - vep->o_last, vep->last_mark); } - // NB: We don't acount for PAD+SUM+LEN in gzip'ed objects + // NB: We don't account for PAD+SUM+LEN in gzip'ed objects (void)vep->cb(vep->vc, vep->cb_priv, 0, VGZ_FINISH); AZ(VSB_finish(vep->vsb)); diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c index 8e0a70b..662048d 100644 --- a/bin/varnishd/cache/cache_fetch.c +++ b/bin/varnishd/cache/cache_fetch.c @@ -578,7 +578,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo) (bo->do_gunzip && !bo->is_gzip)) bo->do_gunzip = 0; - /* We wont gzip unless it is non-empty and ungziped */ + /* We wont gzip unless it is non-empty and ungzip'ed */ if (bo->htc->body_status == BS_NONE || bo->htc->content_length == 0 || (bo->do_gzip && !bo->is_gunzip)) diff --git a/bin/varnishd/cache/cache_wrk.c b/bin/varnishd/cache/cache_wrk.c index 86e0b92..7b774b1 100644 --- a/bin/varnishd/cache/cache_wrk.c +++ b/bin/varnishd/cache/cache_wrk.c @@ -44,7 +44,7 @@ static void Pool_Work_Thread(struct pool *pp, struct worker *wrk); /*-------------------------------------------------------------------- - * Create and starte a back-ground thread which as its own worker and + * Create and start a back-ground thread which as its own worker and * session data structures; */ diff --git a/bin/varnishd/common/common.h b/bin/varnishd/common/common.h index 7b2c371..da489fc 100644 --- a/bin/varnishd/common/common.h +++ b/bin/varnishd/common/common.h @@ -127,7 +127,7 @@ void VSM_common_ageupdate(const struct vsm_sc *sc); #define RUP2(x, y) (((x)+((y)-1))&(~((uintptr_t)(y)-1UL))) /* PWR2(y) true */ /*-------------------------------------------------------------------- - * Pointer aligment magic + * Pointer alignment magic */ #if defined(__sparc__) diff --git a/bin/varnishd/mgt/mgt_jail_solaris.c b/bin/varnishd/mgt/mgt_jail_solaris.c index bb90598..2dd9322 100644 --- a/bin/varnishd/mgt/mgt_jail_solaris.c +++ b/bin/varnishd/mgt/mgt_jail_solaris.c @@ -27,8 +27,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * "Jailing" *1) child processes on Solaris and Solaris-derivates *2) - * ================================================================== + * "Jailing" *1) child processes on Solaris and Solaris-derivatives *2) + * ==================================================================== * * *1) The name is motivated by the availability of the -j command line * option. Jailing Varnish is not to be confused with BSD Jails or diff --git a/bin/varnishd/proxy/cache_proxy_proto.c b/bin/varnishd/proxy/cache_proxy_proto.c index 6f64f3a..4799e4b 100644 --- a/bin/varnishd/proxy/cache_proxy_proto.c +++ b/bin/varnishd/proxy/cache_proxy_proto.c @@ -344,7 +344,7 @@ VPX_Proto_Sess(struct worker *wrk, void *priv) CAST_OBJ_NOTNULL(req, priv, REQ_MAGIC); sp = req->sp; - /* Per specifiction */ + /* Per specification */ assert(sizeof vpx1_sig == 5); assert(sizeof vpx2_sig == 12); diff --git a/bin/varnishd/storage/storage_malloc.c b/bin/varnishd/storage/storage_malloc.c index 445afab..ce6b0c2 100644 --- a/bin/varnishd/storage/storage_malloc.c +++ b/bin/varnishd/storage/storage_malloc.c @@ -86,7 +86,7 @@ sma_alloc(const struct stevedore *st, size_t size) * Do not collaps the sma allocation with sma->s.ptr: it is not * a good idea. Not only would it make ->trim impossible, * performance-wise it would be a catastropy with chunksized - * allocations growing another full page, just to accomodate the sma. + * allocations growing another full page, just to accommodate the sma. */ p = malloc(size); diff --git a/bin/varnishtest/tests.disabled/r01576.vtc b/bin/varnishtest/tests.disabled/r01576.vtc index b0fdb9f..9ed5f7a 100644 --- a/bin/varnishtest/tests.disabled/r01576.vtc +++ b/bin/varnishtest/tests.disabled/r01576.vtc @@ -19,7 +19,7 @@ server s1 { # varnish v1 -arg "-p pcre_match_limit=1000" # varnish v1 -arg "-p pcre_match_limit_recursion=89" -# Approximate formua for FreeBSD/amd64: +# Approximate formula for FreeBSD/amd64: # pcre_match_limit_recursion = thread_pool_stack * 2 - 9 varnish v1 -vcl+backend { diff --git a/config.phk b/config.phk index 760ea22..906cbff 100644 --- a/config.phk +++ b/config.phk @@ -3,7 +3,7 @@ set -e ####################################################################### -# Adminstrative settings +# Administrative settings ADM_PROJECT=varnish ADM_VERSION=trunk diff --git a/doc/changes.rst b/doc/changes.rst index 6016ddc..04aed34 100644 --- a/doc/changes.rst +++ b/doc/changes.rst @@ -1557,7 +1557,7 @@ Changes from 2.1.1 to 2.1.2 varnishd -------- -- When adding Range support for 2.1.1, we accidentially introduced a +- When adding Range support for 2.1.1, we accidentally introduced a bug which would append garbage to objects larger than the chunk size, by default 128k. Browsers would do the right thing due to Content-Length, but some load balancers would get very confused. @@ -1964,7 +1964,7 @@ varnishd send out a zero-sized chunk which signifies end-of-transmission. We now ignore zero-sized chunks. -- We accidentially slept for far too long when we reached the maximum +- We accidentally slept for far too long when we reached the maximum number of open file descriptors. This has been corrected and accept\_fd\_holdoff now works correctly. @@ -2196,7 +2196,7 @@ varnishd - Solaris is now supported. - There is now a regsuball function, which works like regsub except it - replaces all occurences of the regex, not just the first. + replaces all occurrences of the regex, not just the first. - Backend and director declarations can have a .connect\_timeout parameter, which tells us how long to wait for a successful diff --git a/doc/sphinx/phk/autocrap.rst b/doc/sphinx/phk/autocrap.rst index 308dde3..e97ac4c 100644 --- a/doc/sphinx/phk/autocrap.rst +++ b/doc/sphinx/phk/autocrap.rst @@ -55,7 +55,7 @@ different dialects to just a handful: Linux, \*BSD, Solaris and AIX and the autocrap tools have become part of the portability problem, rather than part of the solution. -Amongst the silly activites of the autocrap generated configure script +Amongst the silly activities of the autocrap generated configure script in Varnish are: * Looks for ANSI-C header files (show me a system later diff --git a/doc/sphinx/phk/brinch-hansens-arrows.rst b/doc/sphinx/phk/brinch-hansens-arrows.rst index cba1f44..f4299b5 100644 --- a/doc/sphinx/phk/brinch-hansens-arrows.rst +++ b/doc/sphinx/phk/brinch-hansens-arrows.rst @@ -16,7 +16,7 @@ lock B trying to get lock A. Brinch-Hansen did a lot of both theoretical and practical work in the area of multiprogramming and being both good at it and one of the -pioneers, he was awardede the ACM Turing Prize for it. +pioneers, he was awarded the ACM Turing Prize for it. You can read more about him here: `Brinch-Hansen Archive `_ @@ -26,7 +26,7 @@ that a given multiprogramming system was free of deadlocks: Draw the locking order and make sure all the arrows point to the right. When we started working with multi-core systems in FreeBSD, we were -sure to have deadlocks in our future, and we adobted and expanded +sure to have deadlocks in our future, and we adopted and expanded a facility called "WITNESS" originally written for BSDI, which keeps an eye on Brinch-Hansens arrows in real time. diff --git a/doc/sphinx/phk/dough.rst b/doc/sphinx/phk/dough.rst index b629e8b..aef598b 100644 --- a/doc/sphinx/phk/dough.rst +++ b/doc/sphinx/phk/dough.rst @@ -184,7 +184,7 @@ the message to other communities, that Free and Open Source Software does not materialize out of empty space, it is written by people. People who love what we do, which is why I'm sitting here, -way past midnight on a friday evening, writing this phamplet. +way past midnight on a friday evening, writing this pamphlet. But software *is* written by people, real people with kids, cars, mortgages, leaky roofs, sick pets, infirm parents and all other diff --git a/doc/sphinx/phk/http20.rst b/doc/sphinx/phk/http20.rst index 9860cab..c2b4d17 100644 --- a/doc/sphinx/phk/http20.rst +++ b/doc/sphinx/phk/http20.rst @@ -59,7 +59,7 @@ What if they made a new protocol, and nobody used it ? We have learned, painfully, that an IPv6 which is only marginally better than IPv4 and which offers no tangible benefit for the people who have the cost/trouble of the upgrade, does not penetrate the -network on its own, and barely even on goverments mandate. +network on its own, and barely even on governments mandate. We have also learned that a protocol which delivers the goods can replace all competition in virtually no time. @@ -86,16 +86,16 @@ Most notably HTTP/1.1 lacks a working session/endpoint-identity facility, a shortcoming which people have pasted over with the ill-conceived Cookie hack. -Cookies are, as the EU commision correctly noted, fundamentally +Cookies are, as the EU commission correctly noted, fundamentally flawed, because they store potentially sensitive information on whatever computer the user happens to use, and as a result of various abuses and incompetences, EU felt compelled to legislate a "notice and announce" policy for HTTP-cookies. But it doesn't stop there: The information stored in cookies have -potentialiiy very high value for the HTTP server, and because the +potentially very high value for the HTTP server, and because the server has no control over the integrity of the storage, we are now -seing cookies being crypto-signed, to prevent forgeries. +seeing cookies being crypto-signed, to prevent forgeries. The term "bass ackwards" comes to mind. @@ -124,7 +124,7 @@ new layer of complexity without removing any of the old complexity from the protocol. My conclusion is that HTTP/2.0 is really just a grandiose name for -HTTP/1.2: An attempt to smoothe out some sharp corners, to save a +HTTP/1.2: An attempt to smooth out some sharp corners, to save a bit of bandwidth, but not get anywhere near all the architectural problems of HTTP/1.1 and to preserve faithfully its heritage of badly thought out sedimentary hacks. @@ -151,7 +151,7 @@ mobs and special event traffic spikes. In the time frame where HTTP/2.0 will become standardized, HTTP routers will routinely deal with 40Gbit/s traffic and people will -start to arcitect for 1Tbit/s traffic. +start to architect for 1Tbit/s traffic. HTTP routers are usually only interested in a small part of the HTTP request and barely in the response at all, usually only the @@ -217,7 +217,7 @@ expend resources, and foresee a lot of complexity in implementing the server side to mitigate and deflect malicious traffic. Server Push breaks the HTTP transaction model, and opens a pile of -cans of security and privacy issues, which whould not be sneaked +cans of security and privacy issues, which would not be sneaked in during the design of a transport-encoding for HTTP/1+ traffic, but rather be standardized as an independent and well analysed extension to HTTP in general. @@ -228,7 +228,7 @@ HTTP Speed+Mobility Is really just SPDY with WebSockets underneath. -I'm really not sure I see any benefit to that, execept that the +I'm really not sure I see any benefit to that, except that the encoding chosen is marginally more efficient to implement in hardware than SPDY. @@ -268,7 +268,7 @@ Overall, I don't see any of the three proposals offer anything that will make the majority of web-sites go "Ohh we've been waiting for that!" -Bigger sites will be entised by small bandwidth savings, but the +Bigger sites will be enticed by small bandwidth savings, but the majority of the HTTP users will see scant or no net positive benefit if one or more of these three proposals were to become HTTP/2.0 diff --git a/doc/sphinx/phk/ssl_again.rst b/doc/sphinx/phk/ssl_again.rst index ba4ecf1..31b6efe 100644 --- a/doc/sphinx/phk/ssl_again.rst +++ b/doc/sphinx/phk/ssl_again.rst @@ -54,7 +54,7 @@ The next morning `CloudFlare announced the very same thing`_: .. _CloudFlare announced the very same thing: https://blog.cloudflare.com/keyless-ssl-the-nitty-gritty-technical-details/ -This could conceiveably be a way to terminate TLS/SSL in the Varnish-worker +This could conceivably be a way to terminate TLS/SSL in the Varnish-worker process, while keeping the most valuable crypto-bits away from it. But it's still a bad idea @@ -117,7 +117,7 @@ I'm not too thrilled about the "SSL Everywhere" idea, for a large number of reasons. The most obvious example is that you don't want to bog down your -countrys civil defence agency with SSL/TLS protocol negotiations, +country's civil defence agency with SSL/TLS protocol negotiations, if their website is being deluged by people trying to survive a natural disaster. diff --git a/doc/sphinx/phk/thetoolsweworkwith.rst b/doc/sphinx/phk/thetoolsweworkwith.rst index 2631c73..4ee56db 100644 --- a/doc/sphinx/phk/thetoolsweworkwith.rst +++ b/doc/sphinx/phk/thetoolsweworkwith.rst @@ -153,7 +153,7 @@ duration for the call, because then it doesn't matter what time it is, only how long time has transpired. Ohh, and setting the stack-size for a new thread ? -That is appearantly "too dangerous" so there is no argument in the +That is apparently "too dangerous" so there is no argument in the C1X API for doing so, a clear step backwards from pthreads. But guess what: Thread stacks are like T-shirts: There is no "one @@ -177,7 +177,7 @@ compiler can understand and use to issue warnings. Heck, even a simple basic object facility would be good addition, now that C++ have become this huge bloated monster language. -But none of that is appearantly as important as +But none of that is apparently as important as and a new, crippled and therefore useless thread API. The neat thing about the C language, and the one feature that made diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst index cd942e6..c982cb9 100644 --- a/doc/sphinx/reference/vcl.rst +++ b/doc/sphinx/reference/vcl.rst @@ -59,9 +59,9 @@ Conditionals ------------ VCL has *if* and *else* statements. Nested logic can be implemented -with the *elseif* statement. (*elsif*/*elif*/*else if* is equivalent.) +with the *elseif* statement (*elsif*/*elif*/*else if* are equivalent). -Note that are no loops or iterators of any kind in VCL. +Note that there are no loops or iterators of any kind in VCL. Strings, booleans, time, duration and integers diff --git a/doc/sphinx/users-guide/vcl.rst b/doc/sphinx/users-guide/vcl.rst index 3528e7b..0458704 100644 --- a/doc/sphinx/users-guide/vcl.rst +++ b/doc/sphinx/users-guide/vcl.rst @@ -13,7 +13,7 @@ switches. We have instead chosen to use a domain specific language called VCL fo Every inbound request flows through Varnish and you can influence how the request is being handled by altering the VCL code. You can direct -certain requests to certains backends, you can alter the requests and +certain requests to particular backends, you can alter the requests and the responses or have Varnish take various actions depending on arbitrary properties of the request or the response. This makes Varnish an extremely powerful HTTP processor, not just for caching. diff --git a/include/tbl/http_headers.h b/include/tbl/http_headers.h index 91ea213..0d973c7 100644 --- a/include/tbl/http_headers.h +++ b/include/tbl/http_headers.h @@ -86,7 +86,7 @@ H("If-Match", H_If_Match, F ) // 2616 14.24 H("If-Modified-Since", H_If_Modified_Since, F ) // 2616 14.25 H("If-None-Match", H_If_None_Match, F ) // 2616 14.26 H("If-Range", H_If_Range, F ) // 2616 14.27 -H("If-Unmodified-Since",H_If_Unmodifed_Since, F ) // 2616 14.28 +H("If-Unmodified-Since",H_If_Unmodified_Since, F ) // 2616 14.28 H("Last-Modified", H_Last_Modified, 0 ) // 2616 14.29 H("Location", H_Location, 0 ) // 2616 14.30 H("Max-Forwards", H_Max_Forwards, 0 ) // 2616 14.31 diff --git a/include/vapi/vsl.h b/include/vapi/vsl.h index 599c654..c6afb2f 100644 --- a/include/vapi/vsl.h +++ b/include/vapi/vsl.h @@ -215,7 +215,7 @@ int VSL_List2Tags(const char *list, int l, VSL_tagfind_f *func, void *priv); * func: The function to call (can be NULL) * priv: An argument that will be passed to func. * - * Return valus: + * Return values: * >0: Number of times func was called for matching tags. * -1: No tag matches for list element * -2: Multiple tags match non-glob list element diff --git a/lib/libvarnish/vfil.c b/lib/libvarnish/vfil.c index 19928ff..4b57d01 100644 --- a/lib/libvarnish/vfil.c +++ b/lib/libvarnish/vfil.c @@ -158,7 +158,7 @@ VFIL_fsinfo(int fd, unsigned *pbs, uintmax_t *psize, uintmax_t *pspace) return (0); } -/* Make sure that the file system can accomodate the file of the given +/* Make sure that the file system can accommodate the file of the given * size. Will use fallocate if available. If fallocate is not available * and insist is true, it will write size zero bytes. * @@ -191,7 +191,7 @@ VFIL_allocate(int fd, off_t size, int insist) the already allocated blocks of the file into account. This will cause fallocate to report ENOSPC when called on an existing fully allocated file unless - the filesystem has enough free space to accomodate the + the filesystem has enough free space to accommodate the complete new file size. Because of this we enable fallocate only on filesystems that are known to work as we expect. */ diff --git a/lib/libvarnish/vsub.c b/lib/libvarnish/vsub.c index cf71c26..4e3067a 100644 --- a/lib/libvarnish/vsub.c +++ b/lib/libvarnish/vsub.c @@ -106,7 +106,7 @@ VSUB_run(struct vsb *sb, vsub_func_f *func, void *priv, const char *name, /* * func should either exec or exit, so getting here should be * treated like an assertion failure - except that we don't know - * if it's safe to trigger an acutal assertion + * if it's safe to trigger an actual assertion */ _exit(4); } diff --git a/lib/libvarnish/vtcp.c b/lib/libvarnish/vtcp.c index 3992555..cb4d3c4 100644 --- a/lib/libvarnish/vtcp.c +++ b/lib/libvarnish/vtcp.c @@ -545,7 +545,7 @@ VTCP_Check(int a) return (1); #if (defined (__SVR4) && defined (__sun)) || defined (__NetBSD__) /* - * Solaris returns EINVAL if the other end unexepectedly reset the + * Solaris returns EINVAL if the other end unexpectedly reset the * connection. * This is a bug in Solaris and documented behaviour on NetBSD. */ diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c index 4bd7821..e79597f 100644 --- a/lib/libvcc/vcc_compile.c +++ b/lib/libvcc/vcc_compile.c @@ -30,7 +30,7 @@ /* * XXX: * Better error messages, throughout. - * >It also accured to me that we could link the errors to the error + * >It also occurred to me that we could link the errors to the error * >documentation. * > * >Unreferenced function 'request_policy', first mention is From fgsch at lodoss.net Wed Nov 11 23:55:14 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Wed, 11 Nov 2015 15:55:14 -0800 Subject: [varnishcache/varnish-cache] 3b0b87: Retire varnishreplay for good Message-ID: <5643d5627d327_47353fb2056932b83518a@hookshot-fe3-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 3b0b877080b79b37834b16d48c7c7c6356b25370 https://github.com/varnishcache/varnish-cache/commit/3b0b877080b79b37834b16d48c7c7c6356b25370 Author: Federico G. Schwindt Date: 2015-11-11 (Wed, 11 Nov 2015) Changed paths: M bin/Makefile.am M bin/Makefile.phk R bin/varnishreplay/Makefile.am R bin/varnishreplay/Makefile.phk R bin/varnishreplay/varnishreplay.c M man/Makefile.am Log Message: ----------- Retire varnishreplay for good Commit: 383c4497c050d496c33cc6e03754000a6cc74254 https://github.com/varnishcache/varnish-cache/commit/383c4497c050d496c33cc6e03754000a6cc74254 Author: Federico G. Schwindt Date: 2015-11-11 (Wed, 11 Nov 2015) Changed paths: M configure.ac M lib/libvarnish/vre.c Log Message: ----------- Move the pcre jit check to configure Output whether pcre jit is usable at configure time. Commit: f540a812b267fabb4a1d305db2e271fd613e4a7a https://github.com/varnishcache/varnish-cache/commit/f540a812b267fabb4a1d305db2e271fd613e4a7a Author: Federico G. Schwindt Date: 2015-11-11 (Wed, 11 Nov 2015) Changed paths: M bin/varnishadm/varnishadm.c M bin/varnishd/cache/cache_esi_parse.c M bin/varnishd/cache/cache_fetch.c M bin/varnishd/cache/cache_wrk.c M bin/varnishd/common/common.h M bin/varnishd/mgt/mgt_jail_solaris.c M bin/varnishd/proxy/cache_proxy_proto.c M bin/varnishd/storage/storage_malloc.c M bin/varnishtest/tests.disabled/r01576.vtc M config.phk M doc/changes.rst M doc/sphinx/phk/autocrap.rst M doc/sphinx/phk/brinch-hansens-arrows.rst M doc/sphinx/phk/dough.rst M doc/sphinx/phk/http20.rst M doc/sphinx/phk/ssl_again.rst M doc/sphinx/phk/thetoolsweworkwith.rst M doc/sphinx/reference/vcl.rst M doc/sphinx/users-guide/vcl.rst M include/tbl/http_headers.h M include/vapi/vsl.h M lib/libvarnish/vfil.c M lib/libvarnish/vsub.c M lib/libvarnish/vtcp.c M lib/libvcc/vcc_compile.c Log Message: ----------- Typos and grammar Fixes #1814 and more. Compare: https://github.com/varnishcache/varnish-cache/compare/8d0b30e77dbf...f540a812b267 From fgsch at lodoss.net Thu Nov 12 01:52:43 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Thu, 12 Nov 2015 02:52:43 +0100 Subject: [master] b4902bf Use AC_COMPILE_IFELSE Message-ID: commit b4902bfdf779da2d759d9e01ff15628af3659a85 Author: Federico G. Schwindt Date: Thu Nov 12 01:22:18 2015 +0000 Use AC_COMPILE_IFELSE AC_PREPROC_IFELSE is frowned upon. Take into account installations outside the compiler's default search path. diff --git a/configure.ac b/configure.ac index c8c2064..d56169f 100644 --- a/configure.ac +++ b/configure.ac @@ -159,7 +159,9 @@ AC_ARG_ENABLE(pcre-jit, [enable_pcre_jit=yes]) if test "$enable_pcre_jit" = yes; then AC_MSG_CHECKING(for PCRE JIT usability) - AC_PREPROC_IFELSE( + save_CFLAGS="${CFLAGS}" + CFLAGS="${PCRE_CFLAGS}" + AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include "pcre.h" #if PCRE_MAJOR != 8 || PCRE_MINOR < 32 #error no jit @@ -169,6 +171,7 @@ if test "$enable_pcre_jit" = yes; then ], [AC_MSG_RESULT(no)] ) + CFLAGS="${save_CFLAGS}" fi From fgsch at lodoss.net Thu Nov 12 01:55:14 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Wed, 11 Nov 2015 17:55:14 -0800 Subject: [varnishcache/varnish-cache] b4902b: Use AC_COMPILE_IFELSE Message-ID: <5643f1829ac95_5af3fbebdcb92b8884cf@hookshot-fe5-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: b4902bfdf779da2d759d9e01ff15628af3659a85 https://github.com/varnishcache/varnish-cache/commit/b4902bfdf779da2d759d9e01ff15628af3659a85 Author: Federico G. Schwindt Date: 2015-11-12 (Thu, 12 Nov 2015) Changed paths: M configure.ac Log Message: ----------- Use AC_COMPILE_IFELSE AC_PREPROC_IFELSE is frowned upon. Take into account installations outside the compiler's default search path. From martin at varnish-software.com Mon Nov 16 12:51:09 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Mon, 16 Nov 2015 13:51:09 +0100 Subject: [master] af63830 Adding a newline to fix comment Message-ID: commit af63830c53eecae68626725627644b10d419cfe7 Author: franciscovg Date: Thu Aug 20 11:57:00 2015 +0200 Adding a newline to fix comment diff --git a/doc/sphinx/users-guide/vcl-actions.rst b/doc/sphinx/users-guide/vcl-actions.rst index d4ede58..ed2b8ba 100644 --- a/doc/sphinx/users-guide/vcl-actions.rst +++ b/doc/sphinx/users-guide/vcl-actions.rst @@ -18,6 +18,7 @@ The most common actions to return are these: should be passed. *pipe* + .. XXX:What is pipe? benc Pipe can be returned from `vcl_recv` as well. Pipe short circuits the From martin at varnish-software.com Mon Nov 16 12:51:09 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Mon, 16 Nov 2015 13:51:09 +0100 Subject: [master] 050c69f Adding detials to installation from source code Message-ID: commit 050c69f67e59ee46064a16a1239c1d62bd48b922 Author: Francisco Vel?zquez Date: Tue Aug 25 18:29:15 2015 +0200 Adding detials to installation from source code diff --git a/doc/sphinx/installation/install.rst b/doc/sphinx/installation/install.rst index 398e9af..e67757f 100644 --- a/doc/sphinx/installation/install.rst +++ b/doc/sphinx/installation/install.rst @@ -141,9 +141,13 @@ Installing And finally, the true test of a brave heart: ``sudo make install`` -Varnish will now be installed in `/usr/local`. The `varnishd` binary is in -`/usr/local/sbin/varnishd` and its default configuration will be -`/usr/local/etc/varnish/default.vcl`. +Varnish will now be installed in ``/usr/local``. The ``varnishd`` binary is in +`/usr/local/sbin/varnishd`. To make sure that the necessary links and caches +to the most recent shared libraries are found, run ``sudo ldconfig``. After successful installation you are ready to proceed to the :ref:`tutorial-index`. +This tutorial, however, is written for installations from binary packages. +In practice, it means that you cannot call ``service varnish start`` out of the box. +Instead, you start the varnish daemon manually, for example:: + varnishd -a :6081 -T localhost:6082 -b localhost:8080 -f /path/my_file.vcl From martin at varnish-software.com Mon Nov 16 12:51:09 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Mon, 16 Nov 2015 13:51:09 +0100 Subject: [master] ff94a67 Separating next steps after installation in its own section Message-ID: commit ff94a67805645820a52399d851aea26ddfc184bc Author: Francisco Vel?zquez Date: Tue Aug 25 18:47:20 2015 +0200 Separating next steps after installation in its own section diff --git a/doc/sphinx/installation/install.rst b/doc/sphinx/installation/install.rst index e67757f..8f19f91 100644 --- a/doc/sphinx/installation/install.rst +++ b/doc/sphinx/installation/install.rst @@ -143,11 +143,15 @@ And finally, the true test of a brave heart: ``sudo make install`` Varnish will now be installed in ``/usr/local``. The ``varnishd`` binary is in `/usr/local/sbin/varnishd`. To make sure that the necessary links and caches -to the most recent shared libraries are found, run ``sudo ldconfig``. +of the most recent shared libraries are found, run ``sudo ldconfig``. + +Next steps +========== After successful installation you are ready to proceed to the :ref:`tutorial-index`. -This tutorial, however, is written for installations from binary packages. -In practice, it means that you cannot call ``service varnish start`` out of the box. -Instead, you start the varnish daemon manually, for example:: + +This tutorial is written for installations from binary packages. +In practice, it means that some configurations are not in place for installations from source code. +For example, instead of calling ``service varnish start``, you start the varnish daemon manually by typing:: varnishd -a :6081 -T localhost:6082 -b localhost:8080 -f /path/my_file.vcl From martin at varnish-software.com Mon Nov 16 12:51:10 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Mon, 16 Nov 2015 13:51:10 +0100 Subject: [master] dd31fc2 varnishd cannot start with have both options -b and -f Message-ID: commit dd31fc2d35330544532f8eeca64facb64dabc7ec Author: Francisco Vel?zquez Date: Mon Sep 14 16:56:47 2015 +0200 varnishd cannot start with have both options -b and -f diff --git a/doc/sphinx/installation/install.rst b/doc/sphinx/installation/install.rst index 8f19f91..e455016 100644 --- a/doc/sphinx/installation/install.rst +++ b/doc/sphinx/installation/install.rst @@ -154,4 +154,4 @@ This tutorial is written for installations from binary packages. In practice, it means that some configurations are not in place for installations from source code. For example, instead of calling ``service varnish start``, you start the varnish daemon manually by typing:: - varnishd -a :6081 -T localhost:6082 -b localhost:8080 -f /path/my_file.vcl + varnishd -a :6081 -T localhost:6082 -b localhost:8080 From martin at varnish-software.com Mon Nov 16 12:51:10 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Mon, 16 Nov 2015 13:51:10 +0100 Subject: [master] 5d099e9 Merge branch 'franciscovg-master' Message-ID: commit 5d099e94319152e8c38d157767ae06fc60cb3548 Merge: b4902bf dd31fc2 Author: Martin Blix Grydeland Date: Mon Nov 16 13:50:41 2015 +0100 Merge branch 'franciscovg-master' From martin at varnish-software.com Mon Nov 16 12:55:13 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Mon, 16 Nov 2015 04:55:13 -0800 Subject: [varnishcache/varnish-cache] af6383: Adding a newline to fix comment Message-ID: <5649d2313aeb_1d0f3fe64a39b2bc11577d@hookshot-fe3-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: af63830c53eecae68626725627644b10d419cfe7 https://github.com/varnishcache/varnish-cache/commit/af63830c53eecae68626725627644b10d419cfe7 Author: franciscovg Date: 2015-11-16 (Mon, 16 Nov 2015) Changed paths: M doc/sphinx/users-guide/vcl-actions.rst Log Message: ----------- Adding a newline to fix comment Commit: 050c69f67e59ee46064a16a1239c1d62bd48b922 https://github.com/varnishcache/varnish-cache/commit/050c69f67e59ee46064a16a1239c1d62bd48b922 Author: Francisco Vel?zquez Date: 2015-11-16 (Mon, 16 Nov 2015) Changed paths: M doc/sphinx/installation/install.rst Log Message: ----------- Adding detials to installation from source code Commit: ff94a67805645820a52399d851aea26ddfc184bc https://github.com/varnishcache/varnish-cache/commit/ff94a67805645820a52399d851aea26ddfc184bc Author: Francisco Vel?zquez Date: 2015-11-16 (Mon, 16 Nov 2015) Changed paths: M doc/sphinx/installation/install.rst Log Message: ----------- Separating next steps after installation in its own section Commit: dd31fc2d35330544532f8eeca64facb64dabc7ec https://github.com/varnishcache/varnish-cache/commit/dd31fc2d35330544532f8eeca64facb64dabc7ec Author: Francisco Vel?zquez Date: 2015-11-16 (Mon, 16 Nov 2015) Changed paths: M doc/sphinx/installation/install.rst Log Message: ----------- varnishd cannot start with have both options -b and -f Commit: 5d099e94319152e8c38d157767ae06fc60cb3548 https://github.com/varnishcache/varnish-cache/commit/5d099e94319152e8c38d157767ae06fc60cb3548 Author: Martin Blix Grydeland Date: 2015-11-16 (Mon, 16 Nov 2015) Changed paths: M doc/sphinx/installation/install.rst M doc/sphinx/users-guide/vcl-actions.rst Log Message: ----------- Merge branch 'franciscovg-master' Compare: https://github.com/varnishcache/varnish-cache/compare/b4902bfdf779...5d099e943191 From fgsch at lodoss.net Tue Nov 17 16:45:25 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Tue, 17 Nov 2015 17:45:25 +0100 Subject: [master] 7c920de Remove dead code Message-ID: commit 7c920de31ebd83b2914ccfc634a11ab031c75f95 Author: Federico G. Schwindt Date: Wed Nov 18 00:48:30 2015 +0900 Remove dead code diff --git a/lib/libvmod_directors/hash.c b/lib/libvmod_directors/hash.c index 3029c7b..a858a09 100644 --- a/lib/libvmod_directors/hash.c +++ b/lib/libvmod_directors/hash.c @@ -35,7 +35,6 @@ #include "cache/cache_director.h" #include "vrt.h" -#include "vbm.h" #include "vend.h" #include "vsha256.h" @@ -47,7 +46,6 @@ struct vmod_directors_hash { unsigned magic; #define VMOD_DIRECTORS_HASH_MAGIC 0xc08dd611 struct vdir *vd; - struct vbitmap *vbm; }; VCL_VOID __match_proto__() @@ -61,8 +59,6 @@ vmod_hash__init(VRT_CTX, struct vmod_directors_hash **rrp, AZ(*rrp); ALLOC_OBJ(rr, VMOD_DIRECTORS_HASH_MAGIC); AN(rr); - rr->vbm = vbit_init(8); - AN(rr->vbm); *rrp = rr; vdir_new(&rr->vd, "hash", vcl_name, NULL, NULL, rr); } @@ -76,7 +72,6 @@ vmod_hash__fini(struct vmod_directors_hash **rrp) *rrp = NULL; CHECK_OBJ_NOTNULL(rr, VMOD_DIRECTORS_HASH_MAGIC); vdir_delete(&rr->vd); - vbit_destroy(rr->vbm); FREE_OBJ(rr); } From fgsch at lodoss.net Tue Nov 17 16:45:25 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Tue, 17 Nov 2015 17:45:25 +0100 Subject: [master] 8d8592e Fix test in case someone has enough time to run it Message-ID: commit 8d8592eb3a4eacb9508e16f3e9176839b351513c Author: Federico G. Schwindt Date: Wed Nov 18 01:00:40 2015 +0900 Fix test in case someone has enough time to run it P.S. It requires -t 80. diff --git a/bin/varnishtest/tests.disabled/r01252.vtc b/bin/varnishtest/tests.disabled/r01252.vtc index 174ee97..fd820e9 100644 --- a/bin/varnishtest/tests.disabled/r01252.vtc +++ b/bin/varnishtest/tests.disabled/r01252.vtc @@ -22,19 +22,19 @@ server s2 { varnish v1 -arg "-p debug=+waitinglist" -vcl+backend { sub vcl_recv { if (req.http.x-client == "2") { - set req.backend = s2; + set req.backend_hint = s2; } } } -start varnish v1 -cliok "param.show tcp_keepalive_time" -varnish v1 -cliok "param.set tcp_keepalive_time 1s" +varnish v1 -cliok "param.set tcp_keepalive_time 1" varnish v1 -cliok "param.show tcp_keepalive_probes" varnish v1 -cliok "param.set tcp_keepalive_probes 1" varnish v1 -cliok "param.show tcp_keepalive_intvl" -varnish v1 -cliok "param.set tcp_keepalive_intvl 1s" +varnish v1 -cliok "param.set tcp_keepalive_intvl 1" varnish v1 -cliok "param.show first_byte_timeout" varnish v1 -cliok "param.set first_byte_timeout 70" From fgsch at lodoss.net Tue Nov 17 16:50:14 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Tue, 17 Nov 2015 08:50:14 -0800 Subject: [varnishcache/varnish-cache] 7c920d: Remove dead code Message-ID: <564b5ac674e8b_f413f97d0ebf29c5495e@hookshot-fe1-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 7c920de31ebd83b2914ccfc634a11ab031c75f95 https://github.com/varnishcache/varnish-cache/commit/7c920de31ebd83b2914ccfc634a11ab031c75f95 Author: Federico G. Schwindt Date: 2015-11-18 (Wed, 18 Nov 2015) Changed paths: M lib/libvmod_directors/hash.c Log Message: ----------- Remove dead code Commit: 8d8592eb3a4eacb9508e16f3e9176839b351513c https://github.com/varnishcache/varnish-cache/commit/8d8592eb3a4eacb9508e16f3e9176839b351513c Author: Federico G. Schwindt Date: 2015-11-18 (Wed, 18 Nov 2015) Changed paths: M bin/varnishtest/tests.disabled/r01252.vtc Log Message: ----------- Fix test in case someone has enough time to run it P.S. It requires -t 80. Compare: https://github.com/varnishcache/varnish-cache/compare/5d099e943191...8d8592eb3a4e From phk at FreeBSD.org Thu Nov 19 08:54:39 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 19 Nov 2015 09:54:39 +0100 Subject: [master] c6b613b Remove a couple of commented out asserts which will not come back. Message-ID: commit c6b613b6dac2eb630eeccfa918a330d565e4951e Author: Poul-Henning Kamp Date: Wed Nov 18 12:11:57 2015 +0000 Remove a couple of commented out asserts which will not come back. diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c index e74b328..65236b7 100644 --- a/bin/varnishd/cache/cache_expire.c +++ b/bin/varnishd/cache/cache_expire.c @@ -435,8 +435,6 @@ exp_inbox(struct exp_priv *ep, struct objcore *oc, double now) VSLb(&ep->vsl, SLT_ExpKill, "EXP_Inbox p=%p e=%.9f f=0x%x", oc, oc->timer_when, oc->flags); - // AZ(oc->flags & OC_F_BUSY); - lru = ObjGetLRU(oc); CHECK_OBJ_NOTNULL(lru, LRU_MAGIC); @@ -519,7 +517,7 @@ exp_expire(struct exp_priv *ep, double now) lru = ObjGetLRU(oc); CHECK_OBJ_NOTNULL(lru, LRU_MAGIC); Lck_Lock(&lru->mtx); - // AZ(oc->flags & OC_F_BUSY); + oc->exp_flags |= OC_EF_DYING; if (oc->exp_flags & OC_EF_OFFLRU) oc = NULL; From phk at FreeBSD.org Thu Nov 19 08:54:39 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 19 Nov 2015 09:54:39 +0100 Subject: [master] 627ba6b Be more rigid about locking in cache_ban. Message-ID: commit 627ba6bce348f558e5c817cca36d389869a5e187 Author: Poul-Henning Kamp Date: Thu Nov 19 08:54:17 2015 +0000 Be more rigid about locking in cache_ban. diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c index 565b5d1..ed9fcc2 100644 --- a/bin/varnishd/cache/cache_ban.c +++ b/bin/varnishd/cache/cache_ban.c @@ -237,14 +237,14 @@ BAN_DestroyObj(struct objcore *oc) { CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); - if (oc->ban == NULL) - return; - CHECK_OBJ_NOTNULL(oc->ban, BAN_MAGIC); Lck_Lock(&ban_mtx); - assert(oc->ban->refcount > 0); - oc->ban->refcount--; - VTAILQ_REMOVE(&oc->ban->objcore, oc, ban_list); - oc->ban = NULL; + CHECK_OBJ_ORNULL(oc->ban, BAN_MAGIC); + if (oc->ban != NULL) { + assert(oc->ban->refcount > 0); + oc->ban->refcount--; + VTAILQ_REMOVE(&oc->ban->objcore, oc, ban_list); + oc->ban = NULL; + } Lck_Unlock(&ban_mtx); } @@ -549,22 +549,26 @@ BAN_CheckObject(struct worker *wrk, struct objcore *oc, struct req *req) oc->ban->refcount--; VTAILQ_REMOVE(&oc->ban->objcore, oc, ban_list); - if (b == oc->ban) { /* not banned */ + if (b == oc->ban) { + /* not banned */ VTAILQ_INSERT_TAIL(&b0->objcore, oc, ban_list); b0->refcount++; + oc->ban = b0; + b = NULL; + } else { + oc->ban = NULL; } - if (oc->ban->refcount == 0 && VTAILQ_NEXT(oc->ban, list) == NULL) + if (VTAILQ_LAST(&ban_head, banhead_s)->refcount == 0) ban_kick_lurker(); Lck_Unlock(&ban_mtx); - if (b == oc->ban) { /* not banned */ - oc->ban = b0; + if (b == NULL) { + /* not banned */ ObjUpdateMeta(wrk, oc); return (0); } else { - oc->ban = NULL; VSLb(vsl, SLT_ExpBan, "%u banned lookup", ObjGetXID(wrk, oc)); VSC_C_main->bans_obj_killed++; EXP_Rearm(oc, oc->exp.t_origin, 0, 0, 0); // XXX fake now From phk at FreeBSD.org Thu Nov 19 08:55:14 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 19 Nov 2015 00:55:14 -0800 Subject: [varnishcache/varnish-cache] c6b613: Remove a couple of commented out asserts which wil... Message-ID: <564d8e72cf47_73b63fb5cba032bc52750@hookshot-fe3-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: c6b613b6dac2eb630eeccfa918a330d565e4951e https://github.com/varnishcache/varnish-cache/commit/c6b613b6dac2eb630eeccfa918a330d565e4951e Author: Poul-Henning Kamp Date: 2015-11-18 (Wed, 18 Nov 2015) Changed paths: M bin/varnishd/cache/cache_expire.c Log Message: ----------- Remove a couple of commented out asserts which will not come back. Commit: 627ba6bce348f558e5c817cca36d389869a5e187 https://github.com/varnishcache/varnish-cache/commit/627ba6bce348f558e5c817cca36d389869a5e187 Author: Poul-Henning Kamp Date: 2015-11-19 (Thu, 19 Nov 2015) Changed paths: M bin/varnishd/cache/cache_ban.c Log Message: ----------- Be more rigid about locking in cache_ban. Compare: https://github.com/varnishcache/varnish-cache/compare/8d8592eb3a4e...627ba6bce348 From fgsch at lodoss.net Sun Nov 22 21:21:53 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Sun, 22 Nov 2015 22:21:53 +0100 Subject: [master] 9afde92 Fix output Message-ID: commit 9afde92dc835ac4c52ccf88bbca15d46b6e4c0c2 Author: Federico G. Schwindt Date: Sun Nov 22 10:52:09 2015 +0900 Fix output diff --git a/bin/varnishd/mgt/mgt_acceptor.c b/bin/varnishd/mgt/mgt_acceptor.c index 49cc0c8..8edfd1c 100644 --- a/bin/varnishd/mgt/mgt_acceptor.c +++ b/bin/varnishd/mgt/mgt_acceptor.c @@ -202,19 +202,19 @@ MAC_Arg(const char *arg) mh->first_step = S_STP_H1NEWSESS; mh->proto_name = "HTTP/1"; if (av[2] != NULL && av[3] != NULL) - ARGV_ERR("Too many sub-arguments to -a(HTTP/1))\n"); + ARGV_ERR("Too many sub-arguments to -a(HTTP/1)\n"); } else if (!strcmp(av[2], "PROXY")) { mh->first_step = S_STP_PROXYNEWSESS; mh->proto_name = "PROXY"; if (av[3] != NULL) - ARGV_ERR("Too many sub-arguments to -a(PROXY))\n"); + ARGV_ERR("Too many sub-arguments to -a(PROXY)\n"); } else { ARGV_ERR("Unknown protocol '%s'\n", av[2]); } error = VSS_resolver(av[1], "80", mac_callback, mh, &err); if (mh->good == 0 || error) - ARGV_ERR("socket %s didn't resolve \n", av[1]); + ARGV_ERR("socket %s didn't resolve\n", av[1]); VAV_Free(av); FREE_OBJ(mh); } From fgsch at lodoss.net Sun Nov 22 21:25:13 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Sun, 22 Nov 2015 13:25:13 -0800 Subject: [varnishcache/varnish-cache] 9afde9: Fix output Message-ID: <565232b92a624_b3a3fa07045f2b8721ed@hookshot-fe4-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 9afde92dc835ac4c52ccf88bbca15d46b6e4c0c2 https://github.com/varnishcache/varnish-cache/commit/9afde92dc835ac4c52ccf88bbca15d46b6e4c0c2 Author: Federico G. Schwindt Date: 2015-11-22 (Sun, 22 Nov 2015) Changed paths: M bin/varnishd/mgt/mgt_acceptor.c Log Message: ----------- Fix output From phk at FreeBSD.org Mon Nov 23 10:48:33 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 23 Nov 2015 11:48:33 +0100 Subject: [master] fb8d6b5 Add a defensive assert Message-ID: commit fb8d6b5ee5f0137842794f88a8082c58a87f8239 Author: Poul-Henning Kamp Date: Thu Nov 19 10:11:19 2015 +0000 Add a defensive assert diff --git a/bin/varnishd/storage/stevedore.c b/bin/varnishd/storage/stevedore.c index 0929ba8..77e54a3 100644 --- a/bin/varnishd/storage/stevedore.c +++ b/bin/varnishd/storage/stevedore.c @@ -68,6 +68,7 @@ default_oc_freeobj(struct worker *wrk, struct objcore *oc) CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); + CHECK_OBJ_NOTNULL(oc->stobj, STOREOBJ_MAGIC); ObjSlim(wrk, oc); CAST_OBJ_NOTNULL(o, oc->stobj->priv, OBJECT_MAGIC); o->magic = 0; From phk at FreeBSD.org Mon Nov 23 10:50:13 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 23 Nov 2015 02:50:13 -0800 Subject: [varnishcache/varnish-cache] fb8d6b: Add a defensive assert Message-ID: <5652ef65bc3d7_14f73fd1bf2712a087828@hookshot-fe5-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: fb8d6b5ee5f0137842794f88a8082c58a87f8239 https://github.com/varnishcache/varnish-cache/commit/fb8d6b5ee5f0137842794f88a8082c58a87f8239 Author: Poul-Henning Kamp Date: 2015-11-23 (Mon, 23 Nov 2015) Changed paths: M bin/varnishd/storage/stevedore.c Log Message: ----------- Add a defensive assert From guillaume at varnish-software.com Mon Nov 23 13:04:27 2015 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Mon, 23 Nov 2015 14:04:27 +0100 Subject: [master] 0ebe58c vslc_file can fit on 64 bytes Message-ID: commit 0ebe58c648597d6cfe8abafe573ce7d502fa0a50 Author: Guillaume Quintard Date: Mon Mar 16 11:51:49 2015 +0100 vslc_file can fit on 64 bytes diff --git a/lib/libvarnishapi/vsl_cursor.c b/lib/libvarnishapi/vsl_cursor.c index e908bd7..e9daab0 100644 --- a/lib/libvarnishapi/vsl_cursor.c +++ b/lib/libvarnishapi/vsl_cursor.c @@ -288,13 +288,14 @@ struct vslc_file { unsigned magic; #define VSLC_FILE_MAGIC 0x1D65FFEF - struct VSL_cursor cursor; - int error; int fd; int close_fd; ssize_t buflen; uint32_t *buf; + + struct VSL_cursor cursor; + }; static void From guillaume at varnish-software.com Mon Nov 23 13:04:27 2015 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Mon, 23 Nov 2015 14:04:27 +0100 Subject: [master] 88af6bc format can fit on 64 bytes Message-ID: commit 88af6bce6a2c100dd8b2809a7d2c2c16958fb20f Author: Guillaume Quintard Date: Mon Mar 16 12:01:50 2015 +0100 format can fit on 64 bytes diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c index d46bee8..95c4454 100644 --- a/bin/varnishncsa/varnishncsa.c +++ b/bin/varnishncsa/varnishncsa.c @@ -100,12 +100,12 @@ struct format { unsigned magic; #define FORMAT_MAGIC 0xC3119CDA + char time_type; VTAILQ_ENTRY(format) list; format_f *func; struct fragment *frag; char *string; const char *const *strptr; - char time_type; char *time_fmt; }; From guillaume at varnish-software.com Mon Nov 23 13:04:27 2015 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Mon, 23 Nov 2015 14:04:27 +0100 Subject: [master] b456f69 vef_priv can fit on 64 bytes Message-ID: commit b456f691acb814cd672a0ab7dfb05b4d0cc01e59 Author: Guillaume Quintard Date: Mon Mar 16 12:04:16 2015 +0100 vef_priv can fit on 64 bytes diff --git a/bin/varnishd/cache/cache_esi_fetch.c b/bin/varnishd/cache/cache_esi_fetch.c index 558ee15..0d83b9f 100644 --- a/bin/varnishd/cache/cache_esi_fetch.c +++ b/bin/varnishd/cache/cache_esi_fetch.c @@ -44,13 +44,13 @@ struct vef_priv { unsigned magic; #define VEF_MAGIC 0xf104b51f + int error; + ssize_t tot; + struct vgz *vgz; struct vep_state *vep; - ssize_t tot; - int error; - char *ibuf; char *ibuf_i; char *ibuf_o; From guillaume at varnish-software.com Mon Nov 23 13:04:27 2015 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Mon, 23 Nov 2015 14:04:27 +0100 Subject: [master] 898d9dc ban_test can fit on 32 bytes Message-ID: commit 898d9dcadd15d022ecaf16bfcbb8007ac6dc68c8 Author: Guillaume Quintard Date: Mon Mar 16 13:52:01 2015 +0100 ban_test can fit on 32 bytes diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c index ed9fcc2..2b71d94 100644 --- a/bin/varnishd/cache/cache_ban.c +++ b/bin/varnishd/cache/cache_ban.c @@ -50,9 +50,9 @@ static pthread_t ban_thread; static int ban_holds; struct ban_test { + uint8_t oper; uint8_t arg1; const char *arg1_spec; - uint8_t oper; const char *arg2; const void *arg2_spec; }; From guillaume at varnish-software.com Mon Nov 23 13:04:27 2015 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Mon, 23 Nov 2015 14:04:27 +0100 Subject: [master] 17da78c client can fit on 5 cache lines instead of 4 Message-ID: commit 17da78ca97f4d0666b9a36de0f022a587163ba00 Author: Guillaume Quintard Date: Mon Mar 16 14:14:13 2015 +0100 client can fit on 5 cache lines instead of 4 diff --git a/bin/varnishtest/vtc_client.c b/bin/varnishtest/vtc_client.c index 70e6cae..804ef6d 100644 --- a/bin/varnishtest/vtc_client.c +++ b/bin/varnishtest/vtc_client.c @@ -53,8 +53,8 @@ struct client { unsigned repeat; - pthread_t tp; unsigned running; + pthread_t tp; }; static VTAILQ_HEAD(, client) clients = From lkarsten at varnish-software.com Mon Nov 23 13:56:32 2015 From: lkarsten at varnish-software.com (Lasse Karstensen) Date: Mon, 23 Nov 2015 14:56:32 +0100 Subject: [master] d4896b9 Fix typo Message-ID: commit d4896b9dd003ba7c5f55af8c4a50aac26353ba3c Author: Andrew Martin Date: Wed Nov 18 12:33:19 2015 +0000 Fix typo `orderto` -> `order to` for docs at https://www.varnish-cache.org/docs/trunk/reference/varnishd.html diff --git a/include/tbl/params.h b/include/tbl/params.h index 1968df4..41f5b86 100644 --- a/include/tbl/params.h +++ b/include/tbl/params.h @@ -733,7 +733,7 @@ PARAM( /* units */ allocations, /* flags */ 0| EXPERIMENTAL, /* s-text */ - "Maximum number of objects we attempt to nuke in orderto make " + "Maximum number of objects we attempt to nuke in order to make " "space for a object body.\n", /* l-text */ "", /* func */ NULL From lkarsten at varnish-software.com Mon Nov 23 13:56:32 2015 From: lkarsten at varnish-software.com (Lasse Karstensen) Date: Mon, 23 Nov 2015 14:56:32 +0100 Subject: [master] c835c04 Minor test name correction Message-ID: commit c835c044c343111ef42475f30c4605db095b7397 Author: Francisco Vel?zquez Date: Thu Nov 19 16:46:55 2015 +0100 Minor test name correction diff --git a/bin/varnishtest/tests/b00020.vtc b/bin/varnishtest/tests/b00020.vtc index 1174cd5..8427742 100644 --- a/bin/varnishtest/tests/b00020.vtc +++ b/bin/varnishtest/tests/b00020.vtc @@ -1,4 +1,4 @@ -varnishtest "Check the between_bytes_timeout behaves from parameters" +varnishtest "Check that between_bytes_timeout behaves from parameters" feature SO_RCVTIMEO_WORKS From francisco at varnish-software.com Mon Nov 23 15:35:12 2015 From: francisco at varnish-software.com (Francisco =?UTF-8?B?VmVsw6F6cXVleg==?=) Date: Mon, 23 Nov 2015 07:35:12 -0800 Subject: [varnishcache/varnish-cache] 0ebe58: vslc_file can fit on 64 bytes Message-ID: <56533230efb74_75453f81ec2092b8750ee@hookshot-fe6-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 0ebe58c648597d6cfe8abafe573ce7d502fa0a50 https://github.com/varnishcache/varnish-cache/commit/0ebe58c648597d6cfe8abafe573ce7d502fa0a50 Author: Guillaume Quintard Date: 2015-11-23 (Mon, 23 Nov 2015) Changed paths: M lib/libvarnishapi/vsl_cursor.c Log Message: ----------- vslc_file can fit on 64 bytes Commit: 88af6bce6a2c100dd8b2809a7d2c2c16958fb20f https://github.com/varnishcache/varnish-cache/commit/88af6bce6a2c100dd8b2809a7d2c2c16958fb20f Author: Guillaume Quintard Date: 2015-11-23 (Mon, 23 Nov 2015) Changed paths: M bin/varnishncsa/varnishncsa.c Log Message: ----------- format can fit on 64 bytes Commit: b456f691acb814cd672a0ab7dfb05b4d0cc01e59 https://github.com/varnishcache/varnish-cache/commit/b456f691acb814cd672a0ab7dfb05b4d0cc01e59 Author: Guillaume Quintard Date: 2015-11-23 (Mon, 23 Nov 2015) Changed paths: M bin/varnishd/cache/cache_esi_fetch.c Log Message: ----------- vef_priv can fit on 64 bytes Commit: 898d9dcadd15d022ecaf16bfcbb8007ac6dc68c8 https://github.com/varnishcache/varnish-cache/commit/898d9dcadd15d022ecaf16bfcbb8007ac6dc68c8 Author: Guillaume Quintard Date: 2015-11-23 (Mon, 23 Nov 2015) Changed paths: M bin/varnishd/cache/cache_ban.c Log Message: ----------- ban_test can fit on 32 bytes Commit: 17da78ca97f4d0666b9a36de0f022a587163ba00 https://github.com/varnishcache/varnish-cache/commit/17da78ca97f4d0666b9a36de0f022a587163ba00 Author: Guillaume Quintard Date: 2015-11-23 (Mon, 23 Nov 2015) Changed paths: M bin/varnishtest/vtc_client.c Log Message: ----------- client can fit on 5 cache lines instead of 4 Commit: d4896b9dd003ba7c5f55af8c4a50aac26353ba3c https://github.com/varnishcache/varnish-cache/commit/d4896b9dd003ba7c5f55af8c4a50aac26353ba3c Author: Andrew Martin Date: 2015-11-23 (Mon, 23 Nov 2015) Changed paths: M include/tbl/params.h Log Message: ----------- Fix typo `orderto` -> `order to` for docs at https://www.varnish-cache.org/docs/trunk/reference/varnishd.html Commit: c835c044c343111ef42475f30c4605db095b7397 https://github.com/varnishcache/varnish-cache/commit/c835c044c343111ef42475f30c4605db095b7397 Author: Francisco Vel?zquez Date: 2015-11-23 (Mon, 23 Nov 2015) Changed paths: M bin/varnishtest/tests/b00020.vtc Log Message: ----------- Minor test name correction Compare: https://github.com/varnishcache/varnish-cache/compare/fb8d6b5ee5f0...c835c044c343 From phk at FreeBSD.org Mon Nov 23 22:27:48 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 23 Nov 2015 23:27:48 +0100 Subject: [master] 51e0af5 Allow grace-hits on hit-for-pass objects, and treat the first one (which gets the busyobj) as a miss. Message-ID: commit 51e0af5ad29b9f1c15958c05b67dccfcb2beb95b Author: Poul-Henning Kamp Date: Mon Nov 23 22:17:53 2015 +0000 Allow grace-hits on hit-for-pass objects, and treat the first one (which gets the busyobj) as a miss. Testcase by: daghf Fixes: 1818 diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c index 3580204..f841c53 100644 --- a/bin/varnishd/cache/cache_hash.c +++ b/bin/varnishd/cache/cache_hash.c @@ -441,8 +441,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp, *ocp = oc; return (HSH_HIT); } - if (oc->exp.t_origin > exp_t_origin && - !(oc->flags & OC_F_PASS)) { + if (oc->exp.t_origin > exp_t_origin) { /* record the newest object */ exp_oc = oc; exp_t_origin = oc->exp.t_origin; diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index da59078..f30ab59 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -403,16 +403,22 @@ cnt_lookup(struct worker *wrk, struct req *req) AZ(oc->flags & OC_F_BUSY); req->objcore = oc; - if (oc->flags & OC_F_PASS) { + if ((oc->flags & OC_F_PASS) && boc != NULL) { + /* Treat a graced Hit-For-Pass as a miss */ + req->objcore = boc; + req->stale_oc = oc; + req->req_step = R_STP_MISS; + return (REQ_FSM_MORE); + } else if (oc->flags & OC_F_PASS) { /* Found a hit-for-pass */ VSLb(req->vsl, SLT_Debug, "XXXX HIT-FOR-PASS"); VSLb(req->vsl, SLT_HitPass, "%u", ObjGetXID(wrk, req->objcore)); - AZ(boc); (void)HSH_DerefObjCore(wrk, &req->objcore); wrk->stats->cache_hitpass++; req->req_step = R_STP_PASS; return (REQ_FSM_MORE); + } else if (oc->flags & OC_F_PASS) { } VSLb(req->vsl, SLT_Hit, "%u", ObjGetXID(wrk, req->objcore)); diff --git a/bin/varnishtest/tests/r01818.vtc b/bin/varnishtest/tests/r01818.vtc new file mode 100644 index 0000000..8b38c9b --- /dev/null +++ b/bin/varnishtest/tests/r01818.vtc @@ -0,0 +1,75 @@ +varnishtest "#1818: verify that grace works for hit_for_pass objects" + +server s1 { + rxreq + expect req.http.a == "1" + txresp + + rxreq + expect req.http.b == "1" + sema r2 sync 2 + sema r1 sync 2 + txresp +} -start + +server s2 { + rxreq + expect req.http.c == "1" + sema r1 sync 2 + txresp +} -start + +varnish v1 -vcl+backend { + sub vcl_recv { + if (req.http.c) { + set req.backend_hint = s2; + } + } + + sub vcl_miss { + set req.http.miss = "1"; + } + + sub vcl_pass { + set req.http.pass = "1"; + } + + sub vcl_deliver { + if (req.http.miss) { + set resp.http.miss = req.http.miss; + } + if (req.http.pass) { + set resp.http.pass = req.http.pass; + } + } + + sub vcl_backend_response { + set beresp.ttl = 0.1s; + set beresp.grace = 1m; + set beresp.uncacheable = true; + } +} -start + +varnish v1 -cliok "param.set debug +syncvsl" +varnish v1 -cliok "param.set debug +waitinglist" +varnish v1 -cliok "param.show debug" + +client c1 { + # This is a plain miss + txreq -hdr "a: 1" + rxresp + expect resp.http.miss == "1" + delay .2 + + # This should also miss, because the HFP is expired + txreq -hdr "b: 1" + rxresp + expect resp.http.miss == "1" +} -start + +client c2 { + sema r2 sync 2 + txreq -hdr "c: 1" + rxresp + expect resp.http.pass == "1" +} -run From phk at FreeBSD.org Mon Nov 23 22:30:16 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 23 Nov 2015 14:30:16 -0800 Subject: [varnishcache/varnish-cache] 51e0af: Allow grace-hits on hit-for-pass objects, and trea... Message-ID: <565393787c9cf_2a863fa2513ad29c7140@hookshot-fe4-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 51e0af5ad29b9f1c15958c05b67dccfcb2beb95b https://github.com/varnishcache/varnish-cache/commit/51e0af5ad29b9f1c15958c05b67dccfcb2beb95b Author: Poul-Henning Kamp Date: 2015-11-23 (Mon, 23 Nov 2015) Changed paths: M bin/varnishd/cache/cache_hash.c M bin/varnishd/cache/cache_req_fsm.c A bin/varnishtest/tests/r01818.vtc Log Message: ----------- Allow grace-hits on hit-for-pass objects, and treat the first one (which gets the busyobj) as a miss. Testcase by: daghf Fixes: 1818 From phk at FreeBSD.org Tue Nov 24 10:57:24 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 24 Nov 2015 11:57:24 +0100 Subject: [master] 4502690 Emit ULL constants for unsigned long long type. Message-ID: commit 45026902977e25cb919aad168dc326bcea558f23 Author: Poul-Henning Kamp Date: Tue Nov 24 10:50:05 2015 +0000 Emit ULL constants for unsigned long long type. diff --git a/lib/libvcc/vcc_utils.c b/lib/libvcc/vcc_utils.c index 6b56959..40f0f86 100644 --- a/lib/libvcc/vcc_utils.c +++ b/lib/libvcc/vcc_utils.c @@ -118,7 +118,7 @@ vcc_suckaddr(struct vcc *tl, const char *host, const struct suckaddr *vsa, Fh(tl, 0, " suckaddr_%u[%d] = {\n", tl->unique, n); memcpy(b, vsa, vsa_suckaddr_len); for (len = 0; len < n; len++) - Fh(tl, 0, "%s 0x%0*llxLL", + Fh(tl, 0, "%s 0x%0*llxULL", len ? ",\n" : "", sz * 2, b[len]); Fh(tl, 0, "\n};\n"); From phk at FreeBSD.org Tue Nov 24 10:57:24 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 24 Nov 2015 11:57:24 +0100 Subject: [master] 841e7de White-space OCD Message-ID: commit 841e7def2b14cc7e216f216048593f60659434b0 Author: Poul-Henning Kamp Date: Tue Nov 24 10:50:42 2015 +0000 White-space OCD diff --git a/bin/varnishtest/tests/r01818.vtc b/bin/varnishtest/tests/r01818.vtc index 8b38c9b..ee887a8 100644 --- a/bin/varnishtest/tests/r01818.vtc +++ b/bin/varnishtest/tests/r01818.vtc @@ -9,7 +9,7 @@ server s1 { expect req.http.b == "1" sema r2 sync 2 sema r1 sync 2 - txresp + txresp } -start server s2 { @@ -48,7 +48,7 @@ varnish v1 -vcl+backend { set beresp.grace = 1m; set beresp.uncacheable = true; } -} -start +} -start varnish v1 -cliok "param.set debug +syncvsl" varnish v1 -cliok "param.set debug +waitinglist" From phk at FreeBSD.org Tue Nov 24 10:57:24 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 24 Nov 2015 11:57:24 +0100 Subject: [master] 211fe2c Allow inspection of remote TCP address in HTTP (both client and server) context. Message-ID: commit 211fe2ce9d16a284130b22377056ca31a1bc2868 Author: Poul-Henning Kamp Date: Tue Nov 24 10:55:44 2015 +0000 Allow inspection of remote TCP address in HTTP (both client and server) context. Cherry-picked and modified from patch (pull#71) by: lochiiconnectivity diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c index 64ecef5..0440542 100644 --- a/bin/varnishtest/vtc_http.c +++ b/bin/varnishtest/vtc_http.c @@ -61,6 +61,8 @@ struct http { int nrxbuf; char *rxbuf; + char *rem_ip; + char *rem_port; int prxbuf; char *body; unsigned bodyl; @@ -197,7 +199,10 @@ static const char * cmd_var_resolve(struct http *hp, char *spec) { char **hh, *hdr; - + if (!strcmp(spec, "remote.ip")) + return(hp->rem_ip); + if (!strcmp(spec, "remote.port")) + return(hp->rem_port); if (!strcmp(spec, "req.method")) return(hp->req[0]); if (!strcmp(spec, "req.url")) @@ -1369,20 +1374,33 @@ http_process(struct vtclog *vl, const char *spec, int sock, int *sfd) AN(hp); hp->fd = sock; hp->timeout = vtc_maxdur * 1000 / 2; + hp->nrxbuf = 2048*1024; - hp->vsb = VSB_new_auto(); hp->rxbuf = malloc(hp->nrxbuf); /* XXX */ + AN(hp->rxbuf); + + hp->vsb = VSB_new_auto(); + AN(hp->vsb); + hp->sfd = sfd; + + hp->rem_ip = malloc(VTCP_ADDRBUFSIZE); + AN(hp->rem_ip); + + hp->rem_port = malloc(VTCP_PORTBUFSIZE); + AN(hp->rem_port); + hp->vl = vl; hp->gziplevel = 0; hp->gzipresidual = -1; - AN(hp->rxbuf); - AN(hp->vsb); + VTCP_hisname(sock, hp->rem_ip, VTCP_ADDRBUFSIZE, hp->rem_port, VTCP_PORTBUFSIZE); parse_string(spec, http_cmds, hp, vl); retval = hp->fd; VSB_delete(hp->vsb); free(hp->rxbuf); + free(hp->rem_ip); + free(hp->rem_port); free(hp); return (retval); } From phk at FreeBSD.org Tue Nov 24 11:00:15 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 24 Nov 2015 03:00:15 -0800 Subject: [varnishcache/varnish-cache] 450269: Emit ULL constants for unsigned long long type. Message-ID: <5654433f9b23b_6e3f3fb9f19712c0101f0@hookshot-fe6-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 45026902977e25cb919aad168dc326bcea558f23 https://github.com/varnishcache/varnish-cache/commit/45026902977e25cb919aad168dc326bcea558f23 Author: Poul-Henning Kamp Date: 2015-11-24 (Tue, 24 Nov 2015) Changed paths: M lib/libvcc/vcc_utils.c Log Message: ----------- Emit ULL constants for unsigned long long type. Commit: 841e7def2b14cc7e216f216048593f60659434b0 https://github.com/varnishcache/varnish-cache/commit/841e7def2b14cc7e216f216048593f60659434b0 Author: Poul-Henning Kamp Date: 2015-11-24 (Tue, 24 Nov 2015) Changed paths: M bin/varnishtest/tests/r01818.vtc Log Message: ----------- White-space OCD Commit: 211fe2ce9d16a284130b22377056ca31a1bc2868 https://github.com/varnishcache/varnish-cache/commit/211fe2ce9d16a284130b22377056ca31a1bc2868 Author: Poul-Henning Kamp Date: 2015-11-24 (Tue, 24 Nov 2015) Changed paths: M bin/varnishtest/vtc_http.c Log Message: ----------- Allow inspection of remote TCP address in HTTP (both client and server) context. Cherry-picked and modified from patch (pull#71) by: lochiiconnectivity Compare: https://github.com/varnishcache/varnish-cache/compare/51e0af5ad29b...211fe2ce9d16 From phk at FreeBSD.org Tue Nov 24 14:29:24 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 24 Nov 2015 15:29:24 +0100 Subject: [master] 6bdfb43 Don't quote NL in panic messages Message-ID: commit 6bdfb4376a5fcfeef02fdc83ccc19a12c39ddb10 Author: Poul-Henning Kamp Date: Tue Nov 24 14:12:46 2015 +0000 Don't quote NL in panic messages diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c index 3784f13..8a26eb4 100644 --- a/bin/varnishd/mgt/mgt_child.c +++ b/bin/varnishd/mgt/mgt_child.c @@ -117,7 +117,8 @@ mgt_panic_record(pid_t r) VTIM_format(VTIM_real(), time_str); VSB_printf(child_panic, "Panic at: %s\n", time_str); VSB_quote(child_panic, heritage.panic_str, - strnlen(heritage.panic_str, heritage.panic_str_len), 0); + strnlen(heritage.panic_str, heritage.panic_str_len), + VSB_QUOTE_NONL); AZ(VSB_finish(child_panic)); MGT_complain(C_ERR, "Child (%jd) %s", (intmax_t)r, VSB_data(child_panic)); diff --git a/include/vsb.h b/include/vsb.h index eefaa12..61b64c0 100644 --- a/include/vsb.h +++ b/include/vsb.h @@ -75,6 +75,7 @@ int VSB_finish(struct vsb *); char *VSB_data(const struct vsb *); ssize_t VSB_len(const struct vsb *); void VSB_delete(struct vsb *); +#define VSB_QUOTE_NONL 1 void VSB_quote(struct vsb *s, const char *p, int len, int how); void VSB_indent(struct vsb *, int); #ifdef __cplusplus diff --git a/lib/libvarnish/vsb.c b/lib/libvarnish/vsb.c index 63c196d..92abdf2 100644 --- a/lib/libvarnish/vsb.c +++ b/lib/libvarnish/vsb.c @@ -519,7 +519,10 @@ VSB_quote(struct vsb *s, const char *p, int len, int how) (void)VSB_putc(s, *q); break; case '\n': - (void)VSB_cat(s, "\\n"); + if (how & VSB_QUOTE_NONL) + (void)VSB_cat(s, "\n"); + else + (void)VSB_cat(s, "\\n"); break; case '\r': (void)VSB_cat(s, "\\r"); From phk at FreeBSD.org Tue Nov 24 14:29:24 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 24 Nov 2015 15:29:24 +0100 Subject: [master] c2a3f93 Always slim private & pass objects after delivery. Message-ID: commit c2a3f93d1af81fe89966fce28a752cc8dc078704 Author: Poul-Henning Kamp Date: Tue Nov 24 14:28:59 2015 +0000 Always slim private & pass objects after delivery. Fixes: #1821 diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index f30ab59..c493e02 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -209,19 +209,20 @@ cnt_deliver(struct worker *wrk, struct req *req) cnt_vdp(req, bo); - if (bo != NULL) - VBO_DerefBusyObj(wrk, &bo); - VSLb_ts_req(req, "Resp", W_TIM_real(wrk)); if (http_HdrIs(req->resp, H_Connection, "close")) req->doclose = SC_RESP_CLOSE; - if ((req->objcore->flags & OC_F_PASS) && bo != NULL) { - VBO_waitstate(bo, BOS_FINISHED); + if (req->objcore->flags & (OC_F_PRIVATE | OC_F_PASS)) { + if (bo != NULL) + VBO_waitstate(bo, BOS_FINISHED); ObjSlim(wrk, req->objcore); } + if (bo != NULL) + VBO_DerefBusyObj(wrk, &bo); + (void)HSH_DerefObjCore(wrk, &req->objcore); http_Teardown(req->resp); return (REQ_FSM_DONE); diff --git a/bin/varnishtest/tests/r01821.vtc b/bin/varnishtest/tests/r01821.vtc new file mode 100644 index 0000000..1c8fa87 --- /dev/null +++ b/bin/varnishtest/tests/r01821.vtc @@ -0,0 +1,28 @@ +varnishtest "Slim down hit-for-pass objects" + +server s1 -repeat 2 { + rxreq + txresp -hdr "Cache-Control: max-age=5" -bodylen 65535 +} -start + +varnish v1 -vcl+backend { + sub vcl_backend_response { + set beresp.uncacheable = true; + } +} -start + +logexpect l1 -v v1 { + expect * * Storage Transient +} -start + +client c1 { + txreq -url /foo + rxresp + txreq -url /bar + rxresp +} -run + +logexpect l1 -wait + +varnish v1 -expect SMA.Transient.c_bytes != 0 +varnish v1 -expect SMA.Transient.g_bytes < 65536 From phk at FreeBSD.org Tue Nov 24 14:30:16 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 24 Nov 2015 06:30:16 -0800 Subject: [varnishcache/varnish-cache] 6bdfb4: Don't quote NL in panic messages Message-ID: <565474789f2d3_9293fc167e572bc698d2@hookshot-fe2-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 6bdfb4376a5fcfeef02fdc83ccc19a12c39ddb10 https://github.com/varnishcache/varnish-cache/commit/6bdfb4376a5fcfeef02fdc83ccc19a12c39ddb10 Author: Poul-Henning Kamp Date: 2015-11-24 (Tue, 24 Nov 2015) Changed paths: M bin/varnishd/mgt/mgt_child.c M include/vsb.h M lib/libvarnish/vsb.c Log Message: ----------- Don't quote NL in panic messages Commit: c2a3f93d1af81fe89966fce28a752cc8dc078704 https://github.com/varnishcache/varnish-cache/commit/c2a3f93d1af81fe89966fce28a752cc8dc078704 Author: Poul-Henning Kamp Date: 2015-11-24 (Tue, 24 Nov 2015) Changed paths: M bin/varnishd/cache/cache_req_fsm.c A bin/varnishtest/tests/r01821.vtc Log Message: ----------- Always slim private & pass objects after delivery. Fixes: #1821 Compare: https://github.com/varnishcache/varnish-cache/compare/211fe2ce9d16...c2a3f93d1af8 From phk at FreeBSD.org Wed Nov 25 10:59:31 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 25 Nov 2015 11:59:31 +0100 Subject: [master] ebc2350 Keep Makefile.phk working Message-ID: commit ebc2350d792befb793f7a29ba7f69337c1cc0416 Author: Poul-Henning Kamp Date: Wed Nov 25 10:59:20 2015 +0000 Keep Makefile.phk working diff --git a/bin/varnishd/Makefile.phk b/bin/varnishd/Makefile.phk index e849a28..fb9df6c 100644 --- a/bin/varnishd/Makefile.phk +++ b/bin/varnishd/Makefile.phk @@ -6,6 +6,8 @@ PROG_SRC += cache/cache_backend_cfg.c PROG_SRC += cache/cache_backend_tcp.c PROG_SRC += cache/cache_backend_probe.c PROG_SRC += cache/cache_ban.c +PROG_SRC += cache/cache_ban_build.c +PROG_SRC += cache/cache_ban_lurker.c PROG_SRC += cache/cache_busyobj.c PROG_SRC += cache/cache_cli.c PROG_SRC += cache/cache_director.c @@ -110,11 +112,21 @@ MADE_FILES += builtin_vcl.h TODO_INSTALL += install_etc +PARST=$(TOPDIR)/doc/sphinx/include/params.rst + +TODO_ALL += $(PARST) +CLEAN_FILES += $(PARST) + CFLAGS += -DVARNISHD_IS_NOT_A_VMOD TOPDIR = $(CURDIR)/../.. include $(TOPDIR)/Makefile.inc.phk +$(PARST): $(PROGNAME) + -ls -l $(PARST) $(PROGNAME) + mkdir -p $(TOPDIR)/doc/sphinx/include + ./varnishd -x dumprstparam > $(PARST) + # # Turn the builtin.vcl file into a C-string we can include in the program. # diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c index 95c4454..dfb4885 100644 --- a/bin/varnishncsa/varnishncsa.c +++ b/bin/varnishncsa/varnishncsa.c @@ -41,6 +41,8 @@ #include "config.h" +#define _WITH_GETLINE + #include #include #include diff --git a/config.phk b/config.phk index 906cbff..dea0eed 100644 --- a/config.phk +++ b/config.phk @@ -93,7 +93,6 @@ if true ; then #define VARNISH_VCL_DIR "/etc/varnish" #define VARNISH_STATE_DIR "/tmp/phk/" #define VARNISH_VMOD_DIR "/usr/lib/varnish/vmods" - #define VCS_Branch "master" ' >> ${CONFIG_H}_ if [ ! -f ${CONFIG_H} ] ; then mv ${CONFIG_H}_ ${CONFIG_H} From phk at FreeBSD.org Wed Nov 25 11:00:16 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 25 Nov 2015 03:00:16 -0800 Subject: [varnishcache/varnish-cache] ebc235: Keep Makefile.phk working Message-ID: <565594c0ccfcc_11d73fd0fa6fb2a01116e1@hookshot-fe6-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: ebc2350d792befb793f7a29ba7f69337c1cc0416 https://github.com/varnishcache/varnish-cache/commit/ebc2350d792befb793f7a29ba7f69337c1cc0416 Author: Poul-Henning Kamp Date: 2015-11-25 (Wed, 25 Nov 2015) Changed paths: M bin/varnishd/Makefile.phk M bin/varnishncsa/varnishncsa.c M config.phk Log Message: ----------- Keep Makefile.phk working From phk at FreeBSD.org Wed Nov 25 23:58:04 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 26 Nov 2015 00:58:04 +0100 Subject: [master] 9d7bb01 Use private objcore's for req.body to reduce number of special cases. Message-ID: commit 9d7bb01f817f77eb69498f70dd2e24f0e2741dbb Author: Poul-Henning Kamp Date: Wed Nov 25 23:57:36 2015 +0000 Use private objcore's for req.body to reduce number of special cases. diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c index 662048d..b084680 100644 --- a/bin/varnishd/cache/cache_fetch.c +++ b/bin/varnishd/cache/cache_fetch.c @@ -964,6 +964,7 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc, CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); + AN(oc->flags & OC_F_BUSY); CHECK_OBJ_ORNULL(oldoc, OBJCORE_MAGIC); diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c index f841c53..d93320d 100644 --- a/bin/varnishd/cache/cache_hash.c +++ b/bin/varnishd/cache/cache_hash.c @@ -67,8 +67,8 @@ static struct objhead *private_oh; /*---------------------------------------------------------------------*/ -struct objcore * -HSH_NewObjCore(struct worker *wrk) +static struct objcore * +hsh_NewObjCore(struct worker *wrk) { struct objcore *oc; @@ -104,7 +104,7 @@ hsh_prealloc(struct worker *wrk) CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); if (wrk->nobjcore == NULL) - wrk->nobjcore = HSH_NewObjCore(wrk); + wrk->nobjcore = hsh_NewObjCore(wrk); CHECK_OBJ_NOTNULL(wrk->nobjcore, OBJCORE_MAGIC); if (wrk->nobjhead == NULL) { @@ -135,11 +135,11 @@ HSH_Private(struct worker *wrk) CHECK_OBJ_NOTNULL(private_oh, OBJHEAD_MAGIC); - oc = HSH_NewObjCore(wrk); + oc = hsh_NewObjCore(wrk); AN(oc); oc->refcnt = 1; oc->objhead = private_oh; - oc->flags |= OC_F_PRIVATE; + oc->flags |= OC_F_PRIVATE | OC_F_BUSY; Lck_Lock(&private_oh->mtx); VTAILQ_INSERT_TAIL(&private_oh->objcs, oc, list); private_oh->refcnt++; diff --git a/bin/varnishd/cache/cache_obj.c b/bin/varnishd/cache/cache_obj.c index 7413329..06785d3 100644 --- a/bin/varnishd/cache/cache_obj.c +++ b/bin/varnishd/cache/cache_obj.c @@ -288,6 +288,7 @@ ObjGetSpace(struct worker *wrk, struct objcore *oc, ssize_t *sz, uint8_t **ptr) VTAILQ_INSERT_TAIL(&o->list, st, list); Lck_Unlock(&oc->busyobj->mtx); } else { + AN(oc->flags & (OC_F_PRIVATE)); VTAILQ_INSERT_TAIL(&o->list, st, list); } *sz = st->space - st->len; diff --git a/bin/varnishd/cache/cache_req_body.c b/bin/varnishd/cache/cache_req_body.c index 585a63e..ccd7a6a 100644 --- a/bin/varnishd/cache/cache_req_body.c +++ b/bin/varnishd/cache/cache_req_body.c @@ -178,11 +178,8 @@ VRB_Free(struct req *req) CHECK_OBJ_NOTNULL(req, REQ_MAGIC); - if (req->body_oc != NULL) { - ObjFreeObj(req->wrk, req->body_oc); - FREE_OBJ(req->body_oc); - req->body_oc = NULL; - } + if (req->body_oc != NULL) + AZ(HSH_DerefObjCore(req->wrk, &req->body_oc)); } /*---------------------------------------------------------------------- @@ -228,7 +225,7 @@ VRB_Cache(struct req *req, ssize_t maxsize) return (-1); } - req->body_oc = HSH_NewObjCore(req->wrk); + req->body_oc = HSH_Private(req->wrk); AN(req->body_oc); XXXAN(STV_NewObject(req->body_oc, req->wrk, TRANSIENT_STORAGE, 8)); diff --git a/bin/varnishd/hash/hash_slinger.h b/bin/varnishd/hash/hash_slinger.h index f8d7a08..736f1b5 100644 --- a/bin/varnishd/hash/hash_slinger.h +++ b/bin/varnishd/hash/hash_slinger.h @@ -74,7 +74,6 @@ void HSH_Purge(struct worker *, struct objhead *, double ttl, double grace, void HSH_config(const char *h_arg); struct busyobj *HSH_RefBusy(const struct objcore *oc); struct objcore *HSH_Private(struct worker *wrk); -struct objcore *HSH_NewObjCore(struct worker *wrk); #ifdef VARNISH_CACHE_CHILD From phk at FreeBSD.org Thu Nov 26 00:00:16 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 25 Nov 2015 16:00:16 -0800 Subject: [varnishcache/varnish-cache] 9d7bb0: Use private objcore's for req.body to reduce numbe... Message-ID: <56564b9096b11_14d53fe33c22d29c998f9@hookshot-fe5-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 9d7bb01f817f77eb69498f70dd2e24f0e2741dbb https://github.com/varnishcache/varnish-cache/commit/9d7bb01f817f77eb69498f70dd2e24f0e2741dbb Author: Poul-Henning Kamp Date: 2015-11-25 (Wed, 25 Nov 2015) Changed paths: M bin/varnishd/cache/cache_fetch.c M bin/varnishd/cache/cache_hash.c M bin/varnishd/cache/cache_obj.c M bin/varnishd/cache/cache_req_body.c M bin/varnishd/hash/hash_slinger.h Log Message: ----------- Use private objcore's for req.body to reduce number of special cases. From phk at FreeBSD.org Thu Nov 26 00:27:16 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 26 Nov 2015 01:27:16 +0100 Subject: [master] 0a18407 Try to be a bit systematic about the asserts Message-ID: commit 0a18407e851cdfb72133d895abc81de05d3232be Author: Poul-Henning Kamp Date: Thu Nov 26 00:27:03 2015 +0000 Try to be a bit systematic about the asserts diff --git a/bin/varnishd/cache/cache_obj.c b/bin/varnishd/cache/cache_obj.c index 06785d3..02d5fdc 100644 --- a/bin/varnishd/cache/cache_obj.c +++ b/bin/varnishd/cache/cache_obj.c @@ -102,6 +102,8 @@ ObjIterBegin(struct worker *wrk, struct objcore *oc) struct object *obj; const struct storeobj_methods *om = obj_getmethods(oc); + CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); + if (om->objiterbegin != NULL) return (om->objiterbegin(wrk, oc)); @@ -127,13 +129,15 @@ ObjIter(struct objcore *oc, void *oix, void **p, ssize_t *l) ssize_t nl; const struct storeobj_methods *om = obj_getmethods(oc); + AN(oix); + AN(p); + AN(l); + if (om->objiter != NULL) return (om->objiter(oc, oix, p, l)); CAST_OBJ_NOTNULL(oi, oix, OBJITER_MAGIC); CHECK_OBJ_NOTNULL(oi->obj, OBJECT_MAGIC); - AN(p); - AN(l); *p = NULL; *l = 0; @@ -193,13 +197,13 @@ ObjIterEnd(struct objcore *oc, void **oix) struct objiter *oi; const struct storeobj_methods *om = obj_getmethods(oc); + AN(oix); + if (om->objiterend != NULL) { om->objiterend(oc, oix); return; } - AN(oc); - AN(oix); CAST_OBJ_NOTNULL(oi, (*oix), OBJITER_MAGIC); *oix = NULL; CHECK_OBJ_NOTNULL(oi->obj, OBJECT_MAGIC); @@ -215,11 +219,12 @@ ObjIterEnd(struct objcore *oc, void **oix) */ static struct storage * -objallocwithnuke(const struct stevedore *stv, struct worker *wrk, size_t size) +objallocwithnuke(struct worker *wrk, const struct stevedore *stv, size_t size) { struct storage *st = NULL; unsigned fail; + CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(stv, STEVEDORE_MAGIC); if (size > cache_param->fetch_maxchunksize) @@ -259,14 +264,14 @@ ObjGetSpace(struct worker *wrk, struct objcore *oc, ssize_t *sz, uint8_t **ptr) struct storage *st; const struct storeobj_methods *om = obj_getmethods(oc); - if (om->objgetspace != NULL) - return (om->objgetspace(wrk, oc, sz, ptr)); - - CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); AN(sz); AN(ptr); assert(*sz > 0); + + if (om->objgetspace != NULL) + return (om->objgetspace(wrk, oc, sz, ptr)); + o = obj_getobj(wrk, oc); CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); @@ -278,7 +283,7 @@ ObjGetSpace(struct worker *wrk, struct objcore *oc, ssize_t *sz, uint8_t **ptr) return (1); } - st = objallocwithnuke(oc->stobj->stevedore, wrk, *sz); + st = objallocwithnuke(wrk, oc->stobj->stevedore, *sz); if (st == NULL) return (0); @@ -311,13 +316,14 @@ ObjExtend(struct worker *wrk, struct objcore *oc, ssize_t l) struct storage *st; const struct storeobj_methods *om = obj_getmethods(oc); + CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); + assert(l > 0); + if (om->objextend != NULL) { om->objextend(wrk, oc, l); return; } - CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); - CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); o = obj_getobj(wrk, oc); CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); st = VTAILQ_LAST(&o->list, storagehead); @@ -339,6 +345,8 @@ ObjGetLen(struct worker *wrk, struct objcore *oc) struct object *o; const struct storeobj_methods *om = obj_getmethods(oc); + CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); + if (om->objgetlen != NULL) return (om->objgetlen(wrk, oc)); @@ -363,13 +371,13 @@ ObjTrimStore(struct worker *wrk, struct objcore *oc) struct object *o; const struct storeobj_methods *om = obj_getmethods(oc); + CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); + if (om->objtrimstore != NULL) { om->objtrimstore(wrk, oc); return; } - CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); - CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); stv = oc->stobj->stevedore; CHECK_OBJ_NOTNULL(stv, STEVEDORE_MAGIC); o = obj_getobj(wrk, oc); @@ -400,13 +408,13 @@ ObjSlim(struct worker *wrk, struct objcore *oc) struct storage *st, *stn; const struct storeobj_methods *om = obj_getmethods(oc); + CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); + if (om->objslim != NULL) { om->objslim(wrk, oc); return; } - CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); - CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); stv = oc->stobj->stevedore; CHECK_OBJ_NOTNULL(stv, STEVEDORE_MAGIC); o = obj_getobj(wrk, oc); @@ -430,6 +438,8 @@ ObjUpdateMeta(struct worker *wrk, struct objcore *oc) { const struct storeobj_methods *m = obj_getmethods(oc); + CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); + if (m->updatemeta != NULL) m->updatemeta(wrk, oc); } @@ -442,7 +452,7 @@ ObjFreeObj(struct worker *wrk, struct objcore *oc) const struct storeobj_methods *m = obj_getmethods(oc); CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); - CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); + AN(m->freeobj); m->freeobj(wrk, oc); AZ(oc->stobj->stevedore); @@ -455,7 +465,6 @@ ObjGetLRU(const struct objcore *oc) { const struct storeobj_methods *m = obj_getmethods(oc); - CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); AN(m->getlru); return (m->getlru(oc)); } @@ -474,11 +483,11 @@ ObjGetattr(struct worker *wrk, struct objcore *oc, enum obj_attr attr, ssize_t dummy; const struct storeobj_methods *om = obj_getmethods(oc); + CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); + if (om->objgetattr != NULL) return (om->objgetattr(wrk, oc, attr, len)); - CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); - CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); if (len == NULL) len = &dummy; o = obj_getobj(wrk, oc); @@ -529,17 +538,17 @@ ObjSetattr(struct worker *wrk, struct objcore *oc, enum obj_attr attr, struct storage *st; const struct storeobj_methods *om = obj_getmethods(oc); + CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); + if (om->objsetattr != NULL) return (om->objsetattr(wrk, oc, attr, len, ptr)); - CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); - CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); o = obj_getobj(wrk, oc); CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); st = o->objstore; switch (attr) { case OA_ESIDATA: - o->esidata = objallocwithnuke(oc->stobj->stevedore, wrk, len); + o->esidata = objallocwithnuke(wrk, oc->stobj->stevedore, len); if (o->esidata == NULL) return (NULL); o->esidata->len = len; @@ -597,6 +606,7 @@ ObjCopyAttr(struct worker *wrk, struct objcore *oc, struct objcore *ocs, CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); + CHECK_OBJ_NOTNULL(ocs, OBJCORE_MAGIC); vps = ObjGetattr(wrk, ocs, attr, &l); // XXX: later we want to have zero-length OA's too From phk at FreeBSD.org Thu Nov 26 00:30:15 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Wed, 25 Nov 2015 16:30:15 -0800 Subject: [varnishcache/varnish-cache] 0a1840: Try to be a bit systematic about the asserts Message-ID: <565652979a81c_73ef3ffcad9852bc1869b@hookshot-fe4-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 0a18407e851cdfb72133d895abc81de05d3232be https://github.com/varnishcache/varnish-cache/commit/0a18407e851cdfb72133d895abc81de05d3232be Author: Poul-Henning Kamp Date: 2015-11-26 (Thu, 26 Nov 2015) Changed paths: M bin/varnishd/cache/cache_obj.c Log Message: ----------- Try to be a bit systematic about the asserts From phk at FreeBSD.org Thu Nov 26 08:40:52 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 26 Nov 2015 09:40:52 +0100 Subject: [master] 1f1448d Various nitpicking Message-ID: commit 1f1448dab047d6738af9528ccb2ca8365606527f Author: Poul-Henning Kamp Date: Thu Nov 26 08:13:41 2015 +0000 Various nitpicking diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c index b084680..5d1d1ab 100644 --- a/bin/varnishd/cache/cache_fetch.c +++ b/bin/varnishd/cache/cache_fetch.c @@ -997,6 +997,7 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc, if (mode != VBF_BACKGROUND) HSH_Ref(oc); + AZ(bo->fetch_objcore); bo->fetch_objcore = oc; AZ(bo->stale_oc); diff --git a/bin/varnishd/cache/cache_obj.c b/bin/varnishd/cache/cache_obj.c index 02d5fdc..54dd26f 100644 --- a/bin/varnishd/cache/cache_obj.c +++ b/bin/varnishd/cache/cache_obj.c @@ -116,8 +116,7 @@ ObjIterBegin(struct worker *wrk, struct objcore *oc) oi->oc = oc; oi->obj = obj; oi->wrk = wrk; - if (oc->objhead != NULL) - oi->bo = HSH_RefBusy(oc); + oi->bo = HSH_RefBusy(oc); return (oi); } diff --git a/bin/varnishd/cache/cache_req_body.c b/bin/varnishd/cache/cache_req_body.c index ccd7a6a..f50621e 100644 --- a/bin/varnishd/cache/cache_req_body.c +++ b/bin/varnishd/cache/cache_req_body.c @@ -268,6 +268,12 @@ VRB_Cache(struct req *req, ssize_t maxsize) } while (vfps == VFP_OK); VFP_Close(vfc); + ObjTrimStore(req->wrk, req->body_oc); + + /* XXX: check missing: + if (req->htc->content_length >= 0) + MUSTBE (req->req_bodybytes == req->htc->content_length); + */ if (vfps == VFP_END) { assert(req->req_bodybytes >= 0); diff --git a/bin/varnishd/mgt/mgt_acceptor.c b/bin/varnishd/mgt/mgt_acceptor.c index 8edfd1c..3cf1bbc 100644 --- a/bin/varnishd/mgt/mgt_acceptor.c +++ b/bin/varnishd/mgt/mgt_acceptor.c @@ -129,11 +129,9 @@ mac_callback(void *priv, const struct suckaddr *sa) CAST_OBJ_NOTNULL(mh, priv, MAC_HELP_MAGIC); VTAILQ_FOREACH(ls, &heritage.socks, list) { - if (!VSA_Compare(sa, ls->addr)) { + if (!VSA_Compare(sa, ls->addr)) ARGV_ERR("-a arguments %s and %s have same address\n", ls->name, mh->name); - return (-1); - } } ALLOC_OBJ(ls, LISTEN_SOCK_MAGIC); AN(ls); From phk at FreeBSD.org Thu Nov 26 08:40:52 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 26 Nov 2015 09:40:52 +0100 Subject: [master] 77fec1b Cache a checkpoint when we iterate over busy objects, so we don't have to walk the full list all the time. Message-ID: commit 77fec1b05b3517b0cd211c3771558a9003158754 Author: Poul-Henning Kamp Date: Thu Nov 26 08:39:30 2015 +0000 Cache a checkpoint when we iterate over busy objects, so we don't have to walk the full list all the time. This is a minimal fix for backporting to 4.1.x Fixes: #1798 Fixes: #1788 diff --git a/bin/varnishd/cache/cache_obj.c b/bin/varnishd/cache/cache_obj.c index 54dd26f..53fe080 100644 --- a/bin/varnishd/cache/cache_obj.c +++ b/bin/varnishd/cache/cache_obj.c @@ -93,6 +93,8 @@ struct objiter { struct storage *st; struct worker *wrk; ssize_t len; + struct storage *checkpoint; + ssize_t checkpoint_len; }; void * @@ -126,6 +128,7 @@ ObjIter(struct objcore *oc, void *oix, void **p, ssize_t *l) struct objiter *oi; ssize_t ol; ssize_t nl; + ssize_t sl; const struct storeobj_methods *om = obj_getmethods(oc); AN(oix); @@ -167,7 +170,15 @@ ObjIter(struct objcore *oc, void *oix, void **p, ssize_t *l) } Lck_Lock(&oi->bo->mtx); AZ(VTAILQ_EMPTY(&oi->obj->list)); - VTAILQ_FOREACH(oi->st, &oi->obj->list, list) { + if (oi->checkpoint == NULL) { + oi->st = VTAILQ_FIRST(&oi->obj->list); + sl = 0; + } else { + oi->st = oi->checkpoint; + sl = oi->checkpoint_len; + ol -= oi->checkpoint_len; + } + while (oi->st != NULL) { if (oi->st->len > ol) { *p = oi->st->ptr + ol; *l = oi->st->len - ol; @@ -178,6 +189,12 @@ ObjIter(struct objcore *oc, void *oix, void **p, ssize_t *l) assert(ol >= 0); nl -= oi->st->len; assert(nl > 0); + sl += oi->st->len; + oi->st = VTAILQ_NEXT(oi->st, list); + if (VTAILQ_NEXT(oi->st, list) != NULL) { + oi->checkpoint = oi->st; + oi->checkpoint_len = sl; + } } CHECK_OBJ_NOTNULL(oi->obj, OBJECT_MAGIC); CHECK_OBJ_NOTNULL(oi->st, STORAGE_MAGIC); From phk at FreeBSD.org Thu Nov 26 08:45:14 2015 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Thu, 26 Nov 2015 00:45:14 -0800 Subject: [varnishcache/varnish-cache] 1f1448: Various nitpicking Message-ID: <5656c69a74c6a_55e3fa3786272c01410fc@hookshot-fe6-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 1f1448dab047d6738af9528ccb2ca8365606527f https://github.com/varnishcache/varnish-cache/commit/1f1448dab047d6738af9528ccb2ca8365606527f Author: Poul-Henning Kamp Date: 2015-11-26 (Thu, 26 Nov 2015) Changed paths: M bin/varnishd/cache/cache_fetch.c M bin/varnishd/cache/cache_obj.c M bin/varnishd/cache/cache_req_body.c M bin/varnishd/mgt/mgt_acceptor.c Log Message: ----------- Various nitpicking Commit: 77fec1b05b3517b0cd211c3771558a9003158754 https://github.com/varnishcache/varnish-cache/commit/77fec1b05b3517b0cd211c3771558a9003158754 Author: Poul-Henning Kamp Date: 2015-11-26 (Thu, 26 Nov 2015) Changed paths: M bin/varnishd/cache/cache_obj.c Log Message: ----------- Cache a checkpoint when we iterate over busy objects, so we don't have to walk the full list all the time. This is a minimal fix for backporting to 4.1.x Fixes: #1798 Fixes: #1788 Compare: https://github.com/varnishcache/varnish-cache/compare/0a18407e851c...77fec1b05b35 From lkarsten at varnish-software.com Thu Nov 26 14:10:03 2015 From: lkarsten at varnish-software.com (Lasse Karstensen) Date: Thu, 26 Nov 2015 15:10:03 +0100 Subject: [master] 83aa540 Use correct function for setting thread name. Message-ID: commit 83aa5402eedbd27f46b382a2742efc404629e8f0 Author: Lasse Karstensen Date: Thu Nov 26 15:05:56 2015 +0100 Use correct function for setting thread name. Correct typo that checked for pthread_set_name_np() instead of pthread_setname_np(). Thread names should now be visible in /proc/CHILDPID/tasks/*/comm on Linux systems. diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c index 83de0cd..bc15b7c 100644 --- a/bin/varnishd/cache/cache_main.c +++ b/bin/varnishd/cache/cache_main.c @@ -92,8 +92,8 @@ THR_SetName(const char *name) { AZ(pthread_setspecific(name_key, name)); -#ifdef HAVE_PTHREAD_SET_NAME_NP - pthread_set_name_np(pthread_self(), name); +#ifdef HAVE_PTHREAD_SETNAME_NP + pthread_setname_np(pthread_self(), name); #endif } diff --git a/config.phk b/config.phk index dea0eed..74e3391 100644 --- a/config.phk +++ b/config.phk @@ -287,7 +287,7 @@ exit 0 # HAVE_DLADDR + # HAVE_KQUEUE + # HAVE_NANOSLEEP + -# HAVE_PTHREAD_SET_NAME_NP + +# HAVE_PTHREAD_SETNAME_NP + # HAVE_SETPROCTITLE + # HAVE_SRANDOMDEV + # HAVE_TCP_KEEP + diff --git a/configure.ac b/configure.ac index d56169f..d7c2d94 100644 --- a/configure.ac +++ b/configure.ac @@ -248,7 +248,7 @@ AC_CHECK_FUNCS([fallocate]) save_LIBS="${LIBS}" LIBS="${PTHREAD_LIBS}" -AC_CHECK_FUNCS([pthread_set_name_np]) +AC_CHECK_FUNCS([pthread_setname_np]) AC_CHECK_FUNCS([pthread_mutex_isowned_np]) AC_CHECK_FUNCS([pthread_timedjoin_np]) LIBS="${save_LIBS}" From lkarsten at varnish-software.com Thu Nov 26 14:15:14 2015 From: lkarsten at varnish-software.com (Lasse Karstensen) Date: Thu, 26 Nov 2015 06:15:14 -0800 Subject: [varnishcache/varnish-cache] 83aa54: Use correct function for setting thread name. Message-ID: <565713f23dc8c_51d93f83cbac12bc668fa@hookshot-fe5-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 83aa5402eedbd27f46b382a2742efc404629e8f0 https://github.com/varnishcache/varnish-cache/commit/83aa5402eedbd27f46b382a2742efc404629e8f0 Author: Lasse Karstensen Date: 2015-11-26 (Thu, 26 Nov 2015) Changed paths: M bin/varnishd/cache/cache_main.c M config.phk M configure.ac Log Message: ----------- Use correct function for setting thread name. Correct typo that checked for pthread_set_name_np() instead of pthread_setname_np(). Thread names should now be visible in /proc/CHILDPID/tasks/*/comm on Linux systems. From fgsch at lodoss.net Thu Nov 26 16:08:23 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Thu, 26 Nov 2015 17:08:23 +0100 Subject: [master] f063578 Simplify Message-ID: commit f0635786a2219a88e72d41e910cb0a220c0fba87 Author: Federico G. Schwindt Date: Tue Nov 24 14:56:45 2015 +0000 Simplify diff --git a/bin/varnishtest/tests/r01821.vtc b/bin/varnishtest/tests/r01821.vtc index 1c8fa87..aac4020 100644 --- a/bin/varnishtest/tests/r01821.vtc +++ b/bin/varnishtest/tests/r01821.vtc @@ -1,8 +1,8 @@ -varnishtest "Slim down hit-for-pass objects" +varnishtest "Slim down hit-for-pass objects" server s1 -repeat 2 { rxreq - txresp -hdr "Cache-Control: max-age=5" -bodylen 65535 + txresp -bodylen 65535 } -start varnish v1 -vcl+backend { @@ -12,13 +12,11 @@ varnish v1 -vcl+backend { } -start logexpect l1 -v v1 { - expect * * Storage Transient + expect * * Storage "Transient" } -start client c1 { - txreq -url /foo - rxresp - txreq -url /bar + txreq rxresp } -run From fgsch at lodoss.net Thu Nov 26 16:08:23 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Thu, 26 Nov 2015 17:08:23 +0100 Subject: [master] 982e796 Let other OS set the thread name as well Message-ID: commit 982e79671d09d3a0661b8ba7e17c1108ca2eb42f Author: Federico G. Schwindt Date: Thu Nov 26 16:06:04 2015 +0000 Let other OS set the thread name as well Amends 83aa5402 to handle FreeBSD and OpenBSD (at least). diff --git a/bin/varnishd/cache/cache_main.c b/bin/varnishd/cache/cache_main.c index bc15b7c..bfb428e 100644 --- a/bin/varnishd/cache/cache_main.c +++ b/bin/varnishd/cache/cache_main.c @@ -92,7 +92,9 @@ THR_SetName(const char *name) { AZ(pthread_setspecific(name_key, name)); -#ifdef HAVE_PTHREAD_SETNAME_NP +#if defined(HAVE_PTHREAD_SET_NAME_NP) + pthread_set_name_np(pthread_self(), name); +#elif defined(HAVE_PTHREAD_SETNAME_NP) pthread_setname_np(pthread_self(), name); #endif } diff --git a/config.phk b/config.phk index 74e3391..430a887 100644 --- a/config.phk +++ b/config.phk @@ -287,6 +287,7 @@ exit 0 # HAVE_DLADDR + # HAVE_KQUEUE + # HAVE_NANOSLEEP + +# HAVE_PTHREAD_SET_NAME_NP + # HAVE_PTHREAD_SETNAME_NP + # HAVE_SETPROCTITLE + # HAVE_SRANDOMDEV + diff --git a/configure.ac b/configure.ac index d7c2d94..1062797 100644 --- a/configure.ac +++ b/configure.ac @@ -248,6 +248,7 @@ AC_CHECK_FUNCS([fallocate]) save_LIBS="${LIBS}" LIBS="${PTHREAD_LIBS}" +AC_CHECK_FUNCS([pthread_set_name_np]) AC_CHECK_FUNCS([pthread_setname_np]) AC_CHECK_FUNCS([pthread_mutex_isowned_np]) AC_CHECK_FUNCS([pthread_timedjoin_np]) From fgsch at lodoss.net Thu Nov 26 16:10:13 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Thu, 26 Nov 2015 08:10:13 -0800 Subject: [varnishcache/varnish-cache] f06357: Simplify Message-ID: <56572ee59e46e_764c3f9a6819f2c08509b@hookshot-fe6-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: f0635786a2219a88e72d41e910cb0a220c0fba87 https://github.com/varnishcache/varnish-cache/commit/f0635786a2219a88e72d41e910cb0a220c0fba87 Author: Federico G. Schwindt Date: 2015-11-26 (Thu, 26 Nov 2015) Changed paths: M bin/varnishtest/tests/r01821.vtc Log Message: ----------- Simplify Commit: 982e79671d09d3a0661b8ba7e17c1108ca2eb42f https://github.com/varnishcache/varnish-cache/commit/982e79671d09d3a0661b8ba7e17c1108ca2eb42f Author: Federico G. Schwindt Date: 2015-11-26 (Thu, 26 Nov 2015) Changed paths: M bin/varnishd/cache/cache_main.c M config.phk M configure.ac Log Message: ----------- Let other OS set the thread name as well Amends 83aa5402 to handle FreeBSD and OpenBSD (at least). Compare: https://github.com/varnishcache/varnish-cache/compare/83aa5402eedb...982e79671d09 From fgsch at lodoss.net Fri Nov 27 17:24:03 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Fri, 27 Nov 2015 18:24:03 +0100 Subject: [master] 4bb6e20 Use req as intended Message-ID: commit 4bb6e20f1074296311ad3e953871eecbbaf1e8f5 Author: Federico G. Schwindt Date: Fri Nov 27 16:39:36 2015 +0000 Use req as intended diff --git a/doc/sphinx/phk/gzip.rst b/doc/sphinx/phk/gzip.rst index ae244d9..c5e4aad 100644 --- a/doc/sphinx/phk/gzip.rst +++ b/doc/sphinx/phk/gzip.rst @@ -151,7 +151,7 @@ compression efficiency, you should:: sub vcl_miss { if (object needs ESI processing) { - unset bereq.http.accept-encoding; + unset req.http.accept-encoding; } } diff --git a/doc/sphinx/reference/vmod.rst b/doc/sphinx/reference/vmod.rst index 91953b0..0d30162 100644 --- a/doc/sphinx/reference/vmod.rst +++ b/doc/sphinx/reference/vmod.rst @@ -231,7 +231,7 @@ STRING_LIST Consider this contrived example:: - set bereq.http.foo = std.toupper(req.http.foo + req.http.bar); + set req.http.foo = std.toupper(req.http.foo + req.http.bar); The usual way to do this, would be be to allocate memory for the concatenated string, then pass that to ``toupper()`` which in diff --git a/doc/sphinx/users-guide/devicedetection.rst b/doc/sphinx/users-guide/devicedetection.rst index 9138816..67f711a 100644 --- a/doc/sphinx/users-guide/devicedetection.rst +++ b/doc/sphinx/users-guide/devicedetection.rst @@ -127,8 +127,8 @@ VCL:: } # override the header before it is sent to the backend - sub vcl_miss { if (req.http.X-UA-Device) { set bereq.http.User-Agent = req.http.X-UA-Device; } } - sub vcl_pass { if (req.http.X-UA-Device) { set bereq.http.User-Agent = req.http.X-UA-Device; } } + sub vcl_miss { if (req.http.X-UA-Device) { set req.http.User-Agent = req.http.X-UA-Device; } } + sub vcl_pass { if (req.http.X-UA-Device) { set req.http.User-Agent = req.http.X-UA-Device; } } # standard Vary handling code from previous examples. sub vcl_backend_response { From fgsch at lodoss.net Fri Nov 27 17:25:14 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Fri, 27 Nov 2015 09:25:14 -0800 Subject: [varnishcache/varnish-cache] 4bb6e2: Use req as intended Message-ID: <565891fa359d0_59453f956699b2a0708a6@hookshot-fe3-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 4bb6e20f1074296311ad3e953871eecbbaf1e8f5 https://github.com/varnishcache/varnish-cache/commit/4bb6e20f1074296311ad3e953871eecbbaf1e8f5 Author: Federico G. Schwindt Date: 2015-11-27 (Fri, 27 Nov 2015) Changed paths: M doc/sphinx/phk/gzip.rst M doc/sphinx/reference/vmod.rst M doc/sphinx/users-guide/devicedetection.rst Log Message: ----------- Use req as intended From fgsch at lodoss.net Fri Nov 27 18:00:33 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Fri, 27 Nov 2015 19:00:33 +0100 Subject: [master] 96dc47c Remove pasto Message-ID: commit 96dc47cac4dbcc0d5feca61fcfd8db4bd1b0948b Author: Federico G. Schwindt Date: Fri Nov 27 17:42:26 2015 +0000 Remove pasto diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c index c493e02..a539817 100644 --- a/bin/varnishd/cache/cache_req_fsm.c +++ b/bin/varnishd/cache/cache_req_fsm.c @@ -419,7 +419,6 @@ cnt_lookup(struct worker *wrk, struct req *req) wrk->stats->cache_hitpass++; req->req_step = R_STP_PASS; return (REQ_FSM_MORE); - } else if (oc->flags & OC_F_PASS) { } VSLb(req->vsl, SLT_Hit, "%u", ObjGetXID(wrk, req->objcore)); From fgsch at lodoss.net Fri Nov 27 18:05:13 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Fri, 27 Nov 2015 10:05:13 -0800 Subject: [varnishcache/varnish-cache] 96dc47: Remove pasto Message-ID: <56589b5937b04_55c53fdbade8b2a01166c1@hookshot-fe5-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 96dc47cac4dbcc0d5feca61fcfd8db4bd1b0948b https://github.com/varnishcache/varnish-cache/commit/96dc47cac4dbcc0d5feca61fcfd8db4bd1b0948b Author: Federico G. Schwindt Date: 2015-11-27 (Fri, 27 Nov 2015) Changed paths: M bin/varnishd/cache/cache_req_fsm.c Log Message: ----------- Remove pasto From fgsch at lodoss.net Fri Nov 27 20:00:55 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Fri, 27 Nov 2015 21:00:55 +0100 Subject: [master] a30c474 Reword and update code Message-ID: commit a30c474e09ed6d8af1bd6a2da7a7574a5ef1407f Author: Federico G. Schwindt Date: Fri Nov 27 19:59:05 2015 +0000 Reword and update code diff --git a/doc/sphinx/users-guide/vcl-example-websockets.rst b/doc/sphinx/users-guide/vcl-example-websockets.rst index 609fe61..24ea561 100644 --- a/doc/sphinx/users-guide/vcl-example-websockets.rst +++ b/doc/sphinx/users-guide/vcl-example-websockets.rst @@ -1,21 +1,14 @@ -Implementing websocket support ------------------------------- +Adding WebSockets support +------------------------- -Websockets is a technology for creating a bidirectional stream-based channel over HTTP. +WebSockets is a technology for creating a bidirectional stream-based +channel over HTTP. -To run websockets through Varnish you need to pipe it, and copy the Upgrade header. Use the following -VCL config to do so:: +To run WebSockets through Varnish you need to pipe it as follows:: - sub vcl_pipe { - if (req.http.upgrade) { - set bereq.http.upgrade = req.http.upgrade; - } - } sub vcl_recv { - if (req.http.Upgrade ~ "(?i)websocket") { - return (pipe); - } + if (req.http.upgrade ~ "(?i)websocket") { + return (pipe); + } } - -.. XXX: Pipe it? maybe a bit more explanation here? benc From fgsch at lodoss.net Fri Nov 27 20:05:14 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Fri, 27 Nov 2015 12:05:14 -0800 Subject: [varnishcache/varnish-cache] a30c47: Reword and update code Message-ID: <5658b77ac53f0_7c853ffb0ef2f2bc981f7@hookshot-fe4-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: a30c474e09ed6d8af1bd6a2da7a7574a5ef1407f https://github.com/varnishcache/varnish-cache/commit/a30c474e09ed6d8af1bd6a2da7a7574a5ef1407f Author: Federico G. Schwindt Date: 2015-11-27 (Fri, 27 Nov 2015) Changed paths: M doc/sphinx/users-guide/vcl-example-websockets.rst Log Message: ----------- Reword and update code From fgsch at lodoss.net Mon Nov 30 20:08:42 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Mon, 30 Nov 2015 21:08:42 +0100 Subject: [master] 1c7f56d Update references Message-ID: commit 1c7f56d5ef14006bdae1d7e00ecb4e830f443d4f Author: Federico G. Schwindt Date: Mon Nov 30 18:04:48 2015 +0000 Update references diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c index 5d1d1ab..17aba0e 100644 --- a/bin/varnishd/cache/cache_fetch.c +++ b/bin/varnishd/cache/cache_fetch.c @@ -327,14 +327,14 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo) /* * A HEAD request can never have a body in the reply, * no matter what the headers might say. - * [RFC2516 4.3 p33] + * [RFC7231 4.3.2 p25] */ wrk->stats->fetch_head++; bo->htc->body_status = BS_NONE; } else if (http_GetStatus(bo->beresp) <= 199) { /* * 1xx responses never have a body. - * [RFC2616 4.3 p33] + * [RFC7230 3.3.2 p31] * ... but we should never see them. */ wrk->stats->fetch_1xx++; @@ -342,7 +342,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo) } else if (http_IsStatus(bo->beresp, 204)) { /* * 204 is "No Content", obviously don't expect a body. - * [RFC7230 3.3.1 p28 and 3.3.2 p30] + * [RFC7230 3.3.1 p29 and 3.3.2 p31] */ wrk->stats->fetch_204++; if (http_GetHdr(bo->beresp, H_Content_Length, NULL) || @@ -353,7 +353,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo) } else if (http_IsStatus(bo->beresp, 304)) { /* * 304 is "Not Modified" it has no body. - * [RFC2616 10.3.5 p63] + * [RFC7230 3.3 p28] */ wrk->stats->fetch_304++; bo->htc->body_status = BS_NONE; From fgsch at lodoss.net Mon Nov 30 20:10:16 2015 From: fgsch at lodoss.net (Federico G. Schwindt) Date: Mon, 30 Nov 2015 12:10:16 -0800 Subject: [varnishcache/varnish-cache] 1c7f56: Update references Message-ID: <565cad288b028_15983f8bc44bb2b810446e@hookshot-fe3-cp1-prd.iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/varnishcache/varnish-cache Commit: 1c7f56d5ef14006bdae1d7e00ecb4e830f443d4f https://github.com/varnishcache/varnish-cache/commit/1c7f56d5ef14006bdae1d7e00ecb4e830f443d4f Author: Federico G. Schwindt Date: 2015-11-30 (Mon, 30 Nov 2015) Changed paths: M bin/varnishd/cache/cache_fetch.c Log Message: ----------- Update references