From geoff at uplex.de Tue Sep 1 09:55:05 2015 From: geoff at uplex.de (Geoff Simmons) Date: Tue, 01 Sep 2015 11:55:05 +0200 Subject: includes for public APIs Message-ID: <55E575F9.7000609@uplex.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hello all, At VDD this morning, phk asked for suggestions about includes that would someday comprise public APIs. Here's what I found from grepping VMODs and standalone apps that I maintain or work with: "miniobj.h" "vas.h" "vcs_version.h" "vcl.h" "vct.h" "vdef.h" "vmb.h" "vpf.h" "vqueue.h" "vre.h" "vrt.h" "vsb.h" "vsha256.h" "vtim.h" ... and the VAPI APIs (of course). Note that most of these are not so much APIs about a caching proxy per se, but rather tested solutions for various tasks, such as safe buffers, character types, memory barriers, SHA256. It makes a VMOD or app that much more powerful to make use of them. (Can't imagine what a VMOD would do with vpf.h, but it's quite useful for an application.) Some others along those lines that I see in include/*: vbm.h vend.h vfil.h vnum.h vrnd.h vtcp.h Have I understood correctly that vcli.h will now be available to VMODs (at least at init time)? Best, Geoff - -- ** * * UPLEX - Nils Goroll Systemoptimierung Scheffelstra?e 32 22301 Hamburg Tel +49 40 2880 5731 Mob +49 176 636 90917 Fax +49 40 42949753 http://uplex.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCAAGBQJV5XXsAAoJEOUwvh9pJNURNg4P/1f8ReGYDtdZ0maYYVlUM4xI qC73rF//5R9pPv67PmdCL5c+ChL0lFZvYFPfPt/4zzFdytcUqPOSBW+5n3nqG9eQ Puos+H2r9c32Fc3W3v815uX2ecxUjz8h519JMDTx3u2cg+Ynwt7oxNFliG0zFhhI O8BWCOFfyQHayh5W7xqMwLrkZ2SrDE5iYJBK2VPduHFEhP50eqAQOKkc+HBkhzVW +c2k9vg927PmHeep/YSJ7ATbn6nfBEd7p9yrfbDSGkcuM48LsIQZ1XESs6deKAjZ x5dpGvc0eY+3PzDy+2+fw1G4eVv6ZL/RiRnsWNKPx0AjGuOF4km7Z/qJr2PmxBon jwsb3WpmUvyD0lDDpeNnNjwWcwCb3meX/zNK8ZxFnpG/W6SMaJ9nso6nM8hUR+xM R7MokC0bZI9MhIOliScU/D6rp9ioAh2SU2kuj1pXaxSOJU7hRfR4IOoHyYLrpPBA atU6sIVqxBaGp7mKyDlAOyJttj5/I6UQCLZnybm8v8Y1WK9ozNHlq11g6jsy5UJJ uEVzQ32I+Th9Gahp+2myg9WalukxNRksiyORJd0cXijvQvAyO3lY52rlvKWtJdgK t1+BVWU2MS7+UMg/lmQTsSHLDgaubsOkQvOeoKY1bNHaw0Yb2HpiF+ajUYIOdTSJ izdrA89UFh4MsPA9hWoL =grVm -----END PGP SIGNATURE----- From daghf at varnish-software.com Tue Sep 1 10:20:22 2015 From: daghf at varnish-software.com (Dag Haavi Finstad) Date: Tue, 1 Sep 2015 12:20:22 +0200 Subject: includes for public APIs In-Reply-To: <55E575F9.7000609@uplex.de> References: <55E575F9.7000609@uplex.de> Message-ID: Hi Here's my list from evaluating various commonly used VMODs: Initial impression is that we can get rid of cache/cache.h from (almost) all of these by exposing the workspace bits in a separate header file. libvmod_example =============== - varnish includes: vrt.h, cache/cache.h >From cache/cache.h: - WS_* libvmod_var =========== - varnish includes: vrt.h, vsa.h, cache/cache.h - vqueue - AN/AZ - CHECK_OBJ_* - vsa_suckaddr_len >From cache/cache.h: - WS_* libvmod_digest ============== - varnish includes: vcl.h, vrt.h, cache/cache.h - VCL_EVENT_* - CHECK_OBJ_* >From cache/cache.h: - WS_* libvmod_curl ============ - varnish includes: vrt.h, vsb.h, cache/cache.h - vqueue - VSB_* - CHECK_OBJ_* >From cache/cache.h: - struct req, struct busyobj, struct vsl - Should get rid of these deps via PRIV_TASK - WS_* libvmod_header ============== - varnish includes: vcl.h, vrt.h, cache/cache.h - This one uses various internal header representation bits that we probably won't expose in a stable API ... libvmod_urlcode =============== - varnish includes: vrt.h, cache/cache.h - CHECK_OBJ_* >From cache/cache.h: - WS_* libvmod_cookie ============= - varnish includes: vrt.h, vqueue.h, cache/cache.h - vqueue - CHECK_OBJ_* - VSB_* >From cache/cache.h: - struct req, ... - Should get rid of this via PRIV_TASK - WS_* libvmod_geoip ============= - varnish includes: vrt.h, vrt_obj.h, cache/cache.h >From cache/cache.h: - WS_* libvmod_vsthrottle ================== - varnish includes: vrt.h, vsha256.h, vcl.h, miniobj.h - VCL_EVENT_* - CHECK_OBJ_* - SHA256_* On Tue, Sep 1, 2015 at 11:55 AM, Geoff Simmons wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Hello all, > > At VDD this morning, phk asked for suggestions about includes that > would someday comprise public APIs. Here's what I found from grepping > VMODs and standalone apps that I maintain or work with: > > "miniobj.h" > "vas.h" > "vcs_version.h" > "vcl.h" > "vct.h" > "vdef.h" > "vmb.h" > "vpf.h" > "vqueue.h" > "vre.h" > "vrt.h" > "vsb.h" > "vsha256.h" > "vtim.h" > > ... and the VAPI APIs (of course). > > Note that most of these are not so much APIs about a caching proxy per > se, but rather tested solutions for various tasks, such as safe > buffers, character types, memory barriers, SHA256. It makes a VMOD or > app that much more powerful to make use of them. (Can't imagine what a > VMOD would do with vpf.h, but it's quite useful for an application.) > > Some others along those lines that I see in include/*: > > vbm.h > vend.h > vfil.h > vnum.h > vrnd.h > vtcp.h > > Have I understood correctly that vcli.h will now be available to VMODs > (at least at init time)? > > > Best, > Geoff > - -- > ** * * UPLEX - Nils Goroll Systemoptimierung > > Scheffelstra?e 32 > 22301 Hamburg > > Tel +49 40 2880 5731 > Mob +49 176 636 90917 > Fax +49 40 42949753 > > http://uplex.de > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.12 (GNU/Linux) > > iQIcBAEBCAAGBQJV5XXsAAoJEOUwvh9pJNURNg4P/1f8ReGYDtdZ0maYYVlUM4xI > qC73rF//5R9pPv67PmdCL5c+ChL0lFZvYFPfPt/4zzFdytcUqPOSBW+5n3nqG9eQ > Puos+H2r9c32Fc3W3v815uX2ecxUjz8h519JMDTx3u2cg+Ynwt7oxNFliG0zFhhI > O8BWCOFfyQHayh5W7xqMwLrkZ2SrDE5iYJBK2VPduHFEhP50eqAQOKkc+HBkhzVW > +c2k9vg927PmHeep/YSJ7ATbn6nfBEd7p9yrfbDSGkcuM48LsIQZ1XESs6deKAjZ > x5dpGvc0eY+3PzDy+2+fw1G4eVv6ZL/RiRnsWNKPx0AjGuOF4km7Z/qJr2PmxBon > jwsb3WpmUvyD0lDDpeNnNjwWcwCb3meX/zNK8ZxFnpG/W6SMaJ9nso6nM8hUR+xM > R7MokC0bZI9MhIOliScU/D6rp9ioAh2SU2kuj1pXaxSOJU7hRfR4IOoHyYLrpPBA > atU6sIVqxBaGp7mKyDlAOyJttj5/I6UQCLZnybm8v8Y1WK9ozNHlq11g6jsy5UJJ > uEVzQ32I+Th9Gahp+2myg9WalukxNRksiyORJd0cXijvQvAyO3lY52rlvKWtJdgK > t1+BVWU2MS7+UMg/lmQTsSHLDgaubsOkQvOeoKY1bNHaw0Yb2HpiF+ajUYIOdTSJ > izdrA89UFh4MsPA9hWoL > =grVm > -----END PGP SIGNATURE----- > > _______________________________________________ > varnish-dev mailing list > varnish-dev at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev -- Dag Haavi Finstad Software Developer | Varnish Software Mobile: +47 476 64 134 We Make Websites Fly! From dridi at varni.sh Tue Sep 1 11:29:20 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Tue, 1 Sep 2015 13:29:20 +0200 Subject: includes for public APIs In-Reply-To: <55E575F9.7000609@uplex.de> References: <55E575F9.7000609@uplex.de> Message-ID: > Have I understood correctly that vcli.h will now be available to VMODs > (at least at init time)? I don't think we've mentioned this file, I'd say no. From geoff at uplex.de Tue Sep 1 11:50:09 2015 From: geoff at uplex.de (Geoff Simmons) Date: Tue, 01 Sep 2015 13:50:09 +0200 Subject: includes for public APIs In-Reply-To: References: <55E575F9.7000609@uplex.de> Message-ID: <55E590F1.8020209@uplex.de> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 09/01/2015 01:29 PM, Dridi Boukelmoune wrote: >> Have I understood correctly that vcli.h will now be available to >> VMODs (at least at init time)? > > I don't think we've mentioned this file, I'd say no. What I had in mind is what has turned out to be ctx->msg (which ends up going back over the CLI as an error message). Which is fine, that's all I think we need. - -- ** * * UPLEX - Nils Goroll Systemoptimierung Scheffelstra?e 32 22301 Hamburg Tel +49 40 2880 5731 Mob +49 176 636 90917 Fax +49 40 42949753 http://uplex.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIcBAEBCAAGBQJV5ZDxAAoJEOUwvh9pJNUR+G4P/1QOdQvb5SrFN4rDmTDbWqp9 sP9KqMSAS8eXekXMreTvhLA1IXRTb4E2yK162pk9fsOqyUdjzTby7Bv1n9rnfF/M 5ku+1i3BUs5UumaTihaIn81V8ksRu5GrCMWU65dJCT9UT+jmUvd7DjzJOpOtT+mg rBy6LJB6P/X/uGKDwoOZAZW6Dv0QhIl0HvoQzZcdIacRCUJ5yjJOn4EOZa+6Qclz jxtgksz60qK8tEiSMHvXm9y0DXkJDwLiKzuG+ZL3bj1CyqSjvtQgVNukoaiKhHR6 D/Uwnaf4rIsAQ/Wb3NzcFxYnSAEEETHrJCZF/pGXhzcaxXTCSR8V6oIMvSusaOxe 6Oqn8o1uUEyn3+r2Gy1vjcfi+RgVuAr+hZBPbX01YDr98L9CGYtcsIM1wZVW2WHD Aain/l7tNt/hqN3tJHgVBI1J367KS5tfJ+ZQYo1qKA9cWa+6YeR68Rj4Rn3JaAeq CYYegkLBy7dv9/xCVLNQo7ePEOenZfyYNqh9ijHs9eo5y2w4qJMUvdMFI5dKqt0d peIwnTojCtFXIY3OmL0CP95lhlOdxbykIPE4K+x5d6hbRdLv4eeknYNbYTBrd+an b1iVpwJVMN1ZZS5+nARlHHK0IRciQ7IeIHrc+02GLrLS8x7Gv+/ssWZSfDmFIG/j jPftk9gxtkz8/zhuUVeD =XLn5 -----END PGP SIGNATURE----- From slink at schokola.de Tue Sep 1 12:14:35 2015 From: slink at schokola.de (Nils Goroll) Date: Tue, 01 Sep 2015 14:14:35 +0200 Subject: [PATCH]: redhat startup scripts should no longer use -u user In-Reply-To: <55DEB6D7.8090109@redpill-linpro.com> References: <55DE336A.8070408@redpill-linpro.com> <55DEB6D7.8090109@redpill-linpro.com> Message-ID: <55E596AB.8050202@schokola.de> @VDD15Q3: Lasse wants to look after this, I have assigned him in patchwork On 27/08/15 09:05, Ingvar Hagelund wrote: >> > varnish-4.1.0 does no longer support the -u user option. This >> > changes the various variants of redhat startup scripts to use the >> > unix "jail" variant. > Or even better, giving users the probably very seldom used option to > use some other user than "varnish" by the sysconfig/params files. From slink at schokola.de Tue Sep 1 13:32:43 2015 From: slink at schokola.de (Nils Goroll) Date: Tue, 01 Sep 2015 15:32:43 +0200 Subject: [PATCH] reliable name resolution in varnishtest In-Reply-To: References: Message-ID: <55E5A8FB.3070404@schokola.de> Hi, in principle, this works on Solaris, but * when building 64bit binaries, LD_PRELOAD fails when the shell called by the libtool generated varnishd wrapper scripts is 32bit, as is the case on varnishdev-il A quick hack is to use LD_PRELOAD_64, but that is not generic. The same case would exist if the shell was 64bit and we were building 32bit bins. * for the hosts file we should probably decide to use ipv4 _or_ ipv6 v45.vtc: **** v1 1.6 CLI RX| Privilege proc_setid missing, will not change uid/gid\n **** v1 1.6 CLI RX| Backend host "varnishtest.debug": resolves to too many addresses.\n **** v1 1.6 CLI RX| Only one IPv4 and one IPv6 are allowed.\n **** v1 1.6 CLI RX| Please specify which exact address you want to use, we found all of these:\n **** v1 1.6 CLI RX| \t127.0.0.1:34143\n **** v1 1.6 CLI RX| \t127.0.0.2:34143\n **** v1 1.6 CLI RX| \t::1:34143\n **** v1 1.6 CLI RX| ('input' Line 6 Pos 25)\n **** v1 1.6 CLI RX| .host = "varnishtest.debug";\n **** v1 1.6 CLI RX| ------------------------###################-\n **** v1 1.6 CLI RX| \n **** v1 1.6 CLI RX| Running VCC-compiler failed, exited with 2\n **** v1 1.6 CLI RX| VCL compilation failed ** v1 1.6 VCL compilation failed (as expected) *** v1 1.6 Found expected string: ("resolves to too many addresses.") Nils From rafaelfz at taghos.com.br Wed Sep 2 21:23:40 2015 From: rafaelfz at taghos.com.br (Rafael Zalamena) Date: Wed, 2 Sep 2015 18:23:40 -0300 Subject: Fix accept_filter for GNU/Linux Message-ID: <20150902182340.793a7c35@taghos.com.br> Hello, Varnish cache daemon is not doing 'accept_filter' for the GNU/Linux version because of HAVE_ACCEPT_FILTER not being defined. Something along the way broke it, so in order to fix it I have added TCP_DEFER_ACCEPT detection code to configure.ac to define HAVE_ACCEPT_FILTER and HAVE_TCP_DEFER_ACCEPT so we can have a fallback of accept_filter on Linux. Since I didn't see any different use of ACCEPT_FILTER and historicaly no one used it diferently I kept TCP_DEFER_ACCEPT being a ACCEPT_FILTER replacement to create a small diff. diff --git configure.ac configure.ac index 6c4d5f2..4a50fd8 100644 --- configure.ac +++ configure.ac @@ -366,6 +366,19 @@ AC_CHECK_DECL([SO_ACCEPTFILTER], ] ) +AC_CHECK_DECL([TCP_DEFER_ACCEPT], + [ + AC_DEFINE(HAVE_ACCEPT_FILTERS,1,[Define to 1 if you have accept filters]), + AC_DEFINE(HAVE_TCP_DEFER_ACCEPT,1,[Define to 1 if you have TCP defer accept]) + ], + , + [ +#include +#include +#include + ] +) + # Older Solaris versions define SO_{RCV,SND}TIMEO, but do not # implement them. # diff --git lib/libvarnish/vtcp.c lib/libvarnish/vtcp.c index 3992555..732c2ea 100644 --- lib/libvarnish/vtcp.c +++ lib/libvarnish/vtcp.c @@ -146,6 +146,7 @@ VTCP_hisname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen) /*--------------------------------------------------------------------*/ #ifdef HAVE_ACCEPT_FILTERS +#ifndef HAVE_TCP_DEFER_ACCEPT int VTCP_filter_http(int sock) @@ -160,7 +161,7 @@ VTCP_filter_http(int sock) return (retval); } -#elif defined(__linux) +#else /* HAVE_TCP_DEFER_ACCEPT */ int VTCP_filter_http(int sock) @@ -173,6 +174,7 @@ VTCP_filter_http(int sock) return (retval); } +#endif #else int From phk at phk.freebsd.dk Thu Sep 3 08:08:51 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Thu, 03 Sep 2015 08:08:51 +0000 Subject: Fix accept_filter for GNU/Linux In-Reply-To: <20150902182340.793a7c35@taghos.com.br> References: <20150902182340.793a7c35@taghos.com.br> Message-ID: <1874.1441267731@critter.freebsd.dk> -------- In message <20150902182340.793a7c35 at taghos.com.br>, Rafael Zalamena writes: >Varnish cache daemon is not doing 'accept_filter' for the GNU/Linux >version because of HAVE_ACCEPT_FILTER not being defined. Something along >the way broke it, so in order to fix it I have added TCP_DEFER_ACCEPT >detection code to configure.ac to define HAVE_ACCEPT_FILTER and >HAVE_TCP_DEFER_ACCEPT so we can have a fallback of accept_filter on Linux. For this to go in, it either needs to be off by default initially and then we can change that to on by default once we have experience with it. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From fgsch at lodoss.net Thu Sep 3 23:15:12 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 4 Sep 2015 00:15:12 +0100 Subject: Fix accept_filter for GNU/Linux In-Reply-To: <20150902182340.793a7c35@taghos.com.br> References: <20150902182340.793a7c35@taghos.com.br> Message-ID: Hi, Actually the problem is somewhere else. The attached diff should fix it. Cheers. On Wed, Sep 2, 2015 at 10:23 PM, Rafael Zalamena wrote: > Hello, > > Varnish cache daemon is not doing 'accept_filter' for the GNU/Linux > version because of HAVE_ACCEPT_FILTER not being defined. Something along > the way broke it, so in order to fix it I have added TCP_DEFER_ACCEPT > detection code to configure.ac to define HAVE_ACCEPT_FILTER and > HAVE_TCP_DEFER_ACCEPT so we can have a fallback of accept_filter on Linux. > > Since I didn't see any different use of ACCEPT_FILTER and historicaly no > one used it diferently I kept TCP_DEFER_ACCEPT being a ACCEPT_FILTER > replacement to create a small diff. > > diff --git configure.ac configure.ac > index 6c4d5f2..4a50fd8 100644 > --- configure.ac > +++ configure.ac > @@ -366,6 +366,19 @@ AC_CHECK_DECL([SO_ACCEPTFILTER], > ] > ) > > +AC_CHECK_DECL([TCP_DEFER_ACCEPT], > + [ > + AC_DEFINE(HAVE_ACCEPT_FILTERS,1,[Define to 1 if you have accept > filters]), > + AC_DEFINE(HAVE_TCP_DEFER_ACCEPT,1,[Define to 1 if you have TCP defer > accept]) > + ], > + , > + [ > +#include > +#include > +#include > + ] > +) > + > # Older Solaris versions define SO_{RCV,SND}TIMEO, but do not > # implement them. > # > diff --git lib/libvarnish/vtcp.c lib/libvarnish/vtcp.c > index 3992555..732c2ea 100644 > --- lib/libvarnish/vtcp.c > +++ lib/libvarnish/vtcp.c > @@ -146,6 +146,7 @@ VTCP_hisname(int sock, char *abuf, unsigned alen, char > *pbuf, unsigned plen) > /*--------------------------------------------------------------------*/ > > #ifdef HAVE_ACCEPT_FILTERS > +#ifndef HAVE_TCP_DEFER_ACCEPT > > int > VTCP_filter_http(int sock) > @@ -160,7 +161,7 @@ VTCP_filter_http(int sock) > return (retval); > } > > -#elif defined(__linux) > +#else /* HAVE_TCP_DEFER_ACCEPT */ > > int > VTCP_filter_http(int sock) > @@ -173,6 +174,7 @@ VTCP_filter_http(int sock) > return (retval); > } > > +#endif > #else > > int > > _______________________________________________ > varnish-dev mailing list > varnish-dev at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c index 9736ca9..a17351d 100644 --- a/bin/varnishd/cache/cache_acceptor.c +++ b/bin/varnishd/cache/cache_acceptor.c @@ -489,7 +489,6 @@ vca_acct(void *arg) assert (ls->sock > 0); // We know where stdin is AZ(listen(ls->sock, cache_param->listen_depth)); vca_tcp_opt_set(ls->sock, 1); -#ifdef HAVE_ACCEPT_FILTERS if (cache_param->accept_filter) { int i; i = VTCP_filter_http(ls->sock); @@ -498,7 +497,6 @@ vca_acct(void *arg) "Kernel filtering: sock=%d, ret=%d %s", ls->sock, i, strerror(errno)); } -#endif /* HAVE_ACCEPT_FILTERS */ } need_test = 1; diff --git a/include/tbl/params.h b/include/tbl/params.h index d3a2982..339fbaa 100644 --- a/include/tbl/params.h +++ b/include/tbl/params.h @@ -30,7 +30,6 @@ /*lint -save -e525 -e539 */ -#ifdef HAVE_ACCEPT_FILTERS PARAM( /* name */ accept_filter, /* typ */ bool, @@ -44,7 +43,6 @@ PARAM( /* l-text */ NULL, /* func */ NULL ) -#endif /* HAVE_ACCEPT_FILTERS */ PARAM( /* name */ acceptor_sleep_decay, From fgsch at lodoss.net Thu Sep 3 23:31:35 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 4 Sep 2015 00:31:35 +0100 Subject: [PATCH]: redhat startup scripts should no longer use -u user In-Reply-To: <55DEB6D7.8090109@redpill-linpro.com> References: <55DE336A.8070408@redpill-linpro.com> <55DEB6D7.8090109@redpill-linpro.com> Message-ID: Hi, Why not reusing VARNISH_USER and introduce VARNISH_CCGROUP instead of adding VARNISH_JAIL? Setting it to none shouldn't be an option with the stock scripts IMO. On Thu, Aug 27, 2015 at 8:05 AM, Ingvar Hagelund wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Den 26. aug. 2015 23:45, skrev Ingvar Hagelund: > > varnish-4.1.0 does no longer support the -u user option. This > > changes the various variants of redhat startup scripts to use the > > unix "jail" variant. > > Or even better, giving users the probably very seldom used option to > use some other user than "varnish" by the sysconfig/params files. > > Ingvar > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQIcBAEBCAAGBQJV3rbTAAoJEB4pl4iKhgvREWMQAJJs8wfogMHfyRgED7vrscCL > T5JCXN2hv/06LpzgM3c1gGdoAQOBObh83ZSeZCd+XMGlvg1FAuJn11BrV1DbUmmZ > +rZWwmOcg5a6oKGBGFVOOAD/GrfrsEyN+3KdHRnfb7mGKPyMKOych8Ir4y9hbx2y > 7xfxjmMk8JCNugYyS+F36Umd8uYCDhkr5x1cN50j7P32KWMQEd21XGfahJ5kLN2V > rCbKa2EDlWXECFA2u90ZUBc3kI61IT/DqJxvdaO8/MtYp1oz37EF3uu+bnJ1YlDn > pQpVO4IdWPif4y7OjHvbA/FNig9gbO/TMVKnyl0Npy+vJpaEcV6Nmo5tMCL5yJjL > CgM95PwAhn77HufcFDoUFj8NZUWgg+1B7yUxECEQoSwOmfD/6z9Wd+uxcziu+FG0 > 8CLxA9dPMYPfYCKdz3ik2/IAvxGmfsZOdSEzPLumFDYOd/FEClZrAlWpLijysAhh > Jpezrb5HLCpHM5aDAJuCUN9ug6Endur2KebVj0cYk3qUUf4JTOnkZ6ZpwBWMd5on > R0zhbh5ie/VjzcI4alRrNLRvSmhDu/tXgeUB20cphnOVF0h8jW0Oo38DC2yFiS+a > gUTmteKTFNvGEKB8TniqiuCWbQ8omURH/YhSShzd7T5FkxAE4Shl3QLqS7c+aF1b > Rycpt+/DV0QlHVzu9NNO > =3Rmi > -----END PGP SIGNATURE----- > > _______________________________________________ > varnish-dev mailing list > varnish-dev at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fgsch at lodoss.net Thu Sep 3 23:48:50 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 4 Sep 2015 00:48:50 +0100 Subject: Fix accept_filter for GNU/Linux In-Reply-To: References: <20150902182340.793a7c35@taghos.com.br> Message-ID: And a version aligned with phk's comment (off by default). On Fri, Sep 4, 2015 at 12:15 AM, Federico Schwindt wrote: > Hi, > > Actually the problem is somewhere else. > > The attached diff should fix it. > > Cheers. > > On Wed, Sep 2, 2015 at 10:23 PM, Rafael Zalamena > wrote: > >> Hello, >> >> Varnish cache daemon is not doing 'accept_filter' for the GNU/Linux >> version because of HAVE_ACCEPT_FILTER not being defined. Something along >> the way broke it, so in order to fix it I have added TCP_DEFER_ACCEPT >> detection code to configure.ac to define HAVE_ACCEPT_FILTER and >> HAVE_TCP_DEFER_ACCEPT so we can have a fallback of accept_filter on Linux. >> >> Since I didn't see any different use of ACCEPT_FILTER and historicaly no >> one used it diferently I kept TCP_DEFER_ACCEPT being a ACCEPT_FILTER >> replacement to create a small diff. >> >> diff --git configure.ac configure.ac >> index 6c4d5f2..4a50fd8 100644 >> --- configure.ac >> +++ configure.ac >> @@ -366,6 +366,19 @@ AC_CHECK_DECL([SO_ACCEPTFILTER], >> ] >> ) >> >> +AC_CHECK_DECL([TCP_DEFER_ACCEPT], >> + [ >> + AC_DEFINE(HAVE_ACCEPT_FILTERS,1,[Define to 1 if you have accept >> filters]), >> + AC_DEFINE(HAVE_TCP_DEFER_ACCEPT,1,[Define to 1 if you have TCP defer >> accept]) >> + ], >> + , >> + [ >> +#include >> +#include >> +#include >> + ] >> +) >> + >> # Older Solaris versions define SO_{RCV,SND}TIMEO, but do not >> # implement them. >> # >> diff --git lib/libvarnish/vtcp.c lib/libvarnish/vtcp.c >> index 3992555..732c2ea 100644 >> --- lib/libvarnish/vtcp.c >> +++ lib/libvarnish/vtcp.c >> @@ -146,6 +146,7 @@ VTCP_hisname(int sock, char *abuf, unsigned alen, >> char *pbuf, unsigned plen) >> /*--------------------------------------------------------------------*/ >> >> #ifdef HAVE_ACCEPT_FILTERS >> +#ifndef HAVE_TCP_DEFER_ACCEPT >> >> int >> VTCP_filter_http(int sock) >> @@ -160,7 +161,7 @@ VTCP_filter_http(int sock) >> return (retval); >> } >> >> -#elif defined(__linux) >> +#else /* HAVE_TCP_DEFER_ACCEPT */ >> >> int >> VTCP_filter_http(int sock) >> @@ -173,6 +174,7 @@ VTCP_filter_http(int sock) >> return (retval); >> } >> >> +#endif >> #else >> >> int >> >> _______________________________________________ >> varnish-dev mailing list >> varnish-dev at varnish-cache.org >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Enable-accept_filter-handling-code-for-Linux.patch Type: text/x-patch Size: 1718 bytes Desc: not available URL: From martin at varnish-software.com Fri Sep 4 10:57:52 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Fri, 4 Sep 2015 12:57:52 +0200 Subject: [PATCH 1/2] Make HTTP_GetHdrPack magic header names conform to the format of regular headers Message-ID: <1441364273-18934-1-git-send-email-martin@varnish-software.com> --- bin/varnishd/cache/cache_ban.c | 2 +- bin/varnishd/cache/cache_http.c | 17 +++++++++-------- bin/varnishd/cache/cache_vrt_var.c | 6 ++++-- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c index 699bcf5..64f3afe 100644 --- a/bin/varnishd/cache/cache_ban.c +++ b/bin/varnishd/cache/cache_ban.c @@ -857,7 +857,7 @@ ban_evaluate(struct worker *wrk, const uint8_t *bs, struct objcore *oc, arg1 = HTTP_GetHdrPack(wrk, oc, bt.arg1_spec); break; case BANS_ARG_OBJSTATUS: - arg1 = HTTP_GetHdrPack(wrk, oc, ":status"); + arg1 = HTTP_GetHdrPack(wrk, oc, "\010:status:"); break; default: WRONG("Wrong BAN_ARG code"); diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c index e832992..a3aeba3 100644 --- a/bin/varnishd/cache/cache_http.c +++ b/bin/varnishd/cache/cache_http.c @@ -901,6 +901,12 @@ HTTP_GetHdrPack(struct worker *wrk, struct objcore *oc, const char *hdr) CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); AN(hdr); + l = hdr[0]; + assert(l > 0); + assert(l == strlen(hdr + 1)); + assert(hdr[l] == ':'); + hdr++; + ptr = ObjGetattr(wrk, oc, OA_HEADERS, NULL); AN(ptr); @@ -909,21 +915,16 @@ HTTP_GetHdrPack(struct worker *wrk, struct objcore *oc, const char *hdr) VSL(SLT_Debug, 0, "%d %s", __LINE__, ptr); /* Skip PROTO, STATUS and REASON */ - if (!strcmp(hdr, ":proto")) + if (!strcmp(hdr, ":proto:")) return (ptr); ptr = strchr(ptr, '\0') + 1; - if (!strcmp(hdr, ":status")) + if (!strcmp(hdr, ":status:")) return (ptr); ptr = strchr(ptr, '\0') + 1; - if (!strcmp(hdr, ":reason")) + if (!strcmp(hdr, ":reason:")) return (ptr); ptr = strchr(ptr, '\0') + 1; - l = hdr[0]; - assert(l == strlen(hdr + 1)); - assert(hdr[l] == ':'); - hdr++; - while (*ptr != '\0') { if (!strncasecmp(ptr, hdr, l)) { ptr += l; diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c index cc302c5..77f3892 100644 --- a/bin/varnishd/cache/cache_vrt_var.c +++ b/bin/varnishd/cache/cache_vrt_var.c @@ -157,7 +157,8 @@ VRT_r_obj_proto(VRT_CTX) CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); CHECK_OBJ_NOTNULL(ctx->req->objcore, OBJCORE_MAGIC); - return (HTTP_GetHdrPack(ctx->req->wrk, ctx->req->objcore, ":proto")); + return (HTTP_GetHdrPack(ctx->req->wrk, ctx->req->objcore, + "\007:proto:")); } const char * @@ -167,7 +168,8 @@ VRT_r_obj_reason(VRT_CTX) CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); CHECK_OBJ_NOTNULL(ctx->req->objcore, OBJCORE_MAGIC); - return (HTTP_GetHdrPack(ctx->req->wrk, ctx->req->objcore, ":reason")); + return (HTTP_GetHdrPack(ctx->req->wrk, ctx->req->objcore, + "\010:reason:")); } /*-------------------------------------------------------------------- -- 2.1.4 From martin at varnish-software.com Fri Sep 4 10:57:53 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Fri, 4 Sep 2015 12:57:53 +0200 Subject: [PATCH 2/2] Add iteration methods for packed headers and use them in HTTP_GetHdrPack In-Reply-To: <1441364273-18934-1-git-send-email-martin@varnish-software.com> References: <1441364273-18934-1-git-send-email-martin@varnish-software.com> Message-ID: <1441364273-18934-2-git-send-email-martin@varnish-software.com> --- bin/varnishd/cache/cache.h | 2 ++ bin/varnishd/cache/cache_http.c | 69 ++++++++++++++++++++++++++++++----------- 2 files changed, 53 insertions(+), 18 deletions(-) diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h index 648dad4..fca8fb7 100644 --- a/bin/varnishd/cache/cache.h +++ b/bin/varnishd/cache/cache.h @@ -831,6 +831,8 @@ void http_CollectHdr(struct http *hp, const char *hdr); void http_VSL_log(const struct http *hp); void HTTP_Merge(struct worker *, struct objcore *, struct http *to); uint16_t HTTP_GetStatusPack(struct worker *, struct objcore *oc); +const char *HTTP_FirstHdrPack(struct worker *, struct objcore *); +const char *HTTP_NextHdrPack(const char *); const char *HTTP_GetHdrPack(struct worker *, struct objcore *, const char *hdr); enum sess_close http_DoConnection(struct http *hp); diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c index a3aeba3..268b5b3 100644 --- a/bin/varnishd/cache/cache_http.c +++ b/bin/varnishd/cache/cache_http.c @@ -891,6 +891,38 @@ HTTP_GetStatusPack(struct worker *wrk, struct objcore *oc) /*--------------------------------------------------------------------*/ +/* Get the first packed header */ +const char * +HTTP_FirstHdrPack(struct worker *wrk, struct objcore *oc) +{ + const char *ptr; + + CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); + CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); + + ptr = ObjGetattr(wrk, oc, OA_HEADERS, NULL); + AN(ptr); + ptr += 4; /* Skip nhd and status */ + ptr = strchr(ptr, '\0') + 1; /* Skip PROTO */ + ptr = strchr(ptr, '\0') + 1; /* Skip STATUS */ + ptr = strchr(ptr, '\0') + 1; /* Skip REASON */ + if (*ptr == '\0') + return (NULL); + return (ptr); +} + +/* Get the next packed header */ +const char * +HTTP_NextHdrPack(const char *prev) +{ + + AN(prev); + prev = strchr(prev, '\0') + 1; + if (*prev == '\0') + return (NULL); + return (prev); +} + const char * HTTP_GetHdrPack(struct worker *wrk, struct objcore *oc, const char *hdr) { @@ -907,33 +939,34 @@ HTTP_GetHdrPack(struct worker *wrk, struct objcore *oc, const char *hdr) assert(hdr[l] == ':'); hdr++; - ptr = ObjGetattr(wrk, oc, OA_HEADERS, NULL); - AN(ptr); + if (hdr[0] == ':') { + /* Special cases */ + ptr = ObjGetattr(wrk, oc, OA_HEADERS, NULL); + AN(ptr); + ptr += 4; /* Skip nhd and status */ - /* Skip nhd and status */ - ptr += 4; - VSL(SLT_Debug, 0, "%d %s", __LINE__, ptr); - - /* Skip PROTO, STATUS and REASON */ - if (!strcmp(hdr, ":proto:")) - return (ptr); - ptr = strchr(ptr, '\0') + 1; - if (!strcmp(hdr, ":status:")) - return (ptr); - ptr = strchr(ptr, '\0') + 1; - if (!strcmp(hdr, ":reason:")) - return (ptr); - ptr = strchr(ptr, '\0') + 1; + if (!strcmp(hdr, ":proto:")) + return (ptr); + ptr = strchr(ptr, '\0') + 1; + if (!strcmp(hdr, ":status:")) + return (ptr); + ptr = strchr(ptr, '\0') + 1; + if (!strcmp(hdr, ":reason:")) + return (ptr); + WRONG("Unknown magic packed header"); + } - while (*ptr != '\0') { + for (ptr = HTTP_FirstHdrPack(wrk, oc); + ptr != NULL; + ptr = HTTP_NextHdrPack(ptr)) { if (!strncasecmp(ptr, hdr, l)) { ptr += l; while (vct_islws(*ptr)) ptr++; return (ptr); } - ptr = strchr(ptr, '\0') + 1; } + return (NULL); } -- 2.1.4 From rafaelfz at taghos.com.br Fri Sep 4 12:31:47 2015 From: rafaelfz at taghos.com.br (Rafael Zalamena) Date: Fri, 4 Sep 2015 09:31:47 -0300 Subject: Fix accept_filter for GNU/Linux In-Reply-To: References: <20150902182340.793a7c35@taghos.com.br> Message-ID: <20150904093147.17c5c665@taghos.com.br> Em Fri, 4 Sep 2015 00:48:50 +0100 Federico Schwindt escreveu: > And a version aligned with phk's comment (off by default). > > On Fri, Sep 4, 2015 at 12:15 AM, Federico Schwindt wrote: > > > Hi, > > > > Actually the problem is somewhere else. > > > > The attached diff should fix it. > > > > Cheers. > > With your diff varnish will spam log messages on systems without ACCEPT_FILTERS or TCP_DEFER_ACCEPT by default. I've modified my diff to kill some ifdefs and make accept_filter always avaliable, but this time disabled by default on system without ACCEPT_FILTERS or with TCP_DEFER_ACCEPT. With this: (1) anyone who wants to enable accept_filter on GNU/Linux should just call varnish with 'varnishd ... -p accept_filter=on'; (2) anyone who enables accept_filter on a system without it will have a log spam about not having support for this feature; (3) we get to keep the old behavior for systems with ACCEPT_FILTERS; diff --git bin/varnishd/cache/cache_acceptor.c bin/varnishd/cache/cache_acceptor.c index 9736ca9..a17351d 100644 --- bin/varnishd/cache/cache_acceptor.c +++ bin/varnishd/cache/cache_acceptor.c @@ -489,7 +489,6 @@ vca_acct(void *arg) assert (ls->sock > 0); // We know where stdin is AZ(listen(ls->sock, cache_param->listen_depth)); vca_tcp_opt_set(ls->sock, 1); -#ifdef HAVE_ACCEPT_FILTERS if (cache_param->accept_filter) { int i; i = VTCP_filter_http(ls->sock); @@ -498,7 +497,6 @@ vca_acct(void *arg) "Kernel filtering: sock=%d, ret=%d %s", ls->sock, i, strerror(errno)); } -#endif /* HAVE_ACCEPT_FILTERS */ } need_test = 1; diff --git configure.ac configure.ac index 6c4d5f2..4a50fd8 100644 --- configure.ac +++ configure.ac @@ -366,6 +366,19 @@ AC_CHECK_DECL([SO_ACCEPTFILTER], ] ) +AC_CHECK_DECL([TCP_DEFER_ACCEPT], + [ + AC_DEFINE(HAVE_ACCEPT_FILTERS,1,[Define to 1 if you have accept filters]), + AC_DEFINE(HAVE_TCP_DEFER_ACCEPT,1,[Define to 1 if you have TCP defer accept]) + ], + , + [ +#include +#include +#include + ] +) + # Older Solaris versions define SO_{RCV,SND}TIMEO, but do not # implement them. # diff --git include/tbl/params.h include/tbl/params.h index d3a2982..6cbe3ba 100644 --- include/tbl/params.h +++ include/tbl/params.h @@ -30,13 +30,16 @@ /*lint -save -e525 -e539 */ -#ifdef HAVE_ACCEPT_FILTERS PARAM( /* name */ accept_filter, /* typ */ bool, /* min */ NULL, /* max */ NULL, +#if defined(HAVE_ACCEPT_FILTERS) && !defined(HAVE_TCP_DEFER_ACCEPT) /* default */ "on", +#else + /* default */ "off", +#endif /* HAVE_ACCEPT_FILTERS */ /* units */ "bool", /* flags */ MUST_RESTART, /* s-text */ @@ -44,7 +47,6 @@ PARAM( /* l-text */ NULL, /* func */ NULL ) -#endif /* HAVE_ACCEPT_FILTERS */ PARAM( /* name */ acceptor_sleep_decay, diff --git lib/libvarnish/vtcp.c lib/libvarnish/vtcp.c index 3992555..732c2ea 100644 --- lib/libvarnish/vtcp.c +++ lib/libvarnish/vtcp.c @@ -146,6 +146,7 @@ VTCP_hisname(int sock, char *abuf, unsigned alen, char *pbuf, unsigned plen) /*--------------------------------------------------------------------*/ #ifdef HAVE_ACCEPT_FILTERS +#ifndef HAVE_TCP_DEFER_ACCEPT int VTCP_filter_http(int sock) @@ -160,7 +161,7 @@ VTCP_filter_http(int sock) return (retval); } -#elif defined(__linux) +#else /* HAVE_TCP_DEFER_ACCEPT */ int VTCP_filter_http(int sock) @@ -173,6 +174,7 @@ VTCP_filter_http(int sock) return (retval); } +#endif #else int From fgsch at lodoss.net Fri Sep 4 12:35:55 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 4 Sep 2015 13:35:55 +0100 Subject: Fix accept_filter for GNU/Linux In-Reply-To: <20150904093147.17c5c665@taghos.com.br> References: <20150902182340.793a7c35@taghos.com.br> <20150904093147.17c5c665@taghos.com.br> Message-ID: Did you see my second diff? :) On 4 Sep 2015 1:31 pm, "Rafael Zalamena" wrote: > Em Fri, 4 Sep 2015 00:48:50 +0100 > Federico Schwindt escreveu: > > > And a version aligned with phk's comment (off by default). > > > > On Fri, Sep 4, 2015 at 12:15 AM, Federico Schwindt > wrote: > > > > > Hi, > > > > > > Actually the problem is somewhere else. > > > > > > The attached diff should fix it. > > > > > > Cheers. > > > > > With your diff varnish will spam log messages on systems without > ACCEPT_FILTERS or TCP_DEFER_ACCEPT by default. > > I've modified my diff to kill some ifdefs and make accept_filter always > avaliable, but this time disabled by default on system without > ACCEPT_FILTERS or with TCP_DEFER_ACCEPT. > > With this: > (1) anyone who wants to enable accept_filter on GNU/Linux should just > call varnish with 'varnishd ... -p accept_filter=on'; > (2) anyone who enables accept_filter on a system without it will have a > log spam about not having support for this feature; > (3) we get to keep the old behavior for systems with ACCEPT_FILTERS; > > > diff --git bin/varnishd/cache/cache_acceptor.c > bin/varnishd/cache/cache_acceptor.c > index 9736ca9..a17351d 100644 > --- bin/varnishd/cache/cache_acceptor.c > +++ bin/varnishd/cache/cache_acceptor.c > @@ -489,7 +489,6 @@ vca_acct(void *arg) > assert (ls->sock > 0); // We know where stdin is > AZ(listen(ls->sock, cache_param->listen_depth)); > vca_tcp_opt_set(ls->sock, 1); > -#ifdef HAVE_ACCEPT_FILTERS > if (cache_param->accept_filter) { > int i; > i = VTCP_filter_http(ls->sock); > @@ -498,7 +497,6 @@ vca_acct(void *arg) > "Kernel filtering: sock=%d, ret=%d %s", > ls->sock, i, strerror(errno)); > } > -#endif /* HAVE_ACCEPT_FILTERS */ > } > > need_test = 1; > diff --git configure.ac configure.ac > index 6c4d5f2..4a50fd8 100644 > --- configure.ac > +++ configure.ac > @@ -366,6 +366,19 @@ AC_CHECK_DECL([SO_ACCEPTFILTER], > ] > ) > > +AC_CHECK_DECL([TCP_DEFER_ACCEPT], > + [ > + AC_DEFINE(HAVE_ACCEPT_FILTERS,1,[Define to 1 if you have accept > filters]), > + AC_DEFINE(HAVE_TCP_DEFER_ACCEPT,1,[Define to 1 if you have TCP defer > accept]) > + ], > + , > + [ > +#include > +#include > +#include > + ] > +) > + > # Older Solaris versions define SO_{RCV,SND}TIMEO, but do not > # implement them. > # > diff --git include/tbl/params.h include/tbl/params.h > index d3a2982..6cbe3ba 100644 > --- include/tbl/params.h > +++ include/tbl/params.h > @@ -30,13 +30,16 @@ > > /*lint -save -e525 -e539 */ > > -#ifdef HAVE_ACCEPT_FILTERS > PARAM( > /* name */ accept_filter, > /* typ */ bool, > /* min */ NULL, > /* max */ NULL, > +#if defined(HAVE_ACCEPT_FILTERS) && !defined(HAVE_TCP_DEFER_ACCEPT) > /* default */ "on", > +#else > + /* default */ "off", > +#endif /* HAVE_ACCEPT_FILTERS */ > /* units */ "bool", > /* flags */ MUST_RESTART, > /* s-text */ > @@ -44,7 +47,6 @@ PARAM( > /* l-text */ NULL, > /* func */ NULL > ) > -#endif /* HAVE_ACCEPT_FILTERS */ > > PARAM( > /* name */ acceptor_sleep_decay, > diff --git lib/libvarnish/vtcp.c lib/libvarnish/vtcp.c > index 3992555..732c2ea 100644 > --- lib/libvarnish/vtcp.c > +++ lib/libvarnish/vtcp.c > @@ -146,6 +146,7 @@ VTCP_hisname(int sock, char *abuf, unsigned alen, char > *pbuf, unsigned plen) > /*--------------------------------------------------------------------*/ > > #ifdef HAVE_ACCEPT_FILTERS > +#ifndef HAVE_TCP_DEFER_ACCEPT > > int > VTCP_filter_http(int sock) > @@ -160,7 +161,7 @@ VTCP_filter_http(int sock) > return (retval); > } > > -#elif defined(__linux) > +#else /* HAVE_TCP_DEFER_ACCEPT */ > > int > VTCP_filter_http(int sock) > @@ -173,6 +174,7 @@ VTCP_filter_http(int sock) > return (retval); > } > > +#endif > #else > > int > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fgsch at lodoss.net Fri Sep 4 12:42:40 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 4 Sep 2015 13:42:40 +0100 Subject: Fix accept_filter for GNU/Linux In-Reply-To: References: <20150902182340.793a7c35@taghos.com.br> <20150904093147.17c5c665@taghos.com.br> Message-ID: Diff aside looking at the code my impression is that the VTCP_filter_http() function is meant to be compiled in always so erroring out if it's not supported might be wrong here, or at least not when errno is EOPNOTSUPP/ multiple times. On 4 Sep 2015 1:35 pm, "Federico Schwindt" wrote: > Did you see my second diff? :) > On 4 Sep 2015 1:31 pm, "Rafael Zalamena" wrote: > >> Em Fri, 4 Sep 2015 00:48:50 +0100 >> Federico Schwindt escreveu: >> >> > And a version aligned with phk's comment (off by default). >> > >> > On Fri, Sep 4, 2015 at 12:15 AM, Federico Schwindt >> wrote: >> > >> > > Hi, >> > > >> > > Actually the problem is somewhere else. >> > > >> > > The attached diff should fix it. >> > > >> > > Cheers. >> > > >> >> With your diff varnish will spam log messages on systems without >> ACCEPT_FILTERS or TCP_DEFER_ACCEPT by default. >> >> I've modified my diff to kill some ifdefs and make accept_filter always >> avaliable, but this time disabled by default on system without >> ACCEPT_FILTERS or with TCP_DEFER_ACCEPT. >> >> With this: >> (1) anyone who wants to enable accept_filter on GNU/Linux should just >> call varnish with 'varnishd ... -p accept_filter=on'; >> (2) anyone who enables accept_filter on a system without it will have a >> log spam about not having support for this feature; >> (3) we get to keep the old behavior for systems with ACCEPT_FILTERS; >> >> >> diff --git bin/varnishd/cache/cache_acceptor.c >> bin/varnishd/cache/cache_acceptor.c >> index 9736ca9..a17351d 100644 >> --- bin/varnishd/cache/cache_acceptor.c >> +++ bin/varnishd/cache/cache_acceptor.c >> @@ -489,7 +489,6 @@ vca_acct(void *arg) >> assert (ls->sock > 0); // We know where stdin is >> AZ(listen(ls->sock, cache_param->listen_depth)); >> vca_tcp_opt_set(ls->sock, 1); >> -#ifdef HAVE_ACCEPT_FILTERS >> if (cache_param->accept_filter) { >> int i; >> i = VTCP_filter_http(ls->sock); >> @@ -498,7 +497,6 @@ vca_acct(void *arg) >> "Kernel filtering: sock=%d, ret=%d >> %s", >> ls->sock, i, strerror(errno)); >> } >> -#endif /* HAVE_ACCEPT_FILTERS */ >> } >> >> need_test = 1; >> diff --git configure.ac configure.ac >> index 6c4d5f2..4a50fd8 100644 >> --- configure.ac >> +++ configure.ac >> @@ -366,6 +366,19 @@ AC_CHECK_DECL([SO_ACCEPTFILTER], >> ] >> ) >> >> +AC_CHECK_DECL([TCP_DEFER_ACCEPT], >> + [ >> + AC_DEFINE(HAVE_ACCEPT_FILTERS,1,[Define to 1 if you have accept >> filters]), >> + AC_DEFINE(HAVE_TCP_DEFER_ACCEPT,1,[Define to 1 if you have TCP defer >> accept]) >> + ], >> + , >> + [ >> +#include >> +#include >> +#include >> + ] >> +) >> + >> # Older Solaris versions define SO_{RCV,SND}TIMEO, but do not >> # implement them. >> # >> diff --git include/tbl/params.h include/tbl/params.h >> index d3a2982..6cbe3ba 100644 >> --- include/tbl/params.h >> +++ include/tbl/params.h >> @@ -30,13 +30,16 @@ >> >> /*lint -save -e525 -e539 */ >> >> -#ifdef HAVE_ACCEPT_FILTERS >> PARAM( >> /* name */ accept_filter, >> /* typ */ bool, >> /* min */ NULL, >> /* max */ NULL, >> +#if defined(HAVE_ACCEPT_FILTERS) && !defined(HAVE_TCP_DEFER_ACCEPT) >> /* default */ "on", >> +#else >> + /* default */ "off", >> +#endif /* HAVE_ACCEPT_FILTERS */ >> /* units */ "bool", >> /* flags */ MUST_RESTART, >> /* s-text */ >> @@ -44,7 +47,6 @@ PARAM( >> /* l-text */ NULL, >> /* func */ NULL >> ) >> -#endif /* HAVE_ACCEPT_FILTERS */ >> >> PARAM( >> /* name */ acceptor_sleep_decay, >> diff --git lib/libvarnish/vtcp.c lib/libvarnish/vtcp.c >> index 3992555..732c2ea 100644 >> --- lib/libvarnish/vtcp.c >> +++ lib/libvarnish/vtcp.c >> @@ -146,6 +146,7 @@ VTCP_hisname(int sock, char *abuf, unsigned alen, >> char *pbuf, unsigned plen) >> /*--------------------------------------------------------------------*/ >> >> #ifdef HAVE_ACCEPT_FILTERS >> +#ifndef HAVE_TCP_DEFER_ACCEPT >> >> int >> VTCP_filter_http(int sock) >> @@ -160,7 +161,7 @@ VTCP_filter_http(int sock) >> return (retval); >> } >> >> -#elif defined(__linux) >> +#else /* HAVE_TCP_DEFER_ACCEPT */ >> >> int >> VTCP_filter_http(int sock) >> @@ -173,6 +174,7 @@ VTCP_filter_http(int sock) >> return (retval); >> } >> >> +#endif >> #else >> >> int >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rafaelfz at taghos.com.br Fri Sep 4 13:26:45 2015 From: rafaelfz at taghos.com.br (Rafael Zalamena) Date: Fri, 4 Sep 2015 10:26:45 -0300 Subject: Fix accept_filter for GNU/Linux In-Reply-To: References: <20150902182340.793a7c35@taghos.com.br> <20150904093147.17c5c665@taghos.com.br> Message-ID: <20150904102645.5cb433db@taghos.com.br> Em Fri, 4 Sep 2015 13:42:40 +0100 Federico Schwindt escreveu: > Diff aside looking at the code my impression is that the VTCP_filter_http() > function is meant to be compiled in always so erroring out if it's not > supported might be wrong here, or at least not when errno is EOPNOTSUPP/ > multiple times. People without it must have a way to find it out. The old way was not including any code and avoid it at all, but then we had a code that behaves differently according to the system which seems better than not giving any clues. > On 4 Sep 2015 1:35 pm, "Federico Schwindt" wrote: > > > Did you see my second diff? :) > --- SNIPPED --- Yes, I read your second diff. I agree with you that it would be better to kill the accept_filter param ifdef guards to keep it avaliable in every system, but I don't think it's a good idea to break the old behavior because people might be expecting it. That's why I suggested the TCP_DEFER_ACCEPT detection to make the code more portable instead of just looking for __linux. From fgsch at lodoss.net Fri Sep 4 14:12:59 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 4 Sep 2015 15:12:59 +0100 Subject: Fix accept_filter for GNU/Linux In-Reply-To: <20150904102645.5cb433db@taghos.com.br> References: <20150902182340.793a7c35@taghos.com.br> <20150904093147.17c5c665@taghos.com.br> <20150904102645.5cb433db@taghos.com.br> Message-ID: On Fri, Sep 4, 2015 at 2:26 PM, Rafael Zalamena wrote: > Em Fri, 4 Sep 2015 13:42:40 +0100 > Federico Schwindt escreveu: > > > Diff aside looking at the code my impression is that the > VTCP_filter_http() > > function is meant to be compiled in always so erroring out if it's not > > supported might be wrong here, or at least not when errno is EOPNOTSUPP/ > > multiple times. > > People without it must have a way to find it out. The old way was not > including any code and avoid it at all, but then we had a code that behaves > differently according to the system which seems better than not giving > any clues. > The older code will always include VTCP_filter_http() for Linux, it was not calling it though. > > > On 4 Sep 2015 1:35 pm, "Federico Schwindt" wrote: > > > > > Did you see my second diff? :) > > --- SNIPPED --- > > Yes, I read your second diff. > > I agree with you that it would be better to kill the accept_filter > param ifdef guards to keep it avaliable in every system, but I don't > think it's a good idea to break the old behavior because people might > be expecting it. That's why I suggested the TCP_DEFER_ACCEPT detection > to make the code more portable instead of just looking for __linux. > My second diff doesn't change any behaviour so nothing will break unless you enable it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingvar at redpill-linpro.com Fri Sep 4 14:29:44 2015 From: ingvar at redpill-linpro.com (Ingvar Hagelund) Date: Fri, 4 Sep 2015 16:29:44 +0200 Subject: [PATCH]: redhat startup scripts should no longer use -u user In-Reply-To: References: <55DE336A.8070408@redpill-linpro.com> <55DEB6D7.8090109@redpill-linpro.com> Message-ID: <55E9AAD8.1020407@redpill-linpro.com> Den 04. sep. 2015 01:31, skrev Federico Schwindt: > Hi, > > Why not reusing VARNISH_USER and introduce VARNISH_CCGROUP instead of > adding VARNISH_JAIL? Because it doesn't work with systemd*. The systemd EnvironmentFile file parser does not recognice a variable unless it starts with whitespace-dollar. And you can't stack the parameters with variables in variables, as the params file is just read line-for-line, and not executed as a shell script. so this works ExecStart=/usr/sbin/varnishd \ -j $VARNISH_JAIL \ ... while this does not, as there are no spaces before the dollar signs ExecStart=/usr/sbin/varnishd \ -j unix,user=$VARNISH_USER,ccgroup=$VARNISH_CCGROUP \ ... # systemctl start varnish sep. 04 15:55:22 netcat.linpro.no varnishd[9681]: Error: Unix jail: $VARNISH_USER user not found. Ingvar *) The "pure" systemd way is to stop using external shell-like configuration files that expands into command line options, that is, not the EnvironmentFile hack. When I asked about this some months ago on the systemd irc channel, I was asked in the not too humble systemd way, to tell upstream to do the "right thing", that is, stop using command line options. In short of a suitable reply, I disconnected, ate some chocolate, and read a good book. From ingvar at redpill-linpro.com Mon Sep 7 11:45:06 2015 From: ingvar at redpill-linpro.com (Ingvar Hagelund) Date: Mon, 7 Sep 2015 13:45:06 +0200 Subject: [PATCH]: redhat startup scripts should no longer use -u user In-Reply-To: <55E9AAD8.1020407@redpill-linpro.com> References: <55DE336A.8070408@redpill-linpro.com> <55DEB6D7.8090109@redpill-linpro.com> <55E9AAD8.1020407@redpill-linpro.com> Message-ID: <55ED78C2.8030505@redpill-linpro.com> Den 04. sep. 2015 16:29, skrev Ingvar Hagelund: > Den 04. sep. 2015 01:31, skrev Federico Schwindt: >> Hi, >> >> Why not reusing VARNISH_USER and introduce VARNISH_CCGROUP instead of >> adding VARNISH_JAIL? > > Because it doesn't work with systemd (...) With a little help from Daniel Parthey, I've made a new service/params set that looks more like the old config: http://users.linpro.no/ingvar/varnish/4.1.0-tp1/varnish.params http://users.linpro.no/ingvar/varnish/4.1.0-tp1/varnish.service For easier upgrade path for users from earlier releases, perhaps we should just skip VARNISH_CCGROUP, as it's very unlikely that anyone will ever use it, or reuse the old VARNISH_GROUP? Ingvar From fgsch at lodoss.net Tue Sep 8 07:06:09 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Tue, 8 Sep 2015 08:06:09 +0100 Subject: [PATCH]: redhat startup scripts should no longer use -u user In-Reply-To: <55ED78C2.8030505@redpill-linpro.com> References: <55DE336A.8070408@redpill-linpro.com> <55DEB6D7.8090109@redpill-linpro.com> <55E9AAD8.1020407@redpill-linpro.com> <55ED78C2.8030505@redpill-linpro.com> Message-ID: On Mon, Sep 7, 2015 at 12:45 PM, Ingvar Hagelund wrote: > Den 04. sep. 2015 16:29, skrev Ingvar Hagelund: > > Den 04. sep. 2015 01:31, skrev Federico Schwindt: > >> Hi, > >> > >> Why not reusing VARNISH_USER and introduce VARNISH_CCGROUP instead of > >> adding VARNISH_JAIL? > > > > Because it doesn't work with systemd (...) > > With a little help from Daniel Parthey, I've made a new service/params > set that looks more like the old config: > > http://users.linpro.no/ingvar/varnish/4.1.0-tp1/varnish.params > http://users.linpro.no/ingvar/varnish/4.1.0-tp1/varnish.service > I was just going to suggest that. Glad to know it works :) > > For easier upgrade path for users from earlier releases, perhaps we > should just skip VARNISH_CCGROUP, as it's very unlikely that anyone will > ever use it, or reuse the old VARNISH_GROUP? > I think we should keep it should anyone want to change it. IIRC in the past there were people having to add varnish to a particular group in order to access the compiler, because C compilers are bad unlike the other 200 ways to run random code in a server. Thanks infosec! f.- -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaume at varnish-software.com Tue Sep 8 07:52:39 2015 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Tue, 8 Sep 2015 09:52:39 +0200 Subject: Build system patch Message-ID: Hi all, Here's a big patch for the (autotools) build system. It has been one of my pet peeves, so I took some time during evenings to make it non-recursive. I'm not sure everybody will be okay with it, but my OCD compelled me to try :-) So, what does it means ? Mainly, all the Makefile.am stay, but are included by the root one to create one flat Makefile. This shows in the number of final Makefile lines (after ./configure) : ~7800 now vs ~45000. Also, make as all the the information it needs to compile in the right order, so there's no need to put the subdirs "in the right order" to avoid issues >From this, parallel builds should be faster (I'm currently working on the equivalent of a raspi, so I'm too cpu-constrained to verify this). if anyone want to try a "make -j32" on a recent machine, it should work beautifully. The changes do not make the code pretty, but it isn't really worse either. But once applied, we should be able to get rid of a lot of "$(top_builddir)" and other superfluous variables. Most of the changes are adding "path_of_the_subdir" to filenames. The point that annoys me is the installation part of some of the bin/varnishd/ and include/ headers that has to be done "by hand" because of their paths. Oh, I forgot : no mor BUILT_SOURCES! One big change is that you don't use "make -C subdir", as there is only one Makefile now, you have to run it from the top directory. The counterpart is that it's very easy to define meta-targets without shooting ourselves in the foot. I tested it as best as I could, with -j1, -j32, install, dist, distcheckyieldsconsistent results AFAICT. Out-of-tree-build works too. I also built "all" with bmake, and it seemed to work. Patch follows, you can also find it here : https://github.com/varnish/Varnish-Cache/compare/master...gquintard:WIP/non-recursive_build.patch or the branch, directly on github : https://github.com/gquintard/Varnish-Cache/tree/WIP/non-recursive_build or the comparison with master : https://github.com/varnish/Varnish-Cache/compare/master...gquintard:WIP/non-recursive_build?diff=split&name=WIP%2Fnon-recursive_build Cheers. -- Guillaume Quintard --- Makefile.am | 75 +++++++++-- bin/Makefile.am | 14 -- bin/varnishadm/Makefile.am | 24 ++-- bin/varnishd/Makefile.am | 276 +++++++++++++++++++++----------------- bin/varnishhist/Makefile.am | 41 +++--- bin/varnishlog/Makefile.am | 45 ++++--- bin/varnishncsa/Makefile.am | 53 ++++---- bin/varnishreplay/Makefile.am | 8 +- bin/varnishstat/Makefile.am | 20 +-- bin/varnishtest/Makefile.am | 57 ++++---- bin/varnishtop/Makefile.am | 43 +++--- configure.ac | 29 +--- doc/Makefile.am | 9 +- doc/graphviz/Makefile.am | 41 +++--- doc/sphinx/Makefile.am | 148 +++++++++++--------- etc/Makefile.am | 12 +- include/Makefile.am | 244 ++++++++++++++++++--------------- lib/Makefile.am | 23 ---- lib/libvarnish/Makefile.am | 87 ++++++------ lib/libvarnishapi/Makefile.am | 146 ++++++++++---------- lib/libvarnishcompat/Makefile.am | 14 +- lib/libvarnishtools/Makefile.am | 6 +- lib/libvcc/Makefile.am | 75 ++++++----- lib/libvgz/Makefile.am | 54 ++++---- lib/libvmod_debug/Makefile.am | 49 +++---- lib/libvmod_directors/Makefile.am | 57 ++++---- lib/libvmod_std/Makefile.am | 55 ++++---- man/Makefile.am | 82 ++++++----- 28 files changed, 945 insertions(+), 842 deletions(-) delete mode 100644 bin/Makefile.am delete mode 100644 lib/Makefile.am diff --git a/Makefile.am b/Makefile.am index e49505f..a1d1019 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,66 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include lib bin etc doc man +CLEANFILES = +DISTCLEANFILES = +MAINTAINERCLEANFILES = +EXTRA_DIST = +bin_PROGRAMS = +sbin_PROGRAMS = +noinst_PROGRAMS = +noinst_HEADERS = +vmod_LTLIBRARIES = +pkglib_LTLIBRARIES = +dist_pkgdata_SCRIPTS = +check_LTLIBRARIES = +lib_LTLIBRARIES = +noinst_LTLIBRARIES = +BUILT_SOURCES = +pkginclude_HEADERS = +nobase_pkginclude_HEADERS = +nobase_noinst_HEADERS = + +# etc +include etc/Makefile.am + +# include +include include/Makefile.am + +# bin +include bin/varnishd/Makefile.am +include bin/varnishlog/Makefile.am +include bin/varnishncsa/Makefile.am +include bin/varnishadm/Makefile.am +include bin/varnishhist/Makefile.am +include bin/varnishstat/Makefile.am +include bin/varnishtop/Makefile.am +include bin/varnishtest/Makefile.am +# Disabling building of the tools while api is in flux +#include bin/varnishreplay/Makefile.am + +# lib +vmoddir = $(pkglibdir)/vmods +vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py +vmodtoolargs = --strict +lib/libvmod_%.lo : include/vmod_abi.h + +include lib/libvarnish/Makefile.am +include lib/libvarnishcompat/Makefile.am +include lib/libvarnishtools/Makefile.am +include lib/libvarnishapi/Makefile.am +include lib/libvcc/Makefile.am +include lib/libvgz/Makefile.am +include lib/libvmod_debug/Makefile.am +include lib/libvmod_std/Makefile.am +include lib/libvmod_directors/Makefile.am + +RST2ANY_FLAGS = --halt=2 +# doc +include doc/Makefile.am +include doc/graphviz/Makefile.am +include doc/sphinx/Makefile.am + +# man +include man/Makefile.am pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = varnishapi.pc @@ -8,8 +68,8 @@ pkgconfig_DATA = varnishapi.pc m4dir = $(datadir)/aclocal m4_DATA = varnish.m4 -CLEANFILES = cscope.in.out cscope.out cscope.po.out -EXTRA_DIST = LICENSE autogen.sh varnishapi.pc.in varnish.m4 +CLEANFILES += cscope.in.out cscope.out cscope.po.out +EXTRA_DIST += LICENSE autogen.sh varnishapi.pc.in varnish.m4 DISTCHECK_CONFIGURE_FLAGS = \ --enable-developer-warnings \ @@ -17,19 +77,10 @@ DISTCHECK_CONFIGURE_FLAGS = \ --enable-dependency-tracking \ --enable-tests -install-data-local: - $(install_sh) -d -m 0755 $(DESTDIR)$(localstatedir)/varnish - - distcleancheck_listfiles = \ find . -type f -exec sh -c 'test -f $(srcdir)/$$1 || echo $$1' \ sh '{}' ';' -# XXX: This is a hack to ensure we have a built source tree when -# running make dist If we had used non-recursive make we could have -# solved it better, but we don't, so use this at least for now. -LICENSE: all - cscope: -rm -f cscope* find . -name '*.[hcS]' > cscope.files diff --git a/bin/Makefile.am b/bin/Makefile.am deleted file mode 100644 index 8aa2ef9..0000000 --- a/bin/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -# - -# Disabling building of the tools while api is in flux - -#SUBDIRS = varnishreplay -SUBDIRS = \ - varnishadm \ - varnishd \ - varnishhist \ - varnishlog \ - varnishncsa \ - varnishstat \ - varnishtest \ - varnishtop diff --git a/bin/varnishadm/Makefile.am b/bin/varnishadm/Makefile.am index 9033e08..e372502 100644 --- a/bin/varnishadm/Makefile.am +++ b/bin/varnishadm/Makefile.am @@ -1,21 +1,21 @@ # -AM_CPPFLAGS = \ +bin_varnishadm_varnishadm_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include -bin_PROGRAMS = varnishadm +bin_PROGRAMS += bin/varnishadm/varnishadm -varnishadm_SOURCES = \ - varnishadm.c \ - $(top_srcdir)/lib/libvarnish/vas.c \ - $(top_srcdir)/lib/libvarnish/vsa.c \ - $(top_srcdir)/lib/libvarnish/vtcp.c \ - $(top_srcdir)/lib/libvarnish/vss.c +bin_varnishadm_varnishadm_SOURCES = \ + bin/varnishadm/varnishadm.c \ + lib/libvarnish/vas.c \ + lib/libvarnish/vsa.c \ + lib/libvarnish/vtcp.c \ + lib/libvarnish/vss.c -varnishadm_CFLAGS = @LIBEDIT_CFLAGS@ +bin_varnishadm_varnishadm_CFLAGS = @LIBEDIT_CFLAGS@ -varnishadm_LDADD = \ - $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ - $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ +bin_varnishadm_varnishadm_LDADD = \ + lib/libvarnishapi/libvarnishapi.la \ + lib/libvarnishcompat/libvarnishcompat.la \ ${PTHREAD_LIBS} ${RT_LIBS} ${NET_LIBS} @LIBEDIT_LIBS@ ${LIBM} diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am index e4d2ab5..df84905 100644 --- a/bin/varnishd/Makefile.am +++ b/bin/varnishd/Makefile.am @@ -1,138 +1,164 @@ # -AM_CPPFLAGS = \ +bin_varnishd_varnishd_CPPFLAGS = \ + -I$(top_srcdir)/bin/varnishd \ -I$(top_srcdir)/include \ -I$(top_srcdir)/lib/libvgz \ -I$(top_builddir)/bin/varnishd \ -I$(top_builddir)/include -sbin_PROGRAMS = varnishd - -varnishd_SOURCES = \ - cache/cache_acceptor.c \ - cache/cache_backend.c \ - cache/cache_backend_cfg.c \ - cache/cache_backend_probe.c \ - cache/cache_backend_tcp.c \ - cache/cache_ban.c \ - cache/cache_busyobj.c \ - cache/cache_cli.c \ - cache/cache_deliver_proc.c \ - cache/cache_director.c \ - cache/cache_esi_deliver.c \ - cache/cache_esi_fetch.c \ - cache/cache_esi_parse.c \ - cache/cache_expire.c \ - cache/cache_fetch.c \ - cache/cache_fetch_proc.c \ - cache/cache_gzip.c \ - cache/cache_hash.c \ - cache/cache_http.c \ - cache/cache_lck.c \ - cache/cache_main.c \ - cache/cache_mempool.c \ - cache/cache_obj.c \ - cache/cache_panic.c \ - cache/cache_pool.c \ - cache/cache_req.c \ - cache/cache_req_body.c \ - cache/cache_req_fsm.c \ - cache/cache_rfc2616.c \ - cache/cache_range.c \ - cache/cache_session.c \ - cache/cache_shmlog.c \ - cache/cache_vary.c \ - cache/cache_vcl.c \ - cache/cache_vrt.c \ - cache/cache_vrt_priv.c \ - cache/cache_vrt_re.c \ - cache/cache_vrt_var.c \ - cache/cache_vrt_vmod.c \ - cache/cache_wrk.c \ - cache/cache_ws.c \ - common/common_vsm.c \ - common/common_vsc.c \ - hash/hash_classic.c \ - hash/hash_critbit.c \ - hash/mgt_hash.c \ - hash/hash_simple_list.c \ - http1/cache_http1_deliver.c \ - http1/cache_http1_fetch.c \ - http1/cache_http1_fsm.c \ - http1/cache_http1_line.c \ - http1/cache_http1_pipe.c \ - http1/cache_http1_proto.c \ - http1/cache_http1_vfp.c \ - mgt/mgt_acceptor.c \ - mgt/mgt_child.c \ - mgt/mgt_cli.c \ - mgt/mgt_jail.c \ - mgt/mgt_jail_unix.c \ - mgt/mgt_jail_solaris.c \ - mgt/mgt_main.c \ - mgt/mgt_param.c \ - mgt/mgt_param_tbl.c \ - mgt/mgt_param_bits.c \ - mgt/mgt_param_tcp.c \ - mgt/mgt_param_tweak.c \ - mgt/mgt_pool.c \ - mgt/mgt_shmem.c \ - mgt/mgt_vcc.c \ - mgt/mgt_vcl.c \ - proxy/cache_proxy_proto.c \ - storage/stevedore.c \ - storage/mgt_stevedore.c \ - storage/stevedore_utils.c \ - storage/storage_file.c \ - storage/storage_malloc.c \ - storage/storage_persistent.c \ - storage/mgt_storage_persistent.c \ - storage/storage_persistent_silo.c \ - storage/storage_persistent_subr.c \ - storage/storage_umem.c \ - waiter/mgt_waiter.c \ - waiter/cache_waiter.c \ - waiter/cache_waiter_epoll.c \ - waiter/cache_waiter_kqueue.c \ - waiter/cache_waiter_poll.c \ - waiter/cache_waiter_ports.c - -noinst_HEADERS = \ - builtin_vcl.h \ - cache/cache_esi.h \ - cache/cache_pool.h \ - cache/cache_priv.h \ - common/heritage.h \ - hash/hash_slinger.h \ - http1/cache_http1.h \ - mgt/mgt.h \ - mgt/mgt_cli.h \ - mgt/mgt_param.h \ - storage/storage.h \ - storage/storage_persistent.h \ - waiter/waiter_priv.h \ - waiter/mgt_waiter.h +sbin_PROGRAMS += bin/varnishd/varnishd + +bin_varnishd_varnishd_SOURCES = \ + bin/varnishd/cache/cache_acceptor.c \ + bin/varnishd/cache/cache_backend.c \ + bin/varnishd/cache/cache_backend_cfg.c \ + bin/varnishd/cache/cache_backend_probe.c \ + bin/varnishd/cache/cache_backend_tcp.c \ + bin/varnishd/cache/cache_ban.c \ + bin/varnishd/cache/cache_busyobj.c \ + bin/varnishd/cache/cache_cli.c \ + bin/varnishd/cache/cache_deliver_proc.c \ + bin/varnishd/cache/cache_director.c \ + bin/varnishd/cache/cache_esi_deliver.c \ + bin/varnishd/cache/cache_esi_fetch.c \ + bin/varnishd/cache/cache_esi_parse.c \ + bin/varnishd/cache/cache_expire.c \ + bin/varnishd/cache/cache_fetch.c \ + bin/varnishd/cache/cache_fetch_proc.c \ + bin/varnishd/cache/cache_gzip.c \ + bin/varnishd/cache/cache_hash.c \ + bin/varnishd/cache/cache_http.c \ + bin/varnishd/cache/cache_lck.c \ + bin/varnishd/cache/cache_main.c \ + bin/varnishd/cache/cache_mempool.c \ + bin/varnishd/cache/cache_obj.c \ + bin/varnishd/cache/cache_panic.c \ + bin/varnishd/cache/cache_pool.c \ + bin/varnishd/cache/cache_req.c \ + bin/varnishd/cache/cache_req_body.c \ + bin/varnishd/cache/cache_req_fsm.c \ + bin/varnishd/cache/cache_rfc2616.c \ + bin/varnishd/cache/cache_range.c \ + bin/varnishd/cache/cache_session.c \ + bin/varnishd/cache/cache_shmlog.c \ + bin/varnishd/cache/cache_vary.c \ + bin/varnishd/cache/cache_vcl.c \ + bin/varnishd/cache/cache_vrt.c \ + bin/varnishd/cache/cache_vrt_priv.c \ + bin/varnishd/cache/cache_vrt_re.c \ + bin/varnishd/cache/cache_vrt_var.c \ + bin/varnishd/cache/cache_vrt_vmod.c \ + bin/varnishd/cache/cache_wrk.c \ + bin/varnishd/cache/cache_ws.c \ + bin/varnishd/common/common_vsm.c \ + bin/varnishd/common/common_vsc.c \ + bin/varnishd/hash/hash_classic.c \ + bin/varnishd/hash/hash_critbit.c \ + bin/varnishd/hash/mgt_hash.c \ + bin/varnishd/hash/hash_simple_list.c \ + bin/varnishd/http1/cache_http1_deliver.c \ + bin/varnishd/http1/cache_http1_fetch.c \ + bin/varnishd/http1/cache_http1_fsm.c \ + bin/varnishd/http1/cache_http1_line.c \ + bin/varnishd/http1/cache_http1_pipe.c \ + bin/varnishd/http1/cache_http1_proto.c \ + bin/varnishd/http1/cache_http1_vfp.c \ + bin/varnishd/mgt/mgt_acceptor.c \ + bin/varnishd/mgt/mgt_child.c \ + bin/varnishd/mgt/mgt_cli.c \ + bin/varnishd/mgt/mgt_jail.c \ + bin/varnishd/mgt/mgt_jail_unix.c \ + bin/varnishd/mgt/mgt_jail_solaris.c \ + bin/varnishd/mgt/mgt_main.c \ + bin/varnishd/mgt/mgt_param.c \ + bin/varnishd/mgt/mgt_param_tbl.c \ + bin/varnishd/mgt/mgt_param_bits.c \ + bin/varnishd/mgt/mgt_param_tcp.c \ + bin/varnishd/mgt/mgt_param_tweak.c \ + bin/varnishd/mgt/mgt_pool.c \ + bin/varnishd/mgt/mgt_shmem.c \ + bin/varnishd/mgt/mgt_vcc.c \ + bin/varnishd/mgt/mgt_vcl.c \ + bin/varnishd/proxy/cache_proxy_proto.c \ + bin/varnishd/storage/stevedore.c \ + bin/varnishd/storage/mgt_stevedore.c \ + bin/varnishd/storage/stevedore_utils.c \ + bin/varnishd/storage/storage_file.c \ + bin/varnishd/storage/storage_malloc.c \ + bin/varnishd/storage/storage_persistent.c \ + bin/varnishd/storage/mgt_storage_persistent.c \ + bin/varnishd/storage/storage_persistent_silo.c \ + bin/varnishd/storage/storage_persistent_subr.c \ + bin/varnishd/storage/storage_umem.c \ + bin/varnishd/waiter/mgt_waiter.c \ + bin/varnishd/waiter/cache_waiter.c \ + bin/varnishd/waiter/cache_waiter_epoll.c \ + bin/varnishd/waiter/cache_waiter_kqueue.c \ + bin/varnishd/waiter/cache_waiter_poll.c \ + bin/varnishd/waiter/cache_waiter_ports.c + +noinst_HEADERS += \ + bin/varnishd/builtin_vcl.h \ + bin/varnishd/cache/cache_esi.h \ + bin/varnishd/cache/cache_pool.h \ + bin/varnishd/cache/cache_priv.h \ + bin/varnishd/common/heritage.h \ + bin/varnishd/hash/hash_slinger.h \ + bin/varnishd/http1/cache_http1.h \ + bin/varnishd/mgt/mgt.h \ + bin/varnishd/mgt/mgt_cli.h \ + bin/varnishd/mgt/mgt_param.h \ + bin/varnishd/storage/storage.h \ + bin/varnishd/storage/storage_persistent.h \ + bin/varnishd/waiter/waiter_priv.h \ + bin/varnishd/waiter/mgt_waiter.h # Headers for use with vmods -nobase_pkginclude_HEADERS = \ - cache/cache.h \ - cache/cache_filter.h \ - cache/cache_backend.h \ - cache/cache_director.h \ - common/common.h \ - common/params.h \ - waiter/waiter.h - -varnishd_CFLAGS = \ +public_varnishd_headers = \ + bin/varnishd/cache/cache.h \ + bin/varnishd/cache/cache_filter.h \ + bin/varnishd/cache/cache_backend.h \ + bin/varnishd/cache/cache_director.h \ + bin/varnishd/common/common.h \ + bin/varnishd/common/params.h \ + bin/varnishd/waiter/waiter.h + +# This saddens me, but nobase will strip the path completely +# and we want to change 'bin/varnishd/' to 'varnish/cache/' +# XXX one mkdir per file is wasteful, but we won't risk +# forgetting subdirs +install-data-local: install-public-varnishd-headers +install-public-varnishd-headers: + for i in $(public_varnishd_headers); do \ + h_dir="$$(dirname $(DESTDIR)$(includedir)/varnish`echo $$i |sed s at bin /varnishd@@`)"; \ + $(install_sh) -d -m 0755 $$h_dir; \ + $(INSTALL_HEADER) $(srcdir)/$$i $$h_dir; \ + done + +# chmod +w $$(dirname $(includedir)/`echo $$i | +# sed s at bin/varnishd at varnish@`); +uninstall-hook: uninstall-public-varnishd-headers +uninstall-public-varnishd-headers : + for i in $(public_varnishd_headers); do \ + rm -f $(DESTDIR)$(includedir)/`echo $$i | \ + sed s at bin/varnishd at varnish@`; \ + done + +.PHONY: install-public-varnishd-headers uninstall-public-varnishd-headers + +EXTRA_DIST += $(public_varnishd_headers) + +bin_varnishd_varnishd_CFLAGS = \ @PCRE_CFLAGS@ \ -DVARNISHD_IS_NOT_A_VMOD \ -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"' \ -DVARNISH_VMOD_DIR='"${pkglibdir}/vmods"' \ -DVARNISH_VCL_DIR='"${varnishconfdir}"' -varnishd_LDFLAGS = -export-dynamic +bin_varnishd_varnishd_LDFLAGS = -export-dynamic -varnishd_LDADD = \ +bin_varnishd_varnishd_LDADD = \ $(top_builddir)/lib/libvarnish/libvarnish.la \ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvcc/libvcc.la \ @@ -141,13 +167,15 @@ varnishd_LDADD = \ @PCRE_LIBS@ \ ${DL_LIBS} ${PTHREAD_LIBS} ${NET_LIBS} ${LIBM} ${LIBUMEM} -EXTRA_DIST = builtin.vcl -DISTCLEANFILES = builtin_vcl.h +$(bin_varnishd_varnishd_OBJECTS) : include/tbl/vcl_returns.h + +EXTRA_DIST += bin/varnishd/builtin.vcl +DISTCLEANFILES += bin/varnishd/builtin_vcl.h # # Turn the builtin.vcl file into a C-string we can include in the program. # -builtin_vcl.h: builtin.vcl +bin/varnishd/builtin_vcl.h: bin/varnishd/builtin.vcl echo '/*' > $@ echo ' * NB: This file is machine generated, DO NOT EDIT!' >> $@ echo ' *' >> $@ @@ -157,7 +185,7 @@ builtin_vcl.h: builtin.vcl echo '' >> $@ sed -e 's/"/\\"/g' \ -e 's/$$/\\n"/' \ - -e 's/^/ "/' $(srcdir)/builtin.vcl >> $@ + -e 's/^/ "/' $(srcdir)/bin/varnishd/builtin.vcl >> $@ # Explicitly record dependency -mgt/mgt_vcc.c: builtin_vcl.h +bin/varnishd/mgt/mgt_vcc.c: bin/varnishd/builtin_vcl.h diff --git a/bin/varnishhist/Makefile.am b/bin/varnishhist/Makefile.am index 5904430..eeaa1a2 100644 --- a/bin/varnishhist/Makefile.am +++ b/bin/varnishhist/Makefile.am @@ -1,29 +1,36 @@ # -AM_CPPFLAGS = \ +bin_varnishhist_varnishhist_CPPFLAGS = \ -I$(top_srcdir)/include \ + -I$(top_srcdir)/bin/varnishhist/ \ -I$(top_builddir)/include -bin_PROGRAMS = varnishhist +bin_PROGRAMS += bin/varnishhist/varnishhist -varnishhist_SOURCES = varnishhist.c \ - varnishhist_options.h \ - varnishhist_options.c \ - $(top_srcdir)/lib/libvarnish/vas.c \ - $(top_srcdir)/lib/libvarnish/version.c \ - $(top_srcdir)/lib/libvarnish/vpf.c \ - $(top_srcdir)/lib/libvarnish/vtim.c \ - $(top_srcdir)/lib/libvarnish/flopen.c \ - $(top_srcdir)/lib/libvarnishtools/vut.c +bin_varnishhist_varnishhist_SOURCES = bin/varnishhist/varnishhist.c \ + bin/varnishhist/varnishhist_options.h \ + bin/varnishhist/varnishhist_options.c \ + lib/libvarnish/vas.c \ + lib/libvarnish/version.c \ + lib/libvarnish/vpf.c \ + lib/libvarnish/vtim.c \ + lib/libvarnish/flopen.c \ + lib/libvarnishtools/vut.c -varnishhist_LDADD = \ +bin_varnishhist_varnishhist_LDADD = \ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ -lm \ @CURSES_LIB@ ${RT_LIBS} ${PTHREAD_LIBS} -noinst_PROGRAMS = varnishhist_opt2rst -varnishhist_opt2rst_SOURCES = \ - varnishhist_options.h \ - varnishhist_options.c \ - $(top_srcdir)/lib/libvarnishtools/opt2rst.c +noinst_PROGRAMS += bin/varnishhist/varnishhist_opt2rst + +bin_varnishhist_varnishhist_opt2rst_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/bin/varnishhist/ \ + -I$(top_builddir)/include + +bin_varnishhist_varnishhist_opt2rst_SOURCES = \ + bin/varnishhist/varnishhist_options.h \ + bin/varnishhist/varnishhist_options.c \ + lib/libvarnishtools/opt2rst.c diff --git a/bin/varnishlog/Makefile.am b/bin/varnishlog/Makefile.am index 2df9415..4e04540 100644 --- a/bin/varnishlog/Makefile.am +++ b/bin/varnishlog/Makefile.am @@ -1,30 +1,37 @@ # -AM_CPPFLAGS = \ +bin_varnishlog_varnishlog_CPPFLAGS = \ -I$(top_srcdir)/include \ + -I$(top_srcdir)/bin/varnishlog \ -I$(top_builddir)/include -bin_PROGRAMS = varnishlog +bin_PROGRAMS += bin/varnishlog/varnishlog -varnishlog_SOURCES = \ - varnishlog.c \ - varnishlog_options.h \ - varnishlog_options.c \ - $(top_srcdir)/lib/libvarnishtools/vut.c \ - $(top_srcdir)/lib/libvarnish/vas.c \ - $(top_srcdir)/lib/libvarnish/flopen.c \ - $(top_srcdir)/lib/libvarnish/version.c \ - $(top_srcdir)/lib/libvarnish/vsb.c \ - $(top_srcdir)/lib/libvarnish/vpf.c \ - $(top_srcdir)/lib/libvarnish/vtim.c +bin_varnishlog_varnishlog_SOURCES = \ + bin/varnishlog/varnishlog.c \ + bin/varnishlog/varnishlog_options.h \ + bin/varnishlog/varnishlog_options.c \ + lib/libvarnishtools/vut.c \ + lib/libvarnish/vas.c \ + lib/libvarnish/flopen.c \ + lib/libvarnish/version.c \ + lib/libvarnish/vsb.c \ + lib/libvarnish/vpf.c \ + lib/libvarnish/vtim.c -varnishlog_LDADD = \ +bin_varnishlog_varnishlog_LDADD = \ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS} -noinst_PROGRAMS = varnishlog_opt2rst -varnishlog_opt2rst_SOURCES = \ - varnishlog_options.h \ - varnishlog_options.c \ - $(top_srcdir)/lib/libvarnishtools/opt2rst.c +noinst_PROGRAMS += bin/varnishlog/varnishlog_opt2rst + +bin_varnishlog_varnishlog_opt2rst_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/bin/varnishlog \ + -I$(top_builddir)/include + +bin_varnishlog_varnishlog_opt2rst_SOURCES = \ + bin/varnishlog/varnishlog_options.h \ + bin/varnishlog/varnishlog_options.c \ + lib/libvarnishtools/opt2rst.c diff --git a/bin/varnishncsa/Makefile.am b/bin/varnishncsa/Makefile.am index d63df61..c8f7925 100644 --- a/bin/varnishncsa/Makefile.am +++ b/bin/varnishncsa/Makefile.am @@ -1,32 +1,39 @@ # -AM_CPPFLAGS = \ +bin_varnishncsa_varnishncsa_CPPFLAGS = \ -I$(top_srcdir)/include \ + -I$(top_srcdir)/bin/varnishncsa \ -I$(top_builddir)/include -bin_PROGRAMS = varnishncsa +bin_PROGRAMS += bin/varnishncsa/varnishncsa -varnishncsa_SOURCES = \ - varnishncsa.c \ - varnishncsa_options.h \ - varnishncsa_options.c \ - base64.h \ - base64.c \ - $(top_srcdir)/lib/libvarnishtools/vut.c \ - $(top_srcdir)/lib/libvarnish/vas.c \ - $(top_srcdir)/lib/libvarnish/flopen.c \ - $(top_srcdir)/lib/libvarnish/version.c \ - $(top_srcdir)/lib/libvarnish/vpf.c \ - $(top_srcdir)/lib/libvarnish/vtim.c \ - $(top_srcdir)/lib/libvarnish/vsb.c +bin_varnishncsa_varnishncsa_SOURCES = \ + bin/varnishncsa/varnishncsa.c \ + bin/varnishncsa/varnishncsa_options.h \ + bin/varnishncsa/varnishncsa_options.c \ + bin/varnishncsa/base64.h \ + bin/varnishncsa/base64.c \ + lib/libvarnishtools/vut.c \ + lib/libvarnish/vas.c \ + lib/libvarnish/flopen.c \ + lib/libvarnish/version.c \ + lib/libvarnish/vpf.c \ + lib/libvarnish/vtim.c \ + lib/libvarnish/vsb.c -varnishncsa_LDADD = \ - $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ - $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ +bin_varnishncsa_varnishncsa_LDADD = \ + lib/libvarnishcompat/libvarnishcompat.la \ + lib/libvarnishapi/libvarnishapi.la \ ${RT_LIBS} ${LIBM} -noinst_PROGRAMS = varnishncsa_opt2rst -varnishncsa_opt2rst_SOURCES = \ - varnishncsa_options.h \ - varnishncsa_options.c \ - $(top_srcdir)/lib/libvarnishtools/opt2rst.c +noinst_PROGRAMS += bin/varnishncsa/varnishncsa_opt2rst + +bin_varnishncsa_varnishncsa_opt2rst_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/bin/varnishncsa \ + -I$(top_builddir)/include + +bin_varnishncsa_varnishncsa_opt2rst_SOURCES = \ + bin/varnishncsa/varnishncsa_options.h \ + bin/varnishncsa/varnishncsa_options.c \ + lib/libvarnishtools/opt2rst.c diff --git a/bin/varnishreplay/Makefile.am b/bin/varnishreplay/Makefile.am index 38d1c30..4610bc5 100644 --- a/bin/varnishreplay/Makefile.am +++ b/bin/varnishreplay/Makefile.am @@ -1,18 +1,18 @@ # -AM_CPPFLAGS = \ +bin_varnishreplay_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include -bin_PROGRAMS = varnishreplay +bin_PROGRAMS += bin/varnishreplay/varnishreplay -varnishreplay_SOURCES = \ +bin_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 = \ +bin_varnishreplay_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/varnishstat/Makefile.am b/bin/varnishstat/Makefile.am index 664131d..891569f 100644 --- a/bin/varnishstat/Makefile.am +++ b/bin/varnishstat/Makefile.am @@ -1,21 +1,21 @@ # -AM_CPPFLAGS = \ +bin_varnishstat_varnishstat_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include -bin_PROGRAMS = varnishstat +bin_PROGRAMS += bin/varnishstat/varnishstat -varnishstat_SOURCES = \ - varnishstat.h \ +bin_varnishstat_varnishstat_SOURCES = \ + bin/varnishstat/varnishstat.h \ \ - varnishstat.c \ - varnishstat_curses.c \ - $(top_srcdir)/lib/libvarnish/vas.c \ - $(top_srcdir)/lib/libvarnish/version.c \ - $(top_srcdir)/lib/libvarnish/vtim.c + bin/varnishstat/varnishstat.c \ + bin/varnishstat/varnishstat_curses.c \ + lib/libvarnish/vas.c \ + lib/libvarnish/version.c \ + lib/libvarnish/vtim.c -varnishstat_LDADD = \ +bin_varnishstat_varnishstat_LDADD = \ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ @CURSES_LIB@ ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS} diff --git a/bin/varnishtest/Makefile.am b/bin/varnishtest/Makefile.am index 2506a8a..58a48d3 100644 --- a/bin/varnishtest/Makefile.am +++ b/bin/varnishtest/Makefile.am @@ -1,51 +1,50 @@ # -VTC_LOG_COMPILER = ./varnishtest -v -i +VTC_LOG_COMPILER = bin/varnishtest/varnishtest -v -i TEST_EXTENSIONS = .vtc TESTS = @VTC_TESTS@ -# Make sure we run check-local first -check: check-am check-local -check-am: check-local +check: lib/libvmod_debug/libvmod_debug.la verify-tests-list # See if list of checks have changed, recheck -check-local: - if [ "$$(cd $(srcdir) && echo tests/*.vtc)" != "@VTC_TESTS@" ]; then \ - cd $(top_builddir) && ./config.status --recheck ; \ +verify-tests-list : + if [ "$$(cd $(top_srcdir) && echo bin/varnishtest/tests/*.vtc)" != "@VTC_TESTS@" ]; then \ + ./config.status --recheck ; \ fi -DISTCLEANFILES = _.ok +DISTCLEANFILES += bin/varnishtest/_.ok -AM_CPPFLAGS = \ + +bin_varnishtest_varnishtest_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ -I$(top_srcdir)/lib/libvgz -bin_PROGRAMS = varnishtest - -varnishtest_SOURCES = \ - vtc.c \ - vtc.h \ - vmods.h \ - programs.h \ - vtc_client.c \ - vtc_http.c \ - vtc_main.c \ - vtc_log.c \ - vtc_sema.c \ - vtc_server.c \ - vtc_varnish.c \ - vtc_logexp.c \ - vtc_process.c - -varnishtest_LDADD = \ +bin_PROGRAMS += bin/varnishtest/varnishtest + +bin_varnishtest_varnishtest_SOURCES = \ + bin/varnishtest/vtc.c \ + bin/varnishtest/vtc.h \ + bin/varnishtest/vmods.h \ + bin/varnishtest/programs.h \ + bin/varnishtest/vtc_client.c \ + bin/varnishtest/vtc_http.c \ + bin/varnishtest/vtc_main.c \ + bin/varnishtest/vtc_log.c \ + bin/varnishtest/vtc_sema.c \ + bin/varnishtest/vtc_server.c \ + bin/varnishtest/vtc_varnish.c \ + bin/varnishtest/vtc_logexp.c \ + bin/varnishtest/vtc_process.c + +bin_varnishtest_varnishtest_LDADD = \ $(top_builddir)/lib/libvarnish/libvarnish.la \ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ $(top_builddir)/lib/libvgz/libvgz.la \ ${LIBM} ${PTHREAD_LIBS} -varnishtest_CFLAGS = \ +bin_varnishtest_varnishtest_CFLAGS = \ -DTOP_BUILDDIR='"${top_builddir}"' -EXTRA_DIST = $(top_srcdir)/bin/varnishtest/tests/*.vtc \ +EXTRA_DIST += @VTC_TESTS@ \ $(top_srcdir)/bin/varnishtest/tests/README diff --git a/bin/varnishtop/Makefile.am b/bin/varnishtop/Makefile.am index f48e972..82d3d6c 100644 --- a/bin/varnishtop/Makefile.am +++ b/bin/varnishtop/Makefile.am @@ -1,30 +1,35 @@ # -AM_CPPFLAGS = \ +bin_varnishtop_varnishtop_CPPFLAGS = \ -I$(top_srcdir)/include \ + -I$(top_srcdir)/bin/varnishtop \ -I$(top_builddir)/include -bin_PROGRAMS = varnishtop +bin_PROGRAMS += bin/varnishtop/varnishtop -varnishtop_SOURCES = varnishtop.c \ - varnishtop_options.h \ - varnishtop_options.c \ - $(top_srcdir)/lib/libvarnishtools/vut.c \ - $(top_srcdir)/lib/libvarnish/vas.c \ - $(top_srcdir)/lib/libvarnish/flopen.c \ - $(top_srcdir)/lib/libvarnish/version.c \ - $(top_srcdir)/lib/libvarnish/vpf.c \ - $(top_srcdir)/lib/libvarnish/vtim.c \ - $(top_srcdir)/lib/libvarnish/vsb.c +bin_varnishtop_varnishtop_SOURCES = bin/varnishtop/varnishtop.c \ + bin/varnishtop/varnishtop_options.h \ + bin/varnishtop/varnishtop_options.c \ + lib/libvarnishtools/vut.c \ + lib/libvarnish/vas.c \ + lib/libvarnish/flopen.c \ + lib/libvarnish/version.c \ + lib/libvarnish/vpf.c \ + lib/libvarnish/vtim.c \ + lib/libvarnish/vsb.c - -varnishtop_LDADD = \ +bin_varnishtop_varnishtop_LDADD = \ $(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \ $(top_builddir)/lib/libvarnishapi/libvarnishapi.la \ @CURSES_LIB@ ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS} -noinst_PROGRAMS = varnishtop_opt2rst -varnishtop_opt2rst_SOURCES = \ - varnishtop_options.h \ - varnishtop_options.c \ - $(top_srcdir)/lib/libvarnishtools/opt2rst.c +noinst_PROGRAMS += bin/varnishtop/varnishtop_opt2rst +bin_varnishtop_varnishtop_opt2rst_SOURCES = \ + bin/varnishtop/varnishtop_options.h \ + bin/varnishtop/varnishtop_options.c \ + lib/libvarnishtools/opt2rst.c + +bin_varnishtop_varnishtop_opt2rst_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/bin/varnishtop \ + -I$(top_builddir)/include \ No newline at end of file diff --git a/configure.ac b/configure.ac index 48af690..7eb57b5 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ AC_CANONICAL_SYSTEM AC_LANG(C) AM_MAINTAINER_MODE([disable]) -AM_INIT_AUTOMAKE([1.11 foreign color-tests parallel-tests]) +AM_INIT_AUTOMAKE([1.11 foreign color-tests parallel-tests subdir-objects]) AM_SILENT_RULES([yes]) AC_DISABLE_STATIC AC_PROG_LIBTOOL @@ -623,7 +623,7 @@ if test "$enable_pcre_jit" = yes; then fi # Stupid automake needs this -VTC_TESTS="$(cd $srcdir/bin/varnishtest && echo tests/*.vtc)" +VTC_TESTS="$(cd ${srcdir} && echo bin/varnishtest/tests/*.vtc)" AC_SUBST(VTC_TESTS) # Make sure this include dir exists @@ -632,32 +632,7 @@ AC_CONFIG_COMMANDS([mkdir], [$MKDIR_P doc/sphinx/include]) # Generate output AC_CONFIG_FILES([ Makefile - bin/Makefile - bin/varnishadm/Makefile - bin/varnishd/Makefile - bin/varnishlog/Makefile - bin/varnishstat/Makefile - bin/varnishtop/Makefile - bin/varnishhist/Makefile - bin/varnishtest/Makefile - bin/varnishncsa/Makefile - doc/Makefile - doc/graphviz/Makefile - doc/sphinx/Makefile doc/sphinx/conf.py - etc/Makefile - include/Makefile - lib/Makefile - lib/libvarnish/Makefile - lib/libvarnishapi/Makefile - lib/libvarnishtools/Makefile - lib/libvarnishcompat/Makefile - lib/libvcc/Makefile - lib/libvgz/Makefile - lib/libvmod_debug/Makefile - lib/libvmod_std/Makefile - lib/libvmod_directors/Makefile - man/Makefile varnishapi.pc varnishapi-uninstalled.pc ]) diff --git a/doc/Makefile.am b/doc/Makefile.am index e420a99..1279135 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,10 +1,8 @@ # # -RST2ANY_FLAGS = --halt=2 +EXTRA_DIST += doc/changes.rst doc/changes.html -EXTRA_DIST = changes.rst changes.html - -changes.html: changes.rst +doc/changes.html: doc/changes.rst if HAVE_RST2HTML ${RST2HTML} ${RST2ANY_FLAGS} $? $@ else @@ -13,6 +11,3 @@ else @echo "========================================" @false endif - -# build graphviz before sphinx, so sphinx docs can use svg output -SUBDIRS = graphviz sphinx diff --git a/doc/graphviz/Makefile.am b/doc/graphviz/Makefile.am index acbe4fe..fc5b685 100644 --- a/doc/graphviz/Makefile.am +++ b/doc/graphviz/Makefile.am @@ -2,38 +2,32 @@ # for an out-of-tree build, sphinx needs the output in builddir # XXX is there a better way to do this? +# .PHONY is required as VPATH will happily register the files in +# buildi -.PHONY: link_srcdir - -link_srcdir: - if test "x$(srcdir)" != "x$(builddir)" && \ - test ! -f $(builddir)/cache_http1_fsm.svg ; then \ - d=`pwd`/$(builddir) ; \ - cd $(srcdir) && find . -name \*.svg -type f | \ - cpio -ldmp $${d} ; \ - fi - -dist-hook: - $(MAKE) html +dist: html # You can set these variables from the command line. # this is a4, letter is 8.5,11 SIZE = 8.4,11.7 -EXTRA_DIST = $(srcdir)/*.dot +EXTRA_DIST += \ + doc/graphviz/cache_http1_fsm.dot \ + doc/graphviz/cache_req_fsm.dot \ + doc/graphviz/cache_fetch.dot if HAVE_DOT PDFS = \ - cache_http1_fsm.pdf \ - cache_req_fsm.pdf \ - cache_fetch.pdf + doc/graphviz/cache_http1_fsm.pdf \ + doc/graphviz/cache_req_fsm.pdf \ + doc/graphviz/cache_fetch.pdf SVGS = \ - cache_http1_fsm.svg \ - cache_req_fsm.svg \ - cache_fetch.svg + doc/graphviz/cache_http1_fsm.svg \ + doc/graphviz/cache_req_fsm.svg \ + doc/graphviz/cache_fetch.svg -CLEANFILES = \ +CLEANFILES += \ $(PDFS) \ $(SVGS) endif @@ -46,7 +40,7 @@ if ! HAVE_DOT @false endif -html: $(SVGS) link_srcdir +graphviz: $(SVGS) if ! HAVE_DOT @echo =================================================== @echo You need graphviz installed to generate html output @@ -55,11 +49,14 @@ if ! HAVE_DOT endif # XXX does not fit onto a4 unless in landscape -cache_fetch.pdf: cache_fetch.dot +doc/graphviz/cache_fetch.pdf: doc/graphviz/cache_fetch.dot + mkdir -p $(top_builddir)/doc/graphviz @DOT@ -Tpdf -Gsize=$(SIZE) -Grotate=90 $< >$@ %.pdf: %.dot + mkdir -p $(top_builddir)/doc/graphviz @DOT@ -Tpdf -Gsize=$(SIZE) $< >$@ %.svg: %.dot + mkdir -p $(top_builddir)/doc/graphviz @DOT@ -Tsvg $< >$@ diff --git a/doc/sphinx/Makefile.am b/doc/sphinx/Makefile.am index 6d71c14..01114cb 100644 --- a/doc/sphinx/Makefile.am +++ b/doc/sphinx/Makefile.am @@ -5,12 +5,12 @@ SPHINXOPTS = SPHINXBUILD = sphinx-build -W -q -N PAPER = a4 -BUILDDIR = build +BUILDDIR = $(builddir)/doc/sphinx/build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(builddir) +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(builddir)/doc/sphinx .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest @@ -27,23 +27,18 @@ help: @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" -clean: - -rm -rf $(BUILDDIR)/* +clean-local: sphinx-clean # use index.rst as an indicator if we have copied already .PHONY: link_srcdir link_srcdir: if test "x$(srcdir)" != "x$(builddir)" && test ! -f index.rst ; then \ - d=`pwd`/$(builddir) ; \ - cd $(srcdir) && find . -type f | cpio -ldmp $${d} ; \ + d=`pwd`/$(builddir)/doc/sphinx ; \ + cd $(srcdir)/doc/sphinx/ && find . -type f | cpio -ldmp $${d} ; \ + chmod -R +w $${d} ;\ fi -# work around for make html called within doc/sphinx -.PHONY: graphviz -graphviz: - cd ../graphviz && $(MAKE) html - -sphinx_prereq: link_srcdir graphviz conf.py +sphinx_prereq: link_srcdir graphviz doc/sphinx/conf.py html: sphinx_prereq $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @@ -103,71 +98,100 @@ doctest: sphinx_prereq @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." -EXTRA_DIST = \ - conf.py \ - index.rst \ - include \ - glossary \ - installation \ - phk \ - tutorial \ - users-guide \ - whats-new - -dist-hook: - $(MAKE) html +EXTRA_DIST += \ + doc/sphinx/conf.py \ + doc/sphinx/index.rst \ + doc/sphinx/include \ + doc/sphinx/glossary \ + doc/sphinx/installation \ + doc/sphinx/phk \ + doc/sphinx/tutorial \ + doc/sphinx/users-guide \ + doc/sphinx/whats-new + +dist-hook: sphinx-dist +.PHONY: sphinx-dist +sphinx-dist: rm -rf $(BUILDDIR)/doctrees - cp -r $(BUILDDIR)/html $(distdir)/../ + cp -r $(BUILDDIR)/html $(distdir)/doc/html -distclean-local: +distclean-local: sphinx-clean +sphinx-clean: rm -rf $(BUILDDIR) -include/params.rst: $(top_builddir)/bin/varnishd/varnishd - $(top_builddir)/bin/varnishd/varnishd -x dumprstparam > include/params.rst -BUILT_SOURCES = include/params.rst +doc/sphinx/include: + test -d $@ || mkdir -m0755 $@ + +SPHINXFIRSTS = $(top_builddir)/lib/libvarnishapi/vsl-tags.rst + +$(top_builddir)/doc/sphinx/include/params.rst: $(top_builddir)/bin/varnishd/varnishd $(top_builddir)/doc/sphinx/include + $(top_builddir)/bin/varnishd/varnishd -x dumprstparam > $@ +SPHINXFIRSTS += $(top_builddir)/doc/sphinx/include/params.rst # XXX add varnishstat here when it's been _opt2rst'ed -include/varnishncsa_options.rst: $(top_builddir)/bin/varnishncsa/varnishncsa_opt2rst +$(top_builddir)/doc/sphinx/include/varnishncsa_options.rst: $(top_builddir)/bin/varnishncsa/varnishncsa_opt2rst $(top_builddir)/bin/varnishncsa/varnishncsa_opt2rst options > $@ -include/varnishncsa_synopsis.rst: $(top_builddir)/bin/varnishncsa/varnishncsa_opt2rst +$(top_builddir)/doc/sphinx/include/varnishncsa_synopsis.rst: $(top_builddir)/bin/varnishncsa/varnishncsa_opt2rst $(top_builddir)/bin/varnishncsa/varnishncsa_opt2rst synopsis > $@ -BUILT_SOURCES += include/varnishncsa_options.rst \ - include/varnishncsa_synopsis.rst +SPHINXFIRSTS += $(top_builddir)/doc/sphinx/include/varnishncsa_options.rst \ + $(top_builddir)/doc/sphinx/include/varnishncsa_synopsis.rst -include/varnishlog_options.rst: $(top_builddir)/bin/varnishlog/varnishlog_opt2rst +$(top_builddir)/doc/sphinx/include/varnishlog_options.rst: $(top_builddir)/bin/varnishlog/varnishlog_opt2rst $(top_builddir)/bin/varnishlog/varnishlog_opt2rst options > $@ -include/varnishlog_synopsis.rst: $(top_builddir)/bin/varnishlog/varnishlog_opt2rst +$(top_builddir)/doc/sphinx/include/varnishlog_synopsis.rst: $(top_builddir)/bin/varnishlog/varnishlog_opt2rst $(top_builddir)/bin/varnishlog/varnishlog_opt2rst synopsis > $@ -BUILT_SOURCES += include/varnishlog_options.rst \ - include/varnishlog_synopsis.rst +SPHINXFIRSTS += $(top_builddir)/doc/sphinx/include/varnishlog_options.rst \ + $(top_builddir)/doc/sphinx/include/varnishlog_synopsis.rst -include/varnishtop_options.rst: $(top_builddir)/bin/varnishtop/varnishtop_opt2rst +$(top_builddir)/doc/sphinx/include/varnishtop_options.rst: $(top_builddir)/bin/varnishtop/varnishtop_opt2rst $(top_builddir)/bin/varnishtop/varnishtop_opt2rst options > $@ -include/varnishtop_synopsis.rst: $(top_builddir)/bin/varnishtop/varnishtop_opt2rst +$(top_builddir)/doc/sphinx/include/varnishtop_synopsis.rst: $(top_builddir)/bin/varnishtop/varnishtop_opt2rst $(top_builddir)/bin/varnishtop/varnishtop_opt2rst synopsis > $@ -BUILT_SOURCES += include/varnishtop_options.rst \ - include/varnishtop_synopsis.rst +SPHINXFIRSTS += $(top_builddir)/doc/sphinx/include/varnishtop_options.rst \ + $(top_builddir)/doc/sphinx/include/varnishtop_synopsis.rst -include/varnishhist_options.rst: $(top_builddir)/bin/varnishhist/varnishhist_opt2rst +$(top_builddir)/doc/sphinx/include/varnishhist_options.rst: $(top_builddir)/bin/varnishhist/varnishhist_opt2rst $(top_builddir)/bin/varnishhist/varnishhist_opt2rst options > $@ -include/varnishhist_synopsis.rst: $(top_builddir)/bin/varnishhist/varnishhist_opt2rst +$(top_builddir)/doc/sphinx/include/varnishhist_synopsis.rst: $(top_builddir)/bin/varnishhist/varnishhist_opt2rst $(top_builddir)/bin/varnishhist/varnishhist_opt2rst synopsis > $@ -BUILT_SOURCES += include/varnishhist_options.rst \ - include/varnishhist_synopsis.rst - -.PHONY: reference -reference: - test -d $@ || mkdir $@ -BUILT_SOURCES += reference - -reference/vmod_std.generated.rst: reference $(top_builddir)/lib/libvmod_std/vmod_std.rst - cp $(top_builddir)/lib/libvmod_std/vmod_std.rst $@ -BUILT_SOURCES += reference/vmod_std.generated.rst - -reference/vmod_directors.generated.rst: reference $(top_builddir)/lib/libvmod_directors/vmod_directors.rst - cp $(top_builddir)/lib/libvmod_directors/vmod_directors.rst $@ -BUILT_SOURCES += reference/vmod_directors.generated.rst - -EXTRA_DIST += $(BUILT_SOURCES) -MAINTAINERCLEANFILES = $(EXTRA_DIST) +SPHINXFIRSTS += $(top_builddir)/doc/sphinx/include/varnishhist_options.rst \ + $(top_builddir)/doc/sphinx/include/varnishhist_synopsis.rst + +$(top_builddir)/doc/sphinx/reference/vmod_std.generated.rst: \ + $(top_builddir)/lib/libvmod_std/vmod_std.rst + mkdir -p $(top_builddir)/doc/sphinx/reference + cp -f $(top_builddir)/lib/libvmod_std/vmod_std.rst $@ +SPHINXFIRSTS += $(top_builddir)/doc/sphinx/reference/vmod_std.generated.rst + +$(top_builddir)/doc/sphinx/reference/vmod_directors.generated.rst: \ + $(top_builddir)/lib/libvmod_directors/vmod_directors.rst + mkdir -p $(top_builddir)/doc/sphinx/reference + cp -f $(top_builddir)/lib/libvmod_directors/vmod_directors.rst $@ +SPHINXFIRSTS += $(top_builddir)/doc/sphinx/reference/vmod_directors.generated.rst + +sphinx_prereq: $(SPHINXFIRSTS) + +$(SPHINXFIRSTS): doc/sphinx/include + +EXTRA_DIST += $(SPHINXFIRSTS) \ + doc/sphinx/reference/directors.rst \ + doc/sphinx/reference/index.rst \ + doc/sphinx/reference/states.rst \ + doc/sphinx/reference/varnishadm.rst \ + doc/sphinx/reference/varnish-cli.rst \ + doc/sphinx/reference/varnishd.rst \ + doc/sphinx/reference/varnishhist.rst \ + doc/sphinx/reference/varnishlog.rst \ + doc/sphinx/reference/varnishncsa.rst \ + doc/sphinx/reference/varnishstat.rst \ + doc/sphinx/reference/varnishtest.rst \ + doc/sphinx/reference/varnishtop.rst \ + doc/sphinx/reference/vcl.rst \ + $(top_builddir)/doc/sphinx/reference/vmod_directors.generated.rst \ + doc/sphinx/reference/vmod.rst \ + $(top_builddir)/doc/sphinx/reference/vmod_std.generated.rst \ + doc/sphinx/reference/vsl-query.rst \ + doc/sphinx/reference/vsl.rst \ + doc/sphinx/reference/vsm.rst +MAINTAINERCLEANFILES += $(SPHINXFIRSTS) diff --git a/etc/Makefile.am b/etc/Makefile.am index d02d710..5efeec6 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -1,12 +1,12 @@ # -DISTCLEANFILES = builtin.vcl +DISTCLEANFILES += etc/builtin.vcl -dist_doc_DATA = builtin.vcl \ - example.vcl +dist_doc_DATA = etc/builtin.vcl \ + etc/example.vcl -builtin.vcl: $(top_srcdir)/bin/varnishd/builtin.vcl +etc/builtin.vcl: bin/varnishd/builtin.vcl ( printf "This is the VCL configuration Varnish will automatically append to your VCL\nfile during compilation/loading. See the vcl(7) man page for details on syntax\nand semantics.\n\ New users is recommended to use the example.vcl file as a starting point.\n\n";\ - sed -n '/vcl_recv/,$$p' $(top_srcdir)/bin/varnishd/builtin.vcl ) | \ - sed 's/^\(.*\)$$/# \1/' > builtin.vcl + sed -n '/vcl_recv/,$$p' bin/varnishd/builtin.vcl ) | \ + sed 's/^\(.*\)$$/# \1/' > etc/builtin.vcl diff --git a/include/Makefile.am b/include/Makefile.am index 7088579..c615ede 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,109 +1,141 @@ # # API headers -nobase_pkginclude_HEADERS = \ - tbl/acct_fields_req.h \ - tbl/acct_fields_bereq.h \ - tbl/backend_poll.h \ - tbl/ban_vars.h \ - tbl/bo_flags.h \ - tbl/body_status.h \ - tbl/debug_bits.h \ - tbl/feature_bits.h \ - tbl/http_headers.h \ - tbl/http_response.h \ - tbl/locks.h \ - tbl/obj_attr.h \ - tbl/params.h \ - tbl/req_body.h \ - tbl/req_flags.h \ - tbl/sess_attr.h \ - tbl/sess_close.h \ - tbl/steps.h \ - tbl/symbol_kind.h \ - tbl/vcc_types.h \ - tbl/vcl_returns.h \ - tbl/vrt_stv_var.h \ - tbl/vsc_types.h \ - tbl/vsc_all.h \ - tbl/vsc_fields.h \ - tbl/vsc_levels.h \ - tbl/vsc_f_main.h \ - tbl/vsl_tags.h \ - tbl/vsl_tags_http.h \ - vapi/vsm.h \ - vapi/vsm_int.h \ - vapi/vsc.h \ - vapi/vsc_int.h \ - vapi/vsl.h \ - vapi/vsl_int.h \ - vapi/voptget.h \ - vapi/vapi_options.h \ - vcli.h + +public_include_headers = \ + include/tbl/acct_fields_req.h \ + include/tbl/acct_fields_bereq.h \ + include/tbl/backend_poll.h \ + include/tbl/ban_vars.h \ + include/tbl/bo_flags.h \ + include/tbl/body_status.h \ + include/tbl/debug_bits.h \ + include/tbl/feature_bits.h \ + include/tbl/http_headers.h \ + include/tbl/http_response.h \ + include/tbl/locks.h \ + include/tbl/obj_attr.h \ + include/tbl/params.h \ + include/tbl/req_body.h \ + include/tbl/req_flags.h \ + include/tbl/sess_attr.h \ + include/tbl/sess_close.h \ + include/tbl/steps.h \ + include/tbl/symbol_kind.h \ + include/tbl/vcc_types.h \ + include/tbl/vcl_returns.h \ + include/tbl/vrt_stv_var.h \ + include/tbl/vsc_types.h \ + include/tbl/vsc_all.h \ + include/tbl/vsc_fields.h \ + include/tbl/vsc_levels.h \ + include/tbl/vsc_f_main.h \ + include/tbl/vsl_tags.h \ + include/tbl/vsl_tags_http.h \ + include/vapi/vsm.h \ + include/vapi/vsm_int.h \ + include/vapi/vsc.h \ + include/vapi/vsc_int.h \ + include/vapi/vsl.h \ + include/vapi/vsl_int.h \ + include/vapi/voptget.h \ + include/vapi/vapi_options.h \ + include/vcli.h + +# This saddens me, but nobase will strip the path completely +# and we want to keep everything after 'include/' +# XXX one mkdir per file is wasteful, but we won't risk +# forgetting subdirs +install-data-local: install-public-include-headers +install-public-include-headers: + for i in $(public_include_headers); do \ + h_dir="$$(dirname $(DESTDIR)$(includedir)/varnish`echo $$i | sed s at include@@`)"; \ + $(install_sh) -d -m 0755 $$h_dir; \ + $(INSTALL_HEADER) $(srcdir)/$$i $$h_dir; \ + done + +# chmod +w $$(dirname $(includedir)/`echo $$i | +# sed s at include@varnish@`); +uninstall-hook: uninstall-public-include-headers +uninstall-public-include-headers : + for i in $(public_include_headers); do \ + rm -f $(DESTDIR)$(includedir)/`echo $$i | sed s at include@varnish@`; \ + done + +.PHONY : install-public-include-headers uninstall-public-include-headers +EXTRA_DIST += $(public_include_headers) # Headers for use with vmods -nobase_pkginclude_HEADERS += \ - miniobj.h \ - vas.h \ - vav.h \ - vbm.h \ - vcl.h \ - vcs.h \ - vmod_abi.h \ - vqueue.h \ - vre.h \ - vdef.h \ - vrt.h \ - vrt_obj.h \ - vsa.h \ - vsb.h \ - vsha256.h \ - vtcp.h \ - vtim.h +pkginclude_HEADERS += \ + include/miniobj.h \ + include/vas.h \ + include/vav.h \ + include/vbm.h \ + include/vcl.h \ + include/vcs.h \ + include/vmod_abi.h \ + include/vqueue.h \ + include/vre.h \ + include/vdef.h \ + include/vrt.h \ + include/vrt_obj.h \ + include/vsa.h \ + include/vsb.h \ + include/vsha256.h \ + include/vtcp.h \ + include/vtim.h # Private headers -nobase_noinst_HEADERS = \ - binary_heap.h \ - compat/daemon.h \ - compat/execinfo.h \ - flopen.h \ - libvcc.h \ - vcli_common.h \ - vcli_priv.h \ - vcli_serve.h \ - vcs_version.h \ - vct.h \ - vcurses.h \ - vend.h \ - vev.h \ - vfil.h \ - vin.h \ - vlu.h \ - vmb.h \ - vnum.h \ - vpf.h \ - vrnd.h \ - vsl_priv.h \ - vsm_priv.h \ - vsub.h \ - vss.h \ - vtcp.h \ - vtree.h \ - vut.h \ - vut_options.h +nobase_noinst_HEADERS += \ + include/binary_heap.h \ + include/compat/daemon.h \ + include/compat/execinfo.h \ + include/flopen.h \ + include/libvcc.h \ + include/vcli_common.h \ + include/vcli_priv.h \ + include/vcli_serve.h \ + include/vcs_version.h \ + include/vct.h \ + include/vcurses.h \ + include/vend.h \ + include/vev.h \ + include/vfil.h \ + include/vin.h \ + include/vlu.h \ + include/vmb.h \ + include/vnum.h \ + include/vpf.h \ + include/vrnd.h \ + include/vsl_priv.h \ + include/vsm_priv.h \ + include/vsub.h \ + include/vss.h \ + include/vtcp.h \ + include/vtree.h \ + include/vut.h \ + include/vut_options.h + +include/tbl/vrt_stv_var.h \ + include/tbl/vcl_returns.h \ + include/tbl/vcc_types.h \ + include/vrt_obj.h \ + lib/libvcc/vcc_fixed_token.c \ + lib/libvcc/vcc_obj.c \ + lib/libvcc/vcc_token_defs.h: \ + include/vcl.h +include/vcl.h: lib/libvcc/generate.py include/vrt.h + mkdir -p include/tbl + @PYTHON@ $(top_srcdir)/lib/libvcc/generate.py . . -tbl/vrt_stv_var.h tbl/vcl_returns.h tbl/vcc_types.h vrt_obj.h: vcl.h -vcl.h: $(top_srcdir)/lib/libvcc/generate.py $(top_srcdir)/include/vrt.h - mkdir -p tbl - @PYTHON@ $(top_srcdir)/lib/libvcc/generate.py $(top_srcdir) $(top_builddir) +MAINTAINERCLEANFILES += $(top_builddir)/include/vcs_version.h -BUILT_SOURCES = vcs_version.h vmod_abi.h -MAINTAINERCLEANFILES = vcs_version.h -vcs_version.h: FORCE +include/vcs_version.h: + @mkdir -p include @if [ -d "$(top_srcdir)/.git" ]; then \ V="$$(git show -s --pretty=format:%h)" \ B="$$(git rev-parse --abbrev-ref HEAD)" \ - H="$$(head -n 1 vcs_version.h 2>/dev/null || true)"; \ + H="$$(head -n 1 include/vcs_version.h 2>/dev/null || true)"; \ if [ "/* $$V */" != "$$H" ]; then \ ( \ echo "/* $$V */" ;\ @@ -117,16 +149,16 @@ vcs_version.h: FORCE echo '' ;\ echo "#define VCS_Version \"$$V\"" ; \ echo "#define VCS_Branch \"$$B\"" \ - ) > vcs_version.h ; \ + ) > include/vcs_version.h ; \ fi \ else \ - if [ ! -f vcs_version.h ]; then \ + if [ ! -f include/vcs_version.h ]; then \ ( \ echo "/* NOGIT */" ; \ echo '/* No git commit ID available, see include/Makefile.am for explanation */' ; \ echo '#define VCS_Version "NOGIT"' ; \ echo '#define VCS_Branch "NOGIT"' \ - ) > vcs_version.h ; \ + ) > include/vcs_version.h ; \ fi \ fi FORCE: @@ -139,16 +171,16 @@ FORCE: # The way to fix this is to either build Varnish from a tarball made # with `make dist` or a git checkout. -vmod_abi.h: vcs_version.h - @GITID=$$(sed 's/[^0-9a-f]//g;q' vcs_version.h) ; \ +include/vmod_abi.h: include/vcs_version.h + @GITID=$$(sed 's/[^0-9a-f]//g;q' include/vcs_version.h) ; \ if [ -z "$$GITID" ]; then \ echo "warning: weak VMOD ABI checking, see include/Makefile.am" ; \ fi ; \ - echo "#define VMOD_ABI_Version \"@PACKAGE_STRING@ $$GITID\"" > vmod_abi.h + echo "#define VMOD_ABI_Version \"@PACKAGE_STRING@ $$GITID\"" > $(top_builddir)/include/vmod_abi.h -CLEANFILES = \ - tbl/vcl_returns.h \ - tbl/vrt_stv_var.h \ - vcl.h \ - vrt_obj.h \ - vmod_abi.h +CLEANFILES += \ + include/tbl/vcl_returns.h \ + include/tbl/vrt_stv_var.h \ + include/vcl.h \ + include/vrt_obj.h \ + include/vmod_abi.h diff --git a/lib/Makefile.am b/lib/Makefile.am deleted file mode 100644 index c0c0e60..0000000 --- a/lib/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# - -SUBDIRS = \ - libvarnishcompat \ - libvarnish \ - libvarnishapi \ - libvarnishtools \ - libvcc \ - libvgz \ - libvmod_debug \ - libvmod_std \ - libvmod_directors - -DIST_SUBDIRS = \ - libvarnishcompat \ - libvarnish \ - libvarnishapi \ - libvarnishtools \ - libvcc \ - libvgz \ - libvmod_debug \ - libvmod_std \ - libvmod_directors diff --git a/lib/libvarnish/Makefile.am b/lib/libvarnish/Makefile.am index b592cff..f24b894 100644 --- a/lib/libvarnish/Makefile.am +++ b/lib/libvarnish/Makefile.am @@ -1,53 +1,56 @@ -AM_CPPFLAGS = \ +lib_libvarnish_libvarnish_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ @PCRE_CFLAGS@ -AM_LDFLAGS = $(AM_LT_LDFLAGS) - -pkglib_LTLIBRARIES = libvarnish.la - -libvarnish_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version - -libvarnish_la_SOURCES = \ - vav.c \ - vas.c \ - binary_heap.c \ - vsub.c \ - cli_auth.c \ - cli_common.c \ - cli_serve.c \ - flopen.c \ - vnum.c \ - vtim.c \ - vtcp.c \ - vct.c \ - version.c \ - vev.c \ - vfil.c \ - vin.c \ - vlu.c \ - vmb.c \ - vpf.c \ - vre.c \ - vrnd.c \ - vsa.c \ - vsb.c \ - vsha256.c \ - vss.c - -libvarnish_la_CFLAGS = -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"' -libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS} ${LIBM} @PCRE_LIBS@ +pkglib_LTLIBRARIES += lib/libvarnish/libvarnish.la + +lib_libvarnish_libvarnish_la_LDFLAGS = $(AM_LT_LDFLAGS) -avoid-version + +lib_libvarnish_libvarnish_la_SOURCES = \ + lib/libvarnish/vav.c \ + lib/libvarnish/vas.c \ + lib/libvarnish/binary_heap.c \ + lib/libvarnish/vsub.c \ + lib/libvarnish/cli_auth.c \ + lib/libvarnish/cli_common.c \ + lib/libvarnish/cli_serve.c \ + lib/libvarnish/flopen.c \ + lib/libvarnish/vnum.c \ + lib/libvarnish/vtim.c \ + lib/libvarnish/vtcp.c \ + lib/libvarnish/vct.c \ + lib/libvarnish/version.c \ + lib/libvarnish/vev.c \ + lib/libvarnish/vfil.c \ + lib/libvarnish/vin.c \ + lib/libvarnish/vlu.c \ + lib/libvarnish/vmb.c \ + lib/libvarnish/vpf.c \ + lib/libvarnish/vre.c \ + lib/libvarnish/vrnd.c \ + lib/libvarnish/vsa.c \ + lib/libvarnish/vsb.c \ + lib/libvarnish/vsha256.c \ + lib/libvarnish/vss.c + +lib_libvarnish_libvarnish_la_CFLAGS = -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"' +lib_libvarnish_libvarnish_la_LIBADD = ${RT_LIBS} ${NET_LIBS} ${LIBM} @PCRE_LIBS@ if ENABLE_TESTS -TESTS = vnum_c_test +TESTS += lib/libvarnish/vnum_c_test -noinst_PROGRAMS = ${TESTS} +noinst_PROGRAMS += lib/libvarnish/vnum_c_test -vnum_c_test_SOURCES = vnum.c vas.c -vnum_c_test_CFLAGS = -DNUM_C_TEST -include config.h -vnum_c_test_LDADD = ${LIBM} +lib_libvarnish_vnum_c_test_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ + @PCRE_CFLAGS@ + +lib_libvarnish_vnum_c_test_SOURCES = lib/libvarnish/vnum.c lib/libvarnish/vas.c +lib_libvarnish_vnum_c_test_CFLAGS = -DNUM_C_TEST -include config.h +lib_libvarnish_vnum_c_test_LDADD = ${LIBM} -test: ${TESTS} +test: lib/libvarnish/vnum_c_test @for test in ${TESTS} ; do ./$${test} ; done endif diff --git a/lib/libvarnishapi/Makefile.am b/lib/libvarnishapi/Makefile.am index 68a89bd..5e00829 100644 --- a/lib/libvarnishapi/Makefile.am +++ b/lib/libvarnishapi/Makefile.am @@ -1,105 +1,113 @@ # -AM_LDFLAGS = $(AM_LT_LDFLAGS) - -AM_CPPFLAGS = \ +lib_libvarnishapi_libvarnishapi_la_CPPFLAGS = \ + -I$(top_srcdir)/lib/libvarnishapi \ -I$(top_srcdir)/include \ -I$(top_builddir)/include \ @PCRE_CFLAGS@ -lib_LTLIBRARIES = libvarnishapi.la +lib_LTLIBRARIES += lib/libvarnishapi/libvarnishapi.la -libvarnishapi_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 +lib_libvarnishapi_libvarnishapi_la_LDFLAGS = $(AM_LT_LDFLAGS) -version-info 1:0:0 -libvarnishapi_la_SOURCES = \ - vsm_api.h \ - vsl_api.h \ - vxp.h \ - vxp_tokens.h \ +lib_libvarnishapi_libvarnishapi_la_SOURCES = \ + lib/libvarnishapi/vsm_api.h \ + lib/libvarnishapi/vsl_api.h \ + lib/libvarnishapi/vxp.h \ + lib/libvarnishapi/vxp_tokens.h \ + \ + lib/libvarnish/vas.c \ + lib/libvarnish/vav.c \ + include/vcs_version.h \ + lib/libvarnish/version.c \ + lib/libvarnish/cli_common.c \ + lib/libvarnish/cli_auth.c \ + lib/libvarnish/vin.c \ + lib/libvarnish/vmb.c \ + lib/libvarnish/vre.c \ + lib/libvarnish/vsb.c \ + lib/libvarnish/vtim.c \ + lib/libvarnish/vnum.c \ + lib/libvarnish/vsha256.c \ \ - ../libvarnish/vas.c \ - ../libvarnish/vav.c \ - ../../include/vcs_version.h \ - ../libvarnish/version.c \ - ../libvarnish/cli_common.c \ - ../libvarnish/cli_auth.c \ - ../libvarnish/vin.c \ - ../libvarnish/vmb.c \ - ../libvarnish/vre.c \ - ../libvarnish/vsb.c \ - ../libvarnish/vtim.c \ - ../libvarnish/vnum.c \ - ../libvarnish/vsha256.c \ - vsm.c \ - vsl_arg.c \ - vsl_cursor.c \ - vsl_dispatch.c \ - vsl_query.c \ - vsl.c \ - vsc.c \ - vxp.c \ - vxp_parse.c \ - vxp_lexer.c \ - vxp_fixed_token.c \ - libvarnishapi.map - -libvarnishapi_la_CFLAGS = \ + lib/libvarnishapi/vxp_fixed_token.c \ + lib/libvarnishapi/vsm.c \ + lib/libvarnishapi/vsl_arg.c \ + lib/libvarnishapi/vsl_cursor.c \ + lib/libvarnishapi/vsl_dispatch.c \ + lib/libvarnishapi/vsl_query.c \ + lib/libvarnishapi/vsl.c \ + lib/libvarnishapi/vsc.c \ + lib/libvarnishapi/vxp.c \ + lib/libvarnishapi/vxp_parse.c \ + lib/libvarnishapi/vxp_lexer.c \ + lib/libvarnishapi/libvarnishapi.map + +lib/libvarnish/lib_libvarnish_libvarnish_la-version.lo FORCE: include/vcs_version.h + +lib_libvarnishapi_libvarnishapi_la_CFLAGS = \ -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"' -libvarnishapi_la_LIBADD = @PCRE_LIBS@ @RT_LIBS@ +lib_libvarnishapi_libvarnishapi_la_LIBADD = @PCRE_LIBS@ @RT_LIBS@ if HAVE_LD_VERSION_SCRIPT -libvarnishapi_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libvarnishapi.map +lib_libvarnishapi_libvarnishapi_la_LDFLAGS += -Wl,--version-script=$(top_srcdir)/lib/libvarnishapi/libvarnishapi.map else -libvarnishapi_la_LDFLAGS += -export-symbols-regex '^V' +lib_libvarnishapi_libvarnishapi_la_LDFLAGS += -export-symbols-regex '^V' endif -EXTRA_DIST = \ - generate.py \ - vsl-tags.rst +EXTRA_DIST += \ + lib/libvarnishapi/generate.py \ + lib/libvarnishapi/vsl-tags.rst -BUILT_SOURCES = \ - vxp_fixed_token.c \ - vxp_tokens.h \ - vsl-tags.rst +#BUILT_SOURCES += \ +# lib/libvarnishapi/vxp_fixed_token.c \ +# lib/libvarnishapi/vxp_tokens.h -CLEANFILES = \ - $(builddir)/vxp_fixed_token.c \ - $(builddir)/vxp_tokens.h +CLEANFILES += \ + $(top_builddir)/lib/libvarnishapi/vxp_fixed_token.c \ + $(top_builddir)/lib/libvarnishapi/vxp_tokens.h -MAINTAINERCLEANFILES = \ - vsl-tags.rst +MAINTAINERCLEANFILES += \ + lib/libvarnishapi/vsl-tags.rst -noinst_PROGRAMS = vsl2rst +noinst_PROGRAMS += lib/libvarnishapi/vsl2rst -vsl2rst_SOURCES = \ - vsl2rst.c \ +lib_libvarnishapi_vsl2rst_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_builddir)/include \ + @PCRE_CFLAGS@ + +lib_libvarnishapi_vsl2rst_SOURCES = \ + lib/libvarnishapi/vsl2rst.c \ $(top_srcdir)/include/tbl/vsl_tags.h \ $(top_srcdir)/include/tbl/vsl_tags_http.h -vsl-tags.rst: vsl2rst - ./vsl2rst > $@ +$(top_builddir)/lib/libvarnishapi/vsl-tags.rst: lib/libvarnishapi/vsl2rst + lib/libvarnishapi/vsl2rst > lib/libvarnishapi/vsl-tags.rst + +lib/libvarnishapi/vxp_fixed_token.c : lib/libvarnishapi/vxp_tokens.h -vxp_fixed_token.c vxp_tokens.h: \ - $(srcdir)/generate.py - @PYTHON@ $(srcdir)/generate.py $(srcdir) $(top_builddir) +lib/libvarnishapi/vxp_tokens.h: \ + lib/libvarnishapi/generate.py + @PYTHON@ $(top_srcdir)/lib/libvarnishapi/generate.py lib/libvarnishapi/ . -EXTRA_PROGRAMS = vxp_test vsl_glob_test +EXTRA_PROGRAMS = lib/libvarnishapi/vxp_test lib/libvarnishapi/vsl_glob_test -vxp_test_LDADD = @PCRE_LIBS@ \ +lib_libvarnishapi_vxp_test_LDADD = @PCRE_LIBS@ \ ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS} -vxp_test_CFLAGS = \ +lib_libvarnishapi_vxp_test_CFLAGS = \ -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"' \ -DVXP_DEBUG -vxp_test_SOURCES = \ +lib_libvarnishapi_vxp_test_SOURCES = \ $(libvarnishapi_la_SOURCES) \ - vxp_test.c + lib/libvarnishapi/vxp_test.c -vsl_glob_test_SOURCES = \ - vsl_glob_test.c +lib_libvarnishapi_vsl_glob_test_SOURCES = \ + lib/libvarnishapi/vsl_glob_test.c -vsl_glob_test_LDADD = @PCRE_LIBS@ ${RT_LIBS} ${LIBM} libvarnishapi.la +lib_libvarnishapi_vsl_glob_test_LDADD = @PCRE_LIBS@ ${RT_LIBS} ${LIBM} libvarnishapi.la -vsl_glob_test_CFLAGS = -I$(top_srcdir)/include +lib_libvarnishapi_vsl_glob_test_CFLAGS = -I$(top_srcdir)/include diff --git a/lib/libvarnishcompat/Makefile.am b/lib/libvarnishcompat/Makefile.am index 78683c0..120e955 100644 --- a/lib/libvarnishcompat/Makefile.am +++ b/lib/libvarnishcompat/Makefile.am @@ -1,15 +1,13 @@ # -AM_CPPFLAGS = \ +lib_libvarnishcompat_libvarnishcompat_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include -AM_LDFLAGS = $(AM_LT_LDFLAGS) +pkglib_LTLIBRARIES += lib/libvarnishcompat/libvarnishcompat.la -pkglib_LTLIBRARIES = libvarnishcompat.la +lib_libvarnishcompat_libvarnishcompat_la_LDFLAGS = $(AM_LT_LDFLAGS) -avoid-version -libvarnishcompat_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version - -libvarnishcompat_la_SOURCES = \ - daemon.c \ - execinfo.c +lib_libvarnishcompat_libvarnishcompat_la_SOURCES = \ + lib/libvarnishcompat/daemon.c \ + lib/libvarnishcompat/execinfo.c diff --git a/lib/libvarnishtools/Makefile.am b/lib/libvarnishtools/Makefile.am index 1a14212..910b6ff 100644 --- a/lib/libvarnishtools/Makefile.am +++ b/lib/libvarnishtools/Makefile.am @@ -1,5 +1,5 @@ # -EXTRA_DIST = \ - vut.c \ - opt2rst.c +EXTRA_DIST += \ + lib/libvarnishtools/vut.c \ + lib/libvarnishtools/opt2rst.c diff --git a/lib/libvcc/Makefile.am b/lib/libvcc/Makefile.am index b5a6574..d49d55a 100644 --- a/lib/libvcc/Makefile.am +++ b/lib/libvcc/Makefile.am @@ -1,45 +1,46 @@ # -AM_LDFLAGS = $(AM_LT_LDFLAGS) - -AM_CPPFLAGS = \ +lib_libvcc_libvcc_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_builddir)/include -pkglib_LTLIBRARIES = libvcc.la +pkglib_LTLIBRARIES += lib/libvcc/libvcc.la -libvcc_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version +lib_libvcc_libvcc_la_LDFLAGS = $(AM__LT_LDFLAGS) -avoid-version -libvcc_la_SOURCES = \ - vcc_compile.h \ - vcc_token_defs.h \ +lib_libvcc_libvcc_la_SOURCES = \ + lib/libvcc/vcc_compile.h \ + lib/libvcc/vcc_token_defs.h \ \ - vcc_acl.c \ - vcc_action.c \ - vcc_backend.c \ - vcc_backend_util.c \ - vcc_compile.c \ - vcc_expr.c \ - vcc_parse.c \ - vcc_fixed_token.c \ - vcc_obj.c \ - vcc_storage.c \ - vcc_utils.c \ - vcc_symb.c \ - vcc_token.c \ - vcc_var.c \ - vcc_vmod.c \ - vcc_xref.c - -EXTRA_DIST = \ - generate.py - -dist_pkgdata_SCRIPTS = \ - vmodtool.py - -vcc_obj.c vcc_fixed_token.c vcc_token_defs.h: \ - $(top_builddir)/include/vcl.h - -CLEANFILES = $(builddir)/vcc_token_defs.h \ - $(builddir)/vcc_fixed_token.c \ - $(builddir)/vcc_obj.c + lib/libvcc/vcc_acl.c \ + lib/libvcc/vcc_action.c \ + lib/libvcc/vcc_backend.c \ + lib/libvcc/vcc_backend_util.c \ + lib/libvcc/vcc_compile.c \ + lib/libvcc/vcc_expr.c \ + lib/libvcc/vcc_parse.c \ + lib/libvcc/vcc_fixed_token.c \ + lib/libvcc/vcc_obj.c \ + lib/libvcc/vcc_storage.c \ + lib/libvcc/vcc_utils.c \ + lib/libvcc/vcc_symb.c \ + lib/libvcc/vcc_token.c \ + lib/libvcc/vcc_var.c \ + lib/libvcc/vcc_vmod.c \ + lib/libvcc/vcc_xref.c + +EXTRA_DIST += \ + lib/libvcc/generate.py + +dist_pkgdata_SCRIPTS += \ + lib/libvcc/vmodtool.py + +lib/libvcc/lib_libvcc_libvcc_la-vcc_vmod.lo FORCE: include/vmod_abi.h include/vcl.h + +lib/libvcc/lib_libvcc_libvcc_la-vcc_obj.$(OBJEXT) \ + lib/libvcc/lib_libvcc_libvcc_la-vcc_fixed_token.$(OBJEXT) \ + lib/libvcc/lib_libvcc_libvcc_la-vcc_token_defs.$(OBJEXT) : include/vcl.h + +CLEANFILES += $(builddir)/lib/libvcc/vcc_token_defs.h \ + $(builddir)/lib/libvcc/vcc_fixed_token.c \ + $(builddir)/lib/libvcc/vcc_obj.c diff --git a/lib/libvgz/Makefile.am b/lib/libvgz/Makefile.am index d9c0dae..be7b9b2 100644 --- a/lib/libvgz/Makefile.am +++ b/lib/libvgz/Makefile.am @@ -1,31 +1,31 @@ # -AM_LDFLAGS = $(AM_LT_LDFLAGS) +pkglib_LTLIBRARIES += lib/libvgz/libvgz.la -pkglib_LTLIBRARIES = libvgz.la +lib_libvgz_libvgz_la_LDFLAGS = $(AM__LTLDFLAGS) -avoid-version +lib_libvgz_libvgz_la_CFLAGS = -D_LARGEFILE64_SOURCE=1 -DZLIB_CONST $(libvgz_extra_cflags) -libvgz_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -libvgz_la_CFLAGS = -D_LARGEFILE64_SOURCE=1 -DZLIB_CONST $(libvgz_extra_cflags) +lib_libvgz_libvgz_la_SOURCES = \ + lib/libvgz/adler32.c \ + lib/libvgz/compress.c \ + lib/libvgz/crc32.c \ + lib/libvgz/crc32.h \ + lib/libvgz/deflate.c \ + lib/libvgz/deflate.h \ + lib/libvgz/gzguts.h \ + lib/libvgz/infback.c \ + lib/libvgz/inffast.c \ + lib/libvgz/inffast.h \ + lib/libvgz/inffixed.h \ + lib/libvgz/inflate.c \ + lib/libvgz/inflate.h \ + lib/libvgz/inftrees.c \ + lib/libvgz/inftrees.h \ + lib/libvgz/trees.c \ + lib/libvgz/trees.h \ + lib/libvgz/uncompr.c \ + lib/libvgz/zconf.h \ + lib/libvgz/vgz.h \ + lib/libvgz/zutil.c \ + lib/libvgz/zutil.h -libvgz_la_SOURCES = \ - adler32.c \ - compress.c \ - crc32.c \ - crc32.h \ - deflate.c \ - deflate.h \ - gzguts.h \ - infback.c \ - inffast.c \ - inffast.h \ - inffixed.h \ - inflate.c \ - inflate.h \ - inftrees.c \ - inftrees.h \ - trees.c \ - trees.h \ - uncompr.c \ - zconf.h \ - vgz.h \ - zutil.c \ - zutil.h +EXTRA_DIST += lib/libvgz/README diff --git a/lib/libvmod_debug/Makefile.am b/lib/libvmod_debug/Makefile.am index 9115713..1c8d02a 100644 --- a/lib/libvmod_debug/Makefile.am +++ b/lib/libvmod_debug/Makefile.am @@ -1,37 +1,38 @@ # -AM_LDFLAGS = $(AM_LT_LDFLAGS) -AM_CPPFLAGS = \ + +lib_libvmod_debug_libvmod_debug_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/bin/varnishd \ - -I$(top_builddir)/include + -I$(top_builddir)/include \ + -I$(top_builddir)/lib/libvmod_debug -vmoddir = $(pkglibdir)/vmods -vmod_srcdir = $(top_srcdir)/lib/libvmod_debug -vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py -vmodtoolargs = --strict +noinst_LTLIBRARIES += lib/libvmod_debug/libvmod_debug.la -noinst_LTLIBRARIES = libvmod_debug.la +lib_libvmod_debug_libvmod_debug_la_LDFLAGS = $(AM_LT_LDFLAGS) -module -export-dynamic -avoid-version -shared -rpath $(abs_builddir) -libvmod_debug_la_LDFLAGS = $(AM_LDFLAGS) -module -export-dynamic -avoid-version -shared -rpath /nowhere +lib_libvmod_debug_libvmod_debug_la_SOURCES = \ + lib/libvmod_debug/vmod_debug.c \ + lib/libvmod_debug/vmod_debug_obj.c \ + lib/libvmod_debug/vmod_debug_dyn.c -libvmod_debug_la_SOURCES = \ - vmod_debug.c \ - vmod_debug_obj.c \ - vmod_debug_dyn.c +nodist_lib_libvmod_debug_libvmod_debug_la_SOURCES = \ + lib/libvmod_debug/vcc_if.c \ + lib/libvmod_debug/vcc_if.h -nodist_libvmod_debug_la_SOURCES = \ - vcc_if.c \ - vcc_if.h +$(lib_libvmod_debug_libvmod_debug_la_OBJECTS) : lib/libvmod_debug/vcc_if.h include/tbl/vcl_returns.h -# BUILT_SOURCES is only a hack and dependency tracking does not help for the first build -vmod_debug.lo vmod_debug_obj.lo vmod_debug_dyn.lo: vcc_if.h +# stupid hack to run vmodtool only once +lib/libvmod_debug/vcc_if.c \ + lib/libvmod_debug/vmod_debug.rst \ + lib/libvmod_debug/vmod_debug.man.rst : lib/libvmod_debug/vcc_if.h + @# -vcc_if.c vcc_if.h vmod_debug.rst vmod_debug.man.rst: $(vmodtool) $(vmod_srcdir)/vmod.vcc - @PYTHON@ $(vmodtool) $(vmodtoolargs) $(vmod_srcdir)/vmod.vcc +lib/libvmod_debug/vcc_if.h: $(vmodtool) lib/libvmod_debug/vmod.vcc + cd lib/libvmod_debug/ && @PYTHON@ ../../$(vmodtool) $(vmodtoolargs) $(abs_top_srcdir)/lib/libvmod_debug/vmod.vcc -EXTRA_DIST = vmod.vcc +EXTRA_DIST += lib/libvmod_debug/vmod.vcc -CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \ - $(builddir)/vmod_debug.rst \ - $(builddir)/vmod_debug.man.rst +CLEANFILES += $(builddir)/lib/libvmod_debug/vcc_if.c $(builddir)/lib/libvmod_debug/vcc_if.h \ + $(builddir)/lib/libvmod_debug/vmod_debug.rst \ + $(builddir)/lib/libvmod_debug/vmod_debug.man.rst diff --git a/lib/libvmod_directors/Makefile.am b/lib/libvmod_directors/Makefile.am index 64b72a8..f2465d8 100644 --- a/lib/libvmod_directors/Makefile.am +++ b/lib/libvmod_directors/Makefile.am @@ -1,40 +1,41 @@ # -AM_LDFLAGS = $(AM_LT_LDFLAGS) - -AM_CPPFLAGS = \ +lib_libvmod_directors_libvmod_directors_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/bin/varnishd \ - -I$(top_builddir)/include + -I$(top_builddir)/include \ + -I$(top_builddir)/lib/libvmod_directors + +vmod_LTLIBRARIES += lib/libvmod_directors/libvmod_directors.la -vmoddir = $(pkglibdir)/vmods -vmod_srcdir = $(top_srcdir)/lib/libvmod_directors -vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py -vmodtoolargs = --strict -vmod_LTLIBRARIES = libvmod_directors.la +lib_libvmod_directors_libvmod_directors_la_LDFLAGS = $(AM_LT_LDFLAGS) -module -export-dynamic -avoid-version -shared -libvmod_directors_la_LDFLAGS = $(AM_LDFLAGS) -module -export-dynamic -avoid-version -shared +lib_libvmod_directors_libvmod_directors_la_SOURCES = \ + lib/libvmod_directors/vdir.c \ + lib/libvmod_directors/vdir.h \ + lib/libvmod_directors/fall_back.c \ + lib/libvmod_directors/hash.c \ + lib/libvmod_directors/random.c \ + lib/libvmod_directors/round_robin.c -libvmod_directors_la_SOURCES = \ - vdir.c \ - vdir.h \ - fall_back.c \ - hash.c \ - random.c \ - round_robin.c +nodist_lib_libvmod_directors_libvmod_directors_la_SOURCES = \ + lib/libvmod_directors/vcc_if.c \ + lib/libvmod_directors/vcc_if.h -nodist_libvmod_directors_la_SOURCES = \ - vcc_if.c \ - vcc_if.h +lib/libvmod_std/lib_libvmod_std_libvmod_std_la-vmod_vcc_if.lo : include/vmod_abi.h -# BUILT_SOURCES is only a hack and dependency tracking does not help for the first build -vdir.lo fall_back.lo hash.lo random.lo round_robin.lo: vcc_if.h +$(lib_libvmod_directors_libvmod_directors_la_OBJECTS) : lib/libvmod_directors/vcc_if.h include/tbl/vcl_returns.h -vcc_if.c vcc_if.h vmod_directors.rst vmod_directors.man.rst: $(vmodtool) $(vmod_srcdir)/vmod.vcc - @PYTHON@ $(vmodtool) $(vmodtoolargs) $(vmod_srcdir)/vmod.vcc +# stupid hack to run vmodtool only once +lib/libvmod_directors/vcc_if.c \ + lib/libvmod_directors/vmod_directors.rst \ + lib/libvmod_directors/vmod_directors.man.rst : lib/libvmod_directors/vcc_if.h + @# +lib/libvmod_directors/vcc_if.h: $(vmodtool) lib/libvmod_directors/vmod.vcc + cd lib/libvmod_directors/ && @PYTHON@ ../../$(vmodtool) $(vmodtoolargs) $(abs_top_srcdir)/lib/libvmod_directors/vmod.vcc -EXTRA_DIST = vmod.vcc +EXTRA_DIST += lib/libvmod_directors/vmod.vcc -CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \ - $(builddir)/vmod_directors.rst \ - $(builddir)/vmod_directors.man.rst +CLEANFILES += $(top_builddir)/lib/libvmod_directors/vcc_if.c $(top_builddir)/lib/libvmod_directors/vcc_if.h \ + $(top_builddir)/lib/libvmod_directors/vmod_directors.rst \ + $(top_builddir)/lib/libvmod_directors/vmod_directors.man.rst diff --git a/lib/libvmod_std/Makefile.am b/lib/libvmod_std/Makefile.am index 47dd5dc..1cb5636 100644 --- a/lib/libvmod_std/Makefile.am +++ b/lib/libvmod_std/Makefile.am @@ -1,38 +1,41 @@ # -AM_LDFLAGS = $(AM_LT_LDFLAGS) - -AM_CPPFLAGS = \ +lib_libvmod_std_libvmod_std_la_CPPFLAGS = \ -I$(top_srcdir)/include \ -I$(top_srcdir)/bin/varnishd \ - -I$(top_builddir)/include + -I$(top_builddir)/include \ + -I$(top_builddir)/lib/libvmod_std + +vmod_LTLIBRARIES += lib/libvmod_std/libvmod_std.la + +lib_libvmod_std_libvmod_std_la_LDFLAGS = $(AM_LT_LDFLAGS) -module -export-dynamic -avoid-version -shared -vmoddir = $(pkglibdir)/vmods -vmod_srcdir = $(top_srcdir)/lib/libvmod_std -vmodtool = $(top_srcdir)/lib/libvcc/vmodtool.py -vmodtoolargs = --strict -vmod_LTLIBRARIES = libvmod_std.la +lib_libvmod_std_libvmod_std_la_SOURCES = \ + lib/libvmod_std/vmod_std.c \ + lib/libvmod_std/vmod_std_conversions.c \ + lib/libvmod_std/vmod_std_fileread.c \ + lib/libvmod_std/vmod_std_querysort.c -libvmod_std_la_LDFLAGS = $(AM_LDFLAGS) -module -export-dynamic -avoid-version -shared +nodist_lib_libvmod_std_libvmod_std_la_SOURCES = \ + lib/libvmod_std/vcc_if.c \ + lib/libvmod_std/vcc_if.h -libvmod_std_la_SOURCES = \ - vmod_std.c \ - vmod_std_conversions.c \ - vmod_std_fileread.c \ - vmod_std_querysort.c +lib/libvmod_std/lib_libvmod_std_libvmod_std_la-vmod_vcc_if.$(OBJEXT) : include/vmod_abi.h -nodist_libvmod_std_la_SOURCES = \ - vcc_if.c \ - vcc_if.h +$(lib_libvmod_std_libvmod_std_la_OBJECTS) : lib/libvmod_std/vcc_if.h include/tbl/vcl_returns.h -# BUILT_SOURCES is only a hack and dependency tracking does not help for the first build -$(libvmod_std_la_OBJECTS): vcc_if.h +# stupid hack to run vmodtool only once +lib/libvmod_std/vcc_if.c \ + lib/libvmod_std/vmod_std.rst \ + lib/libvmod_std/vmod_std.man.rst : lib/libvmod_std/vcc_if.h + @# -vcc_if.c vcc_if.h vmod_std.rst vmod_std.man.rst: $(vmodtool) $(vmod_srcdir)/vmod.vcc - @PYTHON@ $(vmodtool) $(vmodtoolargs) $(vmod_srcdir)/vmod.vcc +lib/libvmod_std/vcc_if.h: $(vmodtool) lib/libvmod_std/vmod.vcc + cd lib/libvmod_std/ && @PYTHON@ ../../$(vmodtool) $(vmodtoolargs) $(abs_top_srcdir)/lib/libvmod_std/vmod.vcc -EXTRA_DIST = vmod.vcc +EXTRA_DIST += lib/libvmod_std/vmod.vcc -CLEANFILES = $(builddir)/vcc_if.c $(builddir)/vcc_if.h \ - $(builddir)/vmod_std.rst \ - $(builddir)/vmod_std.man.rst +CLEANFILES += lib/libvmod_std/vcc_if.c lib/libvmod_std/vcc_if.h \ + lib/libvmod_std/vmod_std.rst \ + lib/libvmod_std/vmod_std.man.rst + diff --git a/man/Makefile.am b/man/Makefile.am index d791d1f..5ad9f48 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,93 +1,91 @@ # -noinst_PROGRAMS = vsc2rst -vsc2rst_SOURCES = vsc2rst.c \ - $(top_srcdir)/include/tbl/vsc_fields.h +noinst_PROGRAMS += man/vsc2rst +man_vsc2rst_SOURCES = man/vsc2rst.c \ + include/tbl/vsc_fields.h -AM_CPPFLAGS = -I$(top_srcdir)/include +man_vsc2rst_CPPFLAGS = -I$(top_srcdir)/include dist_man_MANS = \ - varnish-cli.7 \ - varnish-counters.7 \ - vcl.7 \ - vsl.7 \ - vsl-query.7 \ - varnishadm.1 \ - varnishd.1 \ - varnishhist.1 \ - varnishlog.1 \ - varnishncsa.1 \ - varnishstat.1 \ - varnishtest.1 \ - varnishtop.1 \ - vmod_directors.3 \ - vmod_std.3 - -MAINTAINERCLEANFILES = $(dist_man_MANS) - -RST2ANY_FLAGS = --halt=2 - -varnish-cli.7: $(top_srcdir)/doc/sphinx/reference/varnish-cli.rst + man/varnish-cli.7 \ + man/varnish-counters.7 \ + man/vcl.7 \ + man/vsl.7 \ + man/vsl-query.7 \ + man/varnishadm.1 \ + man/varnishd.1 \ + man/varnishhist.1 \ + man/varnishlog.1 \ + man/varnishncsa.1 \ + man/varnishstat.1 \ + man/varnishtest.1 \ + man/varnishtop.1 \ + man/vmod_directors.3 \ + man/vmod_std.3 + +MAINTAINERCLEANFILES += $(dist_man_MANS) + +man/varnish-cli.7: $(top_srcdir)/doc/sphinx/reference/varnish-cli.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnish-cli.rst $@ -varnish-counters.7: vsc2rst - ./vsc2rst | ${RST2MAN} $(RST2ANY_FLAGS) - $@ +man/varnish-counters.7: $(top_builddir)/man/vsc2rst + $^ | ${RST2MAN} $(RST2ANY_FLAGS) - $@ -vcl.7: $(top_srcdir)/doc/sphinx/reference/vcl.rst \ - $(top_srcdir)/bin/varnishd/builtin.vcl +man/vcl.7: $(top_srcdir)/doc/sphinx/reference/vcl.rst \ + bin/varnishd/builtin.vcl ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/vcl.rst $@ -vsl.7: $(top_srcdir)/doc/sphinx/reference/vsl.rst \ +man/vsl.7: $(top_srcdir)/doc/sphinx/reference/vsl.rst \ $(top_srcdir)/lib/libvarnishapi/vsl-tags.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/vsl.rst $@ -vsl-query.7: $(top_srcdir)/doc/sphinx/reference/vsl-query.rst +man/vsl-query.7: $(top_srcdir)/doc/sphinx/reference/vsl-query.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/vsl-query.rst $@ -varnishadm.1: $(top_srcdir)/doc/sphinx/reference/varnishadm.rst +man/varnishadm.1: $(top_srcdir)/doc/sphinx/reference/varnishadm.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishadm.rst $@ -varnishd.1: \ +man/varnishd.1: \ $(top_srcdir)/doc/sphinx/reference/varnishd.rst \ $(top_srcdir)/doc/sphinx/include/params.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishd.rst $@ -varnishncsa.1: \ +man/varnishncsa.1: \ $(top_srcdir)/doc/sphinx/reference/varnishncsa.rst \ $(top_srcdir)/doc/sphinx/include/varnishncsa_options.rst \ $(top_srcdir)/doc/sphinx/include/varnishncsa_synopsis.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishncsa.rst $@ -varnishlog.1: \ +man/varnishlog.1: \ $(top_srcdir)/doc/sphinx/reference/varnishlog.rst \ $(top_srcdir)/doc/sphinx/include/varnishlog_options.rst \ $(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 +man/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 +man/varnishstat.1: $(top_srcdir)/doc/sphinx/reference/varnishstat.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishstat.rst $@ -varnishtest.1: $(top_srcdir)/doc/sphinx/reference/varnishtest.rst +man/varnishtest.1: $(top_srcdir)/doc/sphinx/reference/varnishtest.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishtest.rst $@ -varnishtop.1: \ +man/varnishtop.1: \ $(top_srcdir)/doc/sphinx/reference/varnishtop.rst \ $(top_srcdir)/doc/sphinx/include/varnishtop_options.rst \ $(top_srcdir)/doc/sphinx/include/varnishtop_synopsis.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishtop.rst $@ -varnishhist.1: \ +man/varnishhist.1: \ $(top_srcdir)/doc/sphinx/reference/varnishhist.rst \ $(top_srcdir)/doc/sphinx/include/varnishhist_options.rst \ $(top_srcdir)/doc/sphinx/include/varnishhist_synopsis.rst ${RST2MAN} $(RST2ANY_FLAGS) $(top_srcdir)/doc/sphinx/reference/varnishhist.rst $@ -vmod_std.3: $(top_builddir)/lib/libvmod_std/vmod_std.man.rst +man/vmod_std.3: $(top_builddir)/lib/libvmod_std/vmod_std.man.rst ${RST2MAN} $(RST2ANY_FLAGS) $? $@ -vmod_directors.3: $(top_builddir)/lib/libvmod_directors/vmod_directors.man.rst +man/vmod_directors.3: $(top_builddir)/lib/libvmod_directors/vmod_directors.man.rst ${RST2MAN} $(RST2ANY_FLAGS) $? $@ -------------- next part -------------- An HTML attachment was scrubbed... URL: From lkarsten at varnish-software.com Tue Sep 8 08:34:26 2015 From: lkarsten at varnish-software.com (Lasse Karstensen) Date: Tue, 8 Sep 2015 10:34:26 +0200 Subject: [PATCH]: redhat startup scripts should no longer use -u user In-Reply-To: <55ED78C2.8030505@redpill-linpro.com> References: <55DE336A.8070408@redpill-linpro.com> <55DEB6D7.8090109@redpill-linpro.com> <55E9AAD8.1020407@redpill-linpro.com> <55ED78C2.8030505@redpill-linpro.com> Message-ID: <20150908083425.GA3539@immer.varnish-software.com> Hi all. I'm a bit late to this thread, as I didn't read it before working on the packaging yesterday. Anyway. Packaging files are now working for 4.1.0 on EL6/EL7, and the packaging setup has been moved here: https://github.com/varnish/varnish-cache-redhat/ This is pulled into https://github.com/varnish/pkg-varnish-cache using git submodules. I haven't done anything with regards to ccgroup so far. -- Lasse Karstensen Varnish Software AS From dridi at varni.sh Tue Sep 8 09:05:59 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Tue, 8 Sep 2015 11:05:59 +0200 Subject: Build system patch In-Reply-To: References: Message-ID: Hi Guillaume, On Tue, Sep 8, 2015 at 9:52 AM, Guillaume Quintard wrote: > Hi all, > > Here's a big patch for the (autotools) build system. It has been one of my > pet peeves, so I took some time during evenings to make it non-recursive. > I'm not sure everybody will be okay with it, but my OCD compelled me to try > :-) This is a topic that actually came up during the VDD last week, nice timing. > One big change is that you don't use "make -C subdir", as there is only one > Makefile now, you have to run it from the top directory. The counterpart is I don't really get this one, I've always found easier to just work from the top, builds are already quite fast. > that it's very easy to define meta-targets without shooting ourselves in the > foot. > > I tested it as best as I could, with -j1, -j32, install, dist, > distcheckyieldsconsistent results AFAICT. Out-of-tree-build works too. I > also built "all" with bmake, and it seemed to work. I haven't tested it yet, but out-of-tree builds are definitely something I've been looking for! Did you try to build the docs? I'm asking because you didn't mention it. > Cheers. > > -- > Guillaume Quintard @Everyone Guillaume's patch made me also realize that the tools are built with sources from libvarnish instead of linking to libvarnish, is there a reason for that? Cheers, Dridi From guillaume at varnish-software.com Tue Sep 8 09:21:03 2015 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Tue, 8 Sep 2015 11:21:03 +0200 Subject: Build system patch In-Reply-To: References: Message-ID: On Tue, Sep 8, 2015 at 11:05 AM, Dridi Boukelmoune wrote: > > Hi Guillaume, > > On Tue, Sep 8, 2015 at 9:52 AM, Guillaume Quintard > wrote: > > One big change is that you don't use "make -C subdir", as there is only one > > Makefile now, you have to run it from the top directory. The counterpart is > > I don't really get this one, I've always found easier to just work > from the top, builds are already quite fast. Well, I've seen people is previous jobs who compiled only the subdir they where in, I don't do it, but I felt it was worth noting :-) > I haven't tested it yet, but out-of-tree builds are definitely > something I've been looking for! Did you try to build the docs? I'm > asking because you didn't mention it. Yes, documentation builds (well, html at least), you can just "make html" and it'll build the tools (*opt2rst) needed to do so. > @Everyone > Guillaume's patch made me also realize that the tools are built with > sources from libvarnish instead of linking to libvarnish, is there a > reason for that? One thing I forgot : I'm not a big fan of autotools, yet I have to admit that once set up, it does the job pretty well. And I also like config.phk for its cleanliness. With only one Makefile to handle, it may be easier to get rid of configure.ac and use phk's config script. -- Guillaume Quintard From martin at varnish-software.com Wed Sep 9 15:31:34 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Wed, 9 Sep 2015 17:31:34 +0200 Subject: [PATCH] Propagate gzip crc checksum up the ESI stack Message-ID: <1441812694-27943-1-git-send-email-martin@varnish-software.com> When tearing down the ESI data structures, propagate the gzip crc checksum up the stack. Fixes: #1781 --- bin/varnishd/cache/cache_esi_deliver.c | 8 +++++++- bin/varnishtest/tests/r01781.vtc | 27 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 bin/varnishtest/tests/r01781.vtc diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c index ff30ae3..1d617b8 100644 --- a/bin/varnishd/cache/cache_esi_deliver.c +++ b/bin/varnishd/cache/cache_esi_deliver.c @@ -228,7 +228,7 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv, uint32_t icrc = 0; uint8_t tailbuf[8 + 5]; const uint8_t *pp; - struct ecx *ecx; + struct ecx *ecx, *pecx; int retval = 0; if (act == VDP_INIT) { @@ -241,6 +241,12 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv, } CAST_OBJ_NOTNULL(ecx, *priv, ECX_MAGIC); if (act == VDP_FINI) { + if (req->transport->deliver == VED_Deliver) { + CAST_OBJ_NOTNULL(pecx, req->transport_priv, ECX_MAGIC); + pecx->crc = crc32_combine(pecx->crc, + ecx->crc, ecx->l_crc); + pecx->l_crc += ecx->l_crc; + } FREE_OBJ(ecx); *priv = NULL; return (0); diff --git a/bin/varnishtest/tests/r01781.vtc b/bin/varnishtest/tests/r01781.vtc new file mode 100644 index 0000000..5b796d8 --- /dev/null +++ b/bin/varnishtest/tests/r01781.vtc @@ -0,0 +1,27 @@ +varnishtest "#1781 gzip checksum with multilevel esi" + +server s1 { + rxreq + txresp -body {Baz} + + rxreq + txresp -body {Bar} + + rxreq + txresp -body {Foo} +} -start + +varnish v1 -vcl+backend { + sub vcl_backend_response { + set beresp.do_gzip = true; + set beresp.do_esi = true; + } +} -start + +client c1 { + txreq -hdr "Accept-Encoding: gzip" + rxresp + expect resp.http.content-encoding == "gzip" + gunzip + expect resp.body == "FooBarBaz" +} -run -- 2.1.4 From phk at phk.freebsd.dk Wed Sep 9 19:30:27 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Wed, 09 Sep 2015 19:30:27 +0000 Subject: [PATCH] Propagate gzip crc checksum up the ESI stack In-Reply-To: <1441812694-27943-1-git-send-email-martin@varnish-software.com> References: <1441812694-27943-1-git-send-email-martin@varnish-software.com> Message-ID: <87961.1441827027@critter.freebsd.dk> -------- In message <1441812694-27943-1-git-send-email-martin at varnish-software.com>, Mar tin Blix Grydeland writes: I have moved the ESI update to be with the place we handle the final CRC in non-included cases for consistency. Many thanks to both Laurent & Martin for getting this fixed, I would have felt utterly silly if we had release 4.1-R with this bug. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From carlos.abalde at gmail.com Thu Sep 10 11:26:28 2015 From: carlos.abalde at gmail.com (Carlos Abalde) Date: Thu, 10 Sep 2015 13:26:28 +0200 Subject: Adding -b (buffer size) parameter to varnishtest Message-ID: Hi, When implementing in VCL complex logic (not necessarily related with caching contents -e.g. access control, rate limiting, etc.-) varnishtest is a powerful tool to automate VCL testing. These type of tests sometimes are complex and they are not easy to split in smaller pieces. In some extreme cases, the varnishlog buffer space allocated by varnishtest is not enough when testing complex VCL logic including a lot of logging. The size of that buffer is currently hard coded and it has been increased in the past [1]. This trivial patch allows selecting the size of that buffer in the command line. [1] https://www.varnish-cache.org/trac/changeset/9511eefcdafea9a6c87f83a46d5e2b1d41c1c2c9 -------------- next part -------------- A non-text attachment was scrubbed... Name: add-buffer-size.patch Type: application/octet-stream Size: 1932 bytes Desc: not available URL: -------------- next part -------------- Best, -- Carlos Abalde From dridi at varni.sh Thu Sep 10 12:56:54 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Thu, 10 Sep 2015 14:56:54 +0200 Subject: Adding -b (buffer size) parameter to varnishtest In-Reply-To: References: Message-ID: On Thu, Sep 10, 2015 at 1:26 PM, Carlos Abalde wrote: > Hi, > > When implementing in VCL complex logic (not necessarily related with caching contents -e.g. access control, rate limiting, etc.-) varnishtest is a powerful tool to automate VCL testing. These type of tests sometimes are complex and they are not easy to split in smaller pieces. Hi Carlos, One nitpick: I believe it should display the default value in the man (and maybe usage too). > Set internal buffer size in KB (default: 512) Cheers, Dridi From phk at phk.freebsd.dk Thu Sep 10 13:00:31 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Thu, 10 Sep 2015 13:00:31 +0000 Subject: Adding -b (buffer size) parameter to varnishtest In-Reply-To: References: Message-ID: <67784.1441890031@critter.freebsd.dk> -------- In message , Dridi Boukelmoune writes: >On Thu, Sep 10, 2015 at 1:26 PM, Carlos Abalde wrote: >> Hi, >> >> When implementing in VCL complex logic (not necessarily related with caching contents -e.g. access control, rate limiting, etc.-) varnishtest is a powerful tool to automate VCL testing. These type of tests sometimes are complex and they are not easy to split in smaller pieces. > >Hi Carlos, > >One nitpick: I believe it should display the default value in the man >(and maybe usage too). Also, please use the VNUM_2bytes() function so one can write "512K" rather than a implied "K" -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From phk at phk.freebsd.dk Thu Sep 10 13:07:35 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Thu, 10 Sep 2015 13:07:35 +0000 Subject: Build system patch In-Reply-To: References: Message-ID: <67858.1441890455@critter.freebsd.dk> -------- In message , Guillaume Quintard writes: Guillaume, I'm very happy you did this, and I need to make up my mind about the Makefile.phk stuffs fate. However, I want to concentrate on getting 4.1 out, so can you come back with this again once we have shoved that out the door ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From guillaume at varnish-software.com Thu Sep 10 13:09:57 2015 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Thu, 10 Sep 2015 15:09:57 +0200 Subject: Build system patch In-Reply-To: <67858.1441890455@critter.freebsd.dk> References: <67858.1441890455@critter.freebsd.dk> Message-ID: Of course. I'll keep a github branch rebased on master to track changes happening in the meantime. -- Guillaume Quintard On Thu, Sep 10, 2015 at 3:07 PM, Poul-Henning Kamp wrote: > -------- > In message > , Guillaume Quintard writes: > > Guillaume, > > I'm very happy you did this, and I need to make up my mind about > the Makefile.phk stuffs fate. > > However, I want to concentrate on getting 4.1 out, so can you come > back with this again once we have shoved that out the door ? > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk at FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. From carlos.abalde at gmail.com Thu Sep 10 14:50:50 2015 From: carlos.abalde at gmail.com (Carlos Abalde) Date: Thu, 10 Sep 2015 16:50:50 +0200 Subject: Adding -b (buffer size) parameter to varnishtest In-Reply-To: <67784.1441890031@critter.freebsd.dk> References: <67784.1441890031@critter.freebsd.dk> Message-ID: <67698CE3-1D39-4462-B85B-CEEF3F6AF9EC@gmail.com> > On 10 Sep 2015, at 15:00, Poul-Henning Kamp wrote: > > -------- > In message > , Dridi Boukelmoune writes: >> On Thu, Sep 10, 2015 at 1:26 PM, Carlos Abalde wrote: >>> Hi, >>> >>> When implementing in VCL complex logic (not necessarily related with caching contents -e.g. access control, rate limiting, etc.-) varnishtest is a powerful tool to automate VCL testing. These type of tests sometimes are complex and they are not easy to split in smaller pieces. >> >> Hi Carlos, >> >> One nitpick: I believe it should display the default value in the man >> (and maybe usage too). > > Also, please use the VNUM_2bytes() function so one can write "512K" > rather than a implied "K" Hi, Thanks! New patch attached: improved docs (default value, alphabetical order) and now using VNUM_2bytes() function. -------------- next part -------------- A non-text attachment was scrubbed... Name: add-buffer-size.patch Type: application/octet-stream Size: 2787 bytes Desc: not available URL: -------------- next part -------------- Best, -- Carlos Abalde From dridi at varni.sh Thu Sep 10 17:38:49 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Thu, 10 Sep 2015 19:38:49 +0200 Subject: [PATCH,VDD15Q3] Changes related to VCL temperature Message-ID: Hi, This is Varnish 4.1 material. I have finally done and tested the changes we had decided to make during the last VDD: - removing the USE event - allowing VMODs to fail a WARM event - VCL reference counting for VMODs - relaxing the "cold" restrictions on cooling VCLs I have found and fixed more issues than anticipated after I updated my DNS director draft to comply to the new rules. I'm happy to say that the director is actually simpler to implement now. I have also updated the documentation along with the code, but I may have missed some changes and I'm running late for tonight's rehearsal :) Best Regards, Dridi -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Get-rid-of-VCL_EVENT_USE.patch Type: text/x-patch Size: 4825 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Turn-VCL-state-magic-numbers-into-an-enum.patch Type: text/x-patch Size: 4480 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Remove-unused-handling.patch Type: text/x-patch Size: 742 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0004-Reserve-space-for-the-cooling-state-in-vcl.list.patch Type: text/x-patch Size: 1389 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0005-VMODs-can-now-fail-a-VCL-warm-up.patch Type: text/x-patch Size: 17301 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0006-VMODs-handling-of-VCL_EVENT_COLD-must-be-failsafe.patch Type: text/x-patch Size: 1108 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0007-Allow-VMODs-to-hold-a-reference-on-a-warm-VCL.patch Type: text/x-patch Size: 5050 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0008-Don-t-allow-a-VCL-transition-from-cooling-to-warm.patch Type: text/x-patch Size: 1646 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0009-Allow-VMODs-to-create-backends-for-a-cooling-VCL.patch Type: text/x-patch Size: 1573 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0010-Catch-a-vcl.state-failure-on-the-manager-side.patch Type: text/x-patch Size: 6918 bytes Desc: not available URL: From lkarsten at varnish-software.com Fri Sep 11 12:59:43 2015 From: lkarsten at varnish-software.com (Lasse Karstensen) Date: Fri, 11 Sep 2015 14:59:43 +0200 Subject: Adding -b (buffer size) parameter to varnishtest In-Reply-To: References: Message-ID: <20150911125942.GB733@immer.varnish-software.com> On Thu, Sep 10, 2015 at 01:26:28PM +0200, Carlos Abalde wrote: > When implementing in VCL complex logic (not necessarily related with caching contents -e.g. access control, rate limiting, etc.-) varnishtest is a powerful tool to automate VCL testing. These type of tests sometimes are complex and they are not easy to split in smaller pieces. > In some extreme cases, the varnishlog buffer space allocated by varnishtest is not enough when testing complex VCL logic including a lot of logging. The size of that buffer is currently hard coded and it has been increased in the past [1]. This trivial patch allows selecting the size of that buffer in the command line. Hi. I've looked up the numbers, after Martin pointed out that 524288 bytes, or 6553 lines 80 character wide, is a lot of log to scroll through when looking for a problem. Measurement strategy here is strlen() on jp->buf where it is being printed/sent to the output. This is when running one test case per varnishtest invocation. At commit 1628f0b, there are 469 test cases. 34 produce more than 50KB log. Of those 34, there are 7 that use more than 100KB: g00007.vtc 101349 r00984.vtc 101711 e00028.vtc 101770 c00023.vtc 109899 b00048.vtc 121389 (runs 60 client requests) r00345.vtc 137132 (32303B without -debug=+workspace) e00017.vtc 147003 -- Lasse Karstensen Varnish Software AS From phk at phk.freebsd.dk Fri Sep 11 13:07:19 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Fri, 11 Sep 2015 13:07:19 +0000 Subject: Adding -b (buffer size) parameter to varnishtest In-Reply-To: <20150911125942.GB733@immer.varnish-software.com> References: <20150911125942.GB733@immer.varnish-software.com> Message-ID: <37459.1441976839@critter.freebsd.dk> -------- In message <20150911125942.GB733 at immer.varnish-software.com>, Lasse Karstensen writes: One Idea I have mulled was to have a "good" keyword in varnishtest scripts which would zero the log at that points. The idea is that scripts would do something like: # First subtest ... expect ... expect ... expect ... good # Second subtest ... expect ... expect ... expect ... good and so on. The reason I have not done this is that I'm not convinced it is a good idea in the first place. Obviously the '-v' argument would have to disable this, so it doesn't solve the bufsize issue. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From fgsch at lodoss.net Fri Sep 11 13:08:37 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 11 Sep 2015 14:08:37 +0100 Subject: Adding -b (buffer size) parameter to varnishtest In-Reply-To: <20150911125942.GB733@immer.varnish-software.com> References: <20150911125942.GB733@immer.varnish-software.com> Message-ID: All these logs use mockup servers. If you are using varnishtest against real servers the length of resulting headers are going to be much larger. Same thing will happen with a real or close to real client. I've run into this many times and I've hacked varnishtest so I'd like to see this in. Also I don't really see any harm on applying this patch, considering how small it is aside from the getopt and usage part. On Fri, Sep 11, 2015 at 1:59 PM, Lasse Karstensen < lkarsten at varnish-software.com> wrote: > On Thu, Sep 10, 2015 at 01:26:28PM +0200, Carlos Abalde wrote: > > When implementing in VCL complex logic (not necessarily related with > caching contents -e.g. access control, rate limiting, etc.-) varnishtest is > a powerful tool to automate VCL testing. These type of tests sometimes are > complex and they are not easy to split in smaller pieces. > > In some extreme cases, the varnishlog buffer space allocated by > varnishtest is not enough when testing complex VCL logic including a lot of > logging. The size of that buffer is currently hard coded and it has been > increased in the past [1]. This trivial patch allows selecting the size of > that buffer in the command line. > > Hi. > > I've looked up the numbers, after Martin pointed out that 524288 bytes, or > 6553 lines > 80 character wide, is a lot of log to scroll through when looking for a > problem. > > Measurement strategy here is strlen() on jp->buf where it is being > printed/sent to the output. This is when running one test case per > varnishtest invocation. > > At commit 1628f0b, there are 469 test cases. 34 produce more than 50KB log. > Of those 34, there are 7 that use more than 100KB: > > g00007.vtc 101349 > r00984.vtc 101711 > e00028.vtc 101770 > c00023.vtc 109899 > b00048.vtc 121389 (runs 60 client requests) > r00345.vtc 137132 (32303B without -debug=+workspace) > e00017.vtc 147003 > > -- > Lasse Karstensen > Varnish Software AS > > _______________________________________________ > varnish-dev mailing list > varnish-dev at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dridi at varni.sh Fri Sep 11 13:09:51 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Fri, 11 Sep 2015 15:09:51 +0200 Subject: Adding -b (buffer size) parameter to varnishtest In-Reply-To: <20150911125942.GB733@immer.varnish-software.com> References: <20150911125942.GB733@immer.varnish-software.com> Message-ID: > At commit 1628f0b, there are 469 test cases. 34 produce more than 50KB log. > Of those 34, there are 7 that use more than 100KB: I think it is interesting for VMOD writers or even Varnish users that want to test their VCL+backends to be able to raise this value. Especially when you want to reproduce a regression that may involve many steps. Dridi From phk at phk.freebsd.dk Fri Sep 11 13:19:59 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Fri, 11 Sep 2015 13:19:59 +0000 Subject: Adding -b (buffer size) parameter to varnishtest In-Reply-To: References: <20150911125942.GB733@immer.varnish-software.com> Message-ID: <39323.1441977599@critter.freebsd.dk> -------- In message , Federico Schwindt writes: >I've run into this many times and I've hacked varnishtest so I'd like to >see this in. I'm very much for the patch, (with the VNUM change I requested). -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From artur.sitarski at gmail.com Fri Sep 11 14:16:59 2015 From: artur.sitarski at gmail.com (Artur Sitarski) Date: Fri, 11 Sep 2015 16:16:59 +0200 Subject: Varnish 4, response time (timers) Message-ID: Hi, I would like to extract response time information from Varnish 4. By response time I mean time from delegation to backend to first byte from backend. Last working module (timers: https://github.com/jib/libvmod-timers) was based on t_resp field in sess structure; req_response_time() function. It was changed here https://github.com/varnish/Varnish-Cache/commit/c2043664d86377909145e1e54f84c58fc40858ad#diff-d615c3d3f4a6645649d338662fbd20f0L678 I'm trying to find which filed contains that information in varnish4. Is anyone able to help? Cheers, Artur Sitarski -------------- next part -------------- An HTML attachment was scrubbed... URL: From dridi at varni.sh Fri Sep 11 14:17:38 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Fri, 11 Sep 2015 16:17:38 +0200 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences Message-ID: Hi, During last week's training it came up. People were confused to see so much information with varnishlog but not something they consider important. It would be useful/comforting to them to see it when troubleshooting Varnish. I personally don't have an opinion, it's been a while since I last had to deal with Varnish in production. I made this patch because it is trivial. Best Regards, Dridi -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Log-set-beresp.uncacheable-true-occurrences.patch Type: text/x-patch Size: 1865 bytes Desc: not available URL: From fgsch at lodoss.net Fri Sep 11 14:54:46 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 11 Sep 2015 15:54:46 +0100 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences In-Reply-To: References: Message-ID: I don't have an opinion either. That said, this variable is also set for passes. In that case people checking this variable will find it set but there won't be any logging. Not sure if that's an issue but I'd argue is not consistent. On Fri, Sep 11, 2015 at 3:17 PM, Dridi Boukelmoune wrote: > Hi, > > During last week's training it came up. People were confused to see > so much information with varnishlog but not something they consider > important. It would be useful/comforting to them to see it when > troubleshooting Varnish. > > I personally don't have an opinion, it's been a while since I last had > to deal with Varnish in production. I made this patch because it is > trivial. > > Best Regards, > Dridi > > _______________________________________________ > varnish-dev mailing list > varnish-dev at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dridi at varni.sh Fri Sep 11 15:07:09 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Fri, 11 Sep 2015 17:07:09 +0200 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences In-Reply-To: References: Message-ID: On Fri, Sep 11, 2015 at 4:54 PM, Federico Schwindt wrote: > I don't have an opinion either. > That said, this variable is also set for passes. In that case people > checking this variable will find it set but there won't be any logging. Isn't it bereq.uncacheable that is set for passes? > Not sure if that's an issue but I'd argue is not consistent. Maybe I should use a better name instead? This is logged when VCL sets this variable, not varnishd itself. From fgsch at lodoss.net Fri Sep 11 15:22:38 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Fri, 11 Sep 2015 16:22:38 +0100 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences In-Reply-To: References: Message-ID: On Fri, Sep 11, 2015 at 4:07 PM, Dridi Boukelmoune wrote: > On Fri, Sep 11, 2015 at 4:54 PM, Federico Schwindt > wrote: > > I don't have an opinion either. > > That said, this variable is also set for passes. In that case people > > checking this variable will find it set but there won't be any logging. > > Isn't it bereq.uncacheable that is set for passes? > >From the docs: Inherited from bereq.uncacheable, see there. > > > Not sure if that's an issue but I'd argue is not consistent. > > Maybe I should use a better name instead? This is logged when VCL sets > this variable, not varnishd itself. > That's my concern. It will only appear when it's set from VCL. As a counter example, the TTL tag is logged when it's changed from code (varnishd) and VCL using "RFC" and "VCL", respectively. Either way, it might be ok, no further opinion really. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dridi at varni.sh Fri Sep 11 16:48:30 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Fri, 11 Sep 2015 18:48:30 +0200 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences In-Reply-To: References: Message-ID: > Either way, it might be ok, no further opinion really. New patch based on your feedback :) -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Log-set-beresp.uncacheable-true-occurrences.patch Type: text/x-patch Size: 2905 bytes Desc: not available URL: From phk at phk.freebsd.dk Fri Sep 11 18:00:47 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Fri, 11 Sep 2015 18:00:47 +0000 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences In-Reply-To: References: Message-ID: <40183.1441994447@critter.freebsd.dk> -------- In message , Dridi Boukelmoune writes: >During last week's training it came up. People were confused to see >so much information with varnishlog but not something they consider >important. It would be useful/comforting to them to see it when >troubleshooting Varnish. We have already made it the norm that all changes to HTTP headers are VSL'ed. Maybe we should simply extend that so that all VCL variables spit out a VSL when you set them ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From fgsch at lodoss.net Sat Sep 12 10:55:23 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Sat, 12 Sep 2015 11:55:23 +0100 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences In-Reply-To: References: Message-ID: Since nitpicking is my name: > + VSLb(bo->vsl, SLT_Uncacheable, "Illegal Vary header"); Before this there is a SLT_Error with "Illegal 'Vary' header from backend, making this a pass.". Repeating the reason here seems redundant. > + if (bo->do_pass) { > + bo->uncacheable = 1; > + VSLb(bo->vsl, SLT_Uncacheable, "bereq"); > + } We could argue that this is uncacheable at the time we returned pass. Also "bereq" doesn't really tell us anything. Furthermore, doing it in here will result in this being logged twice in some cases. On Fri, Sep 11, 2015 at 5:48 PM, Dridi Boukelmoune wrote: > > Either way, it might be ok, no further opinion really. > > New patch based on your feedback :) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dridi at varni.sh Sat Sep 12 11:52:35 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Sat, 12 Sep 2015 13:52:35 +0200 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences In-Reply-To: References: Message-ID: On Sat, Sep 12, 2015 at 12:55 PM, Federico Schwindt wrote: > Since nitpicking is my name: > >> + VSLb(bo->vsl, SLT_Uncacheable, "Illegal Vary >> header"); > > Before this there is a SLT_Error with "Illegal 'Vary' header from backend, > making this a pass.". Repeating the reason here seems redundant. One is an error, the other is informing you that beresp.uncacheable is set to true (and why). If we instead follow phk's suggestion we could remove said duplication by having something like: VCL_set beresp.uncacheable true >> + if (bo->do_pass) { >> + bo->uncacheable = 1; >> + VSLb(bo->vsl, SLT_Uncacheable, "bereq"); >> + } > > We could argue that this is uncacheable at the time we returned pass. Also > "bereq" doesn't really tell us anything. It tells you that beresp.uncacheable is true because of the bereq. So obviously either the log record or the docs need to be improved, or again, phk's suggestion would make things simpler (for the user). > Furthermore, doing it in here will result in this being logged twice in some > cases. Yes, but it is logged for different reasons, and actually set twice, so I'd rather see it logged twice for consistency. From fgsch at lodoss.net Sat Sep 12 12:04:25 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Sat, 12 Sep 2015 13:04:25 +0100 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences In-Reply-To: References: Message-ID: On Sat, Sep 12, 2015 at 12:52 PM, Dridi Boukelmoune wrote: > On Sat, Sep 12, 2015 at 12:55 PM, Federico Schwindt > wrote: > > Since nitpicking is my name: > > > >> + VSLb(bo->vsl, SLT_Uncacheable, "Illegal Vary > >> header"); > > > > Before this there is a SLT_Error with "Illegal 'Vary' header from > backend, > > making this a pass.". Repeating the reason here seems redundant. > > One is an error, the other is informing you that beresp.uncacheable is > set to true (and why). > Fair enough. > > If we instead follow phk's suggestion we could remove said duplication > by having something like: > VCL_set beresp.uncacheable true > > >> + if (bo->do_pass) { > >> + bo->uncacheable = 1; > >> + VSLb(bo->vsl, SLT_Uncacheable, "bereq"); > >> + } > > > > We could argue that this is uncacheable at the time we returned pass. > Also > > "bereq" doesn't really tell us anything. > > It tells you that beresp.uncacheable is true because of the bereq. So > obviously either the log record or the docs need to be improved, or > again, phk's suggestion would make things simpler (for the user). > Still doesn't say a thing to me. The pass happens in recv (client side) not in bereq (backend side). Explaining obscure things in the doc is not the right way to go. If anything it should complement an already well explained situation. > > > Furthermore, doing it in here will result in this being logged twice in > some > > cases. > > Yes, but it is logged for different reasons, and actually set twice, > so I'd rather see it logged twice for consistency. > I'd rather move it where it belongs, that is where do_pass is set to 1. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dridi at varni.sh Sat Sep 12 12:52:23 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Sat, 12 Sep 2015 14:52:23 +0200 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences In-Reply-To: References: Message-ID: > Still doesn't say a thing to me. The pass happens in recv (client side) not > in bereq (backend side). > Explaining obscure things in the doc is not the right way to go. If anything > it should complement an already well explained situation. I meant improving the docs in my patch, like for example the long description of the VSL record (enumerating the reasons and their meaning). > I'd rather move it where it belongs, that is where do_pass is set to 1. But do_pass is bereq.uncacheable, and until you actually get a response from the backend I don't think it would make sense to log that beresp.uncacheable has been set. From fgsch at lodoss.net Sat Sep 12 13:58:13 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Sat, 12 Sep 2015 14:58:13 +0100 Subject: [PATCH] Log 'set beresp.uncacheable = true' occurrences In-Reply-To: References: Message-ID: On Sat, Sep 12, 2015 at 1:52 PM, Dridi Boukelmoune wrote: > [..] > > I'd rather move it where it belongs, that is where do_pass is set to 1. > > But do_pass is bereq.uncacheable, and until you actually get a > response from the backend I don't think it would make sense to log > that beresp.uncacheable has been set. > You are not logging that beresp.uncacheable has been set in this case though, you're logging the fact that the response won't be cacheable. It'd be different if it's done in VCL. Personally I think it will be less confusing if we log things as they occur. YMMV. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fgsch at lodoss.net Sat Sep 12 20:03:51 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Sat, 12 Sep 2015 21:03:51 +0100 Subject: [PATCH] Set error if callback returned < 0 Message-ID: Error message will be reported as e.g. "Connection refused" instead of simply "(null)". OK? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Set-error-if-callback-returned-0.patch Type: text/x-patch Size: 757 bytes Desc: not available URL: From phk at phk.freebsd.dk Mon Sep 14 07:21:05 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Mon, 14 Sep 2015 07:21:05 +0000 Subject: [PATCH] Set error if callback returned < 0 In-Reply-To: References: Message-ID: <80579.1442215265@critter.freebsd.dk> -------- In message , Federico Schwindt writes: > Error message will be reported as e.g. "Connection refused" instead of simply " > (null)". > > OK? I don't think that is helpful. First, we have no idea if the errno at that point corresponds to whatever the iterator function failed on, and second there may not even be an associated errno. The correct solution would be to pass the 'err' variable to the iterator so it can set an appropriate text. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From fgsch at lodoss.net Mon Sep 14 07:50:30 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Mon, 14 Sep 2015 08:50:30 +0100 Subject: [PATCH] Set error if callback returned < 0 In-Reply-To: <80579.1442215265@critter.freebsd.dk> References: <80579.1442215265@critter.freebsd.dk> Message-ID: True but I didn't want to do lots of changes considering the time (of the release cycle). If that's OK I will submit a new patch. On Mon, Sep 14, 2015 at 8:21 AM, Poul-Henning Kamp wrote: > -------- > In message < > CAJV_h0awgGdr2qiSkuTdOkC7COC6B7BzAj_8DEMRCbcLY58v4w at mail.gmail.com>, > Federico Schwindt writes: > > > Error message will be reported as e.g. "Connection refused" instead of > simply " > > (null)". > > > > OK? > > I don't think that is helpful. > > First, we have no idea if the errno at that point corresponds to whatever > the iterator function failed on, and second there may not even be an > associated errno. > > The correct solution would be to pass the 'err' variable to the iterator > so it can set an appropriate text. > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk at FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From phk at phk.freebsd.dk Mon Sep 14 07:52:21 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Mon, 14 Sep 2015 07:52:21 +0000 Subject: [PATCH] Set error if callback returned < 0 In-Reply-To: References: <80579.1442215265@critter.freebsd.dk> Message-ID: <88166.1442217141@critter.freebsd.dk> -------- In message , Federico Schwindt writes: >--001a113d6772d274e4051fb05120 >True but I didn't want to do lots of changes considering the time (of the >release cycle). >If that's OK I will submit a new patch. I think it's ok. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From kacperw at gmail.com Wed Sep 16 10:35:08 2015 From: kacperw at gmail.com (Kacper Wysocki) Date: Wed, 16 Sep 2015 12:35:08 +0200 Subject: [PATCH] fix phk build system Message-ID: Hi all, attached patch fixes the phk buildsystem as of master, except for the sphinx doc stuff. As far as I understand the build system only takes into account one binary per subdirectory, and the noinst_PROGRAMS varnish{top,hist,ncsa,..}_opt2rst are giving me some greif. A discussion with Martin at the VDD concluded that a good way to clean this up would be to take the opt2rst functions into each binary as an undocumented option. I'll be happy to try that if noone objects. I've also taken a tiny look at Guillaume's build patches and I like those. Don't count myself as strongly-for-anything, even though you can definitely list autocrap in my pet peeves, but I just don't like broken things lying around.. -Kacper -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-fix-phk-buildsystem.patch Type: text/x-patch Size: 9803 bytes Desc: not available URL: From phk at phk.freebsd.dk Wed Sep 16 10:38:39 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Wed, 16 Sep 2015 10:38:39 +0000 Subject: [PATCH] fix phk build system In-Reply-To: References: Message-ID: <59844.1442399919@critter.freebsd.dk> -------- In message , Kacper Wysocki writes: >A discussion with Martin at the VDD concluded that a good way to clean this up >would be to take the opt2rst functions into each binary as an >undocumented option. I'll be happy to try that if noone objects. I think that makes sense. We also have the RST emitting stuff integrated in varnishd, and it's not like diskspace is horribly expensive these days. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From guillaume at varnish-software.com Wed Sep 16 12:00:36 2015 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Wed, 16 Sep 2015 14:00:36 +0200 Subject: [PATCH] fix phk build system In-Reply-To: <59844.1442399919@critter.freebsd.dk> References: <59844.1442399919@critter.freebsd.dk> Message-ID: I thought the problem had more to do with ordering build targets and less with what binary was used, so merging de *_opt2rst may not help. And I see no real reason for a binary to output rst. However, it would greatly improve readability/maintainability (that could be done using GNU make features, but we'd lose bmake compatibility), and I'm all for that. -- Guillaume Quintard On Wed, Sep 16, 2015 at 12:38 PM, Poul-Henning Kamp wrote: > -------- > In message > , Kacper Wysocki writes: > >>A discussion with Martin at the VDD concluded that a good way to clean this up >>would be to take the opt2rst functions into each binary as an >>undocumented option. I'll be happy to try that if noone objects. > > I think that makes sense. We also have the RST emitting stuff integrated > in varnishd, and it's not like diskspace is horribly expensive these days. > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk at FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > > _______________________________________________ > varnish-dev mailing list > varnish-dev at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev From fgsch at lodoss.net Wed Sep 16 12:54:57 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Wed, 16 Sep 2015 13:54:57 +0100 Subject: [PATCH] fix phk build system In-Reply-To: References: <59844.1442399919@critter.freebsd.dk> Message-ID: I never quite understood why we have binaries output'ing .rst. It's not like the options change daily. On Wed, Sep 16, 2015 at 1:00 PM, Guillaume Quintard < guillaume at varnish-software.com> wrote: > I thought the problem had more to do with ordering build targets and > less with what binary was used, so merging de *_opt2rst may not help. > And I see no real reason for a binary to output rst. > > However, it would greatly improve readability/maintainability (that > could be done using GNU make features, but we'd lose bmake > compatibility), and I'm all for that. > -- > Guillaume Quintard > > > On Wed, Sep 16, 2015 at 12:38 PM, Poul-Henning Kamp > wrote: > > -------- > > In message < > CABaBnj48U7gS7F7UfY5kzFOgVnk2JPp3ob7m2HGv2xiQNkjOpw at mail.gmail.com> > > , Kacper Wysocki writes: > > > >>A discussion with Martin at the VDD concluded that a good way to clean > this up > >>would be to take the opt2rst functions into each binary as an > >>undocumented option. I'll be happy to try that if noone objects. > > > > I think that makes sense. We also have the RST emitting stuff integrated > > in varnishd, and it's not like diskspace is horribly expensive these > days. > > > > -- > > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > > phk at FreeBSD.ORG | TCP/IP since RFC 956 > > FreeBSD committer | BSD since 4.3-tahoe > > Never attribute to malice what can adequately be explained by > incompetence. > > > > _______________________________________________ > > varnish-dev mailing list > > varnish-dev at varnish-cache.org > > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > > _______________________________________________ > varnish-dev mailing list > varnish-dev at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kacperw at gmail.com Wed Sep 16 13:35:52 2015 From: kacperw at gmail.com (Kacper Wysocki) Date: Wed, 16 Sep 2015 15:35:52 +0200 Subject: [PATCH] fix phk build system In-Reply-To: References: <59844.1442399919@critter.freebsd.dk> Message-ID: Fair point. there may or may not be more engineering effort into making opt2rst and the associated build system changes than it would actually take to update the rst files once in a while. I am just guessing here, but perhaps the initial rationale was how to keep the documentation up to date with the code without anyone having to think about the options? On Wed, Sep 16, 2015 at 2:54 PM, Federico Schwindt wrote: > I never quite understood why we have binaries output'ing .rst. It's not > like the options change daily. > > > > On Wed, Sep 16, 2015 at 1:00 PM, Guillaume Quintard > wrote: >> >> I thought the problem had more to do with ordering build targets and >> less with what binary was used, so merging de *_opt2rst may not help. >> And I see no real reason for a binary to output rst. >> >> However, it would greatly improve readability/maintainability (that >> could be done using GNU make features, but we'd lose bmake >> compatibility), and I'm all for that. >> -- >> Guillaume Quintard >> >> >> On Wed, Sep 16, 2015 at 12:38 PM, Poul-Henning Kamp >> wrote: >> > -------- >> > In message >> > >> > , Kacper Wysocki writes: >> > >> >>A discussion with Martin at the VDD concluded that a good way to clean >> >> this up >> >>would be to take the opt2rst functions into each binary as an >> >>undocumented option. I'll be happy to try that if noone objects. >> > >> > I think that makes sense. We also have the RST emitting stuff >> > integrated >> > in varnishd, and it's not like diskspace is horribly expensive these >> > days. >> > >> > -- >> > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 >> > phk at FreeBSD.ORG | TCP/IP since RFC 956 >> > FreeBSD committer | BSD since 4.3-tahoe >> > Never attribute to malice what can adequately be explained by >> > incompetence. >> > >> > _______________________________________________ >> > varnish-dev mailing list >> > varnish-dev at varnish-cache.org >> > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev >> >> _______________________________________________ >> varnish-dev mailing list >> varnish-dev at varnish-cache.org >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > > > > _______________________________________________ > varnish-dev mailing list > varnish-dev at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev -- http://comotion.delta9.pl http://u.delta9.pl http://kacper.doesntexist.org Too much order is its own chaos. Employ no technique to gain supreme enlightment. From martin at varnish-software.com Wed Sep 16 13:49:04 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Wed, 16 Sep 2015 15:49:04 +0200 Subject: [PATCH] fix phk build system In-Reply-To: References: <59844.1442399919@critter.freebsd.dk> Message-ID: On 16 September 2015 at 15:35, Kacper Wysocki wrote: > Fair point. there may or may not be more engineering effort into > making opt2rst and the associated build system changes than it would > actually take to update the rst files once in a while. > Once in a while sounds like an event happening fairly regularly and always coincides with releases. Real life studies have shown that that is indeed the case, but unfortunately there is a strict time ordering where the release always happens just before the doc update. > I am just guessing here, but perhaps the initial rationale was how to > keep the documentation up to date with the code without anyone having > to think about the options? > Yes, this should be considered a work around of the natural law mentioned above. Martin > > On Wed, Sep 16, 2015 at 2:54 PM, Federico Schwindt > wrote: > > I never quite understood why we have binaries output'ing .rst. It's not > > like the options change daily. > > > > > > > > On Wed, Sep 16, 2015 at 1:00 PM, Guillaume Quintard > > wrote: > >> > >> I thought the problem had more to do with ordering build targets and > >> less with what binary was used, so merging de *_opt2rst may not help. > >> And I see no real reason for a binary to output rst. > >> > >> However, it would greatly improve readability/maintainability (that > >> could be done using GNU make features, but we'd lose bmake > >> compatibility), and I'm all for that. > >> -- > >> Guillaume Quintard > >> > >> > >> On Wed, Sep 16, 2015 at 12:38 PM, Poul-Henning Kamp > > >> wrote: > >> > -------- > >> > In message > >> > > >> > , Kacper Wysocki writes: > >> > > >> >>A discussion with Martin at the VDD concluded that a good way to clean > >> >> this up > >> >>would be to take the opt2rst functions into each binary as an > >> >>undocumented option. I'll be happy to try that if noone objects. > >> > > >> > I think that makes sense. We also have the RST emitting stuff > >> > integrated > >> > in varnishd, and it's not like diskspace is horribly expensive these > >> > days. > >> > > >> > -- > >> > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > >> > phk at FreeBSD.ORG | TCP/IP since RFC 956 > >> > FreeBSD committer | BSD since 4.3-tahoe > >> > Never attribute to malice what can adequately be explained by > >> > incompetence. > >> > > >> > _______________________________________________ > >> > varnish-dev mailing list > >> > varnish-dev at varnish-cache.org > >> > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > >> > >> _______________________________________________ > >> varnish-dev mailing list > >> varnish-dev at varnish-cache.org > >> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > > > > > > > > _______________________________________________ > > varnish-dev mailing list > > varnish-dev at varnish-cache.org > > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > > > > -- > http://comotion.delta9.pl > http://u.delta9.pl > http://kacper.doesntexist.org > Too much order is its own chaos. > Employ no technique to gain supreme enlightment. > > _______________________________________________ > varnish-dev mailing list > varnish-dev at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > -- *Martin Blix Grydeland* Senior Developer | Varnish Software AS Mobile: +47 992 74 756 We Make Websites Fly! -------------- next part -------------- An HTML attachment was scrubbed... URL: From phk at phk.freebsd.dk Wed Sep 16 13:52:24 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Wed, 16 Sep 2015 13:52:24 +0000 Subject: [PATCH] fix phk build system In-Reply-To: References: <59844.1442399919@critter.freebsd.dk> Message-ID: <73408.1442411544@critter.freebsd.dk> -------- In message , Federico Schwindt writes: >I never quite understood why we have binaries output'ing .rst. It's not >like the options change daily. Because that way the RST does change when the program does. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From fgsch at lodoss.net Wed Sep 16 14:45:48 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Wed, 16 Sep 2015 15:45:48 +0100 Subject: [PATCH] fix phk build system In-Reply-To: <73408.1442411544@critter.freebsd.dk> References: <59844.1442399919@critter.freebsd.dk> <73408.1442411544@critter.freebsd.dk> Message-ID: I appreciate that but I don't think the extra complexity / compilation time is needed. On Wed, Sep 16, 2015 at 2:52 PM, Poul-Henning Kamp wrote: > -------- > In message NeKCBo2FC3KKv12w at mail.gmail.com> > , Federico Schwindt writes: > > >I never quite understood why we have binaries output'ing .rst. It's not > >like the options change daily. > > Because that way the RST does change when the program does. > > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk at FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From phk at phk.freebsd.dk Wed Sep 16 14:52:16 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Wed, 16 Sep 2015 14:52:16 +0000 Subject: [PATCH] fix phk build system In-Reply-To: References: <59844.1442399919@critter.freebsd.dk> <73408.1442411544@critter.freebsd.dk> Message-ID: <73572.1442415136@critter.freebsd.dk> -------- In message , Federico Schwindt writes: >I appreciate that but I don't think the extra complexity / compilation time >is needed. Separate programs ? No. But built into the existing program is fine with me. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From fgsch at lodoss.net Wed Sep 16 14:58:37 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Wed, 16 Sep 2015 15:58:37 +0100 Subject: [PATCH] fix phk build system In-Reply-To: <73572.1442415136@critter.freebsd.dk> References: <59844.1442399919@critter.freebsd.dk> <73408.1442411544@critter.freebsd.dk> <73572.1442415136@critter.freebsd.dk> Message-ID: Why? If you add an option, you still need to edit a file. So why not edit 2 instead and update the parameters? On Wed, Sep 16, 2015 at 3:52 PM, Poul-Henning Kamp wrote: > -------- > In message < > CAJV_h0YpcwvER3yU4JdYWFL3jTkJaC5fOsmd2qpeEkVuLHSb4w at mail.gmail.com> > , Federico Schwindt writes: > > >I appreciate that but I don't think the extra complexity / compilation > time > >is needed. > > Separate programs ? No. > > But built into the existing program is fine with me. > > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk at FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From phk at phk.freebsd.dk Wed Sep 16 15:23:34 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Wed, 16 Sep 2015 15:23:34 +0000 Subject: [PATCH] fix phk build system In-Reply-To: References: <59844.1442399919@critter.freebsd.dk> <73408.1442411544@critter.freebsd.dk> <73572.1442415136@critter.freebsd.dk> Message-ID: <73658.1442417014@critter.freebsd.dk> -------- In message , Federico Schwindt writes: >If you add an option, you still need to edit a file. So why not edit 2 >instead and update the parameters? I'm a big fan of things that work automatically so that I don't have to remember what the other file I have to remember might possibly be. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From phk at phk.freebsd.dk Mon Sep 21 11:49:58 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Mon, 21 Sep 2015 11:49:58 +0000 Subject: Build system patch In-Reply-To: References: Message-ID: <84577.1442836198@critter.freebsd.dk> -------- In message , Guillaume Quintard writes: >Here's a big patch for the (autotools) build system. It has been one of my >pet peeves, so I took some time during evenings to make it non-recursive. >I'm not sure everybody will be okay with it, but my OCD compelled me to try >:-) I have not been able to get the patch out of the email and the copy in patchwork seems to have the same problem. Can you try again with the patch as an actual attachment ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From guillaume at varnish-software.com Mon Sep 21 11:55:45 2015 From: guillaume at varnish-software.com (Guillaume Quintard) Date: Mon, 21 Sep 2015 13:55:45 +0200 Subject: Build system patch In-Reply-To: References: <84577.1442836198@critter.freebsd.dk> Message-ID: re-adding the list in cc. -- Guillaume Quintard On Mon, Sep 21, 2015 at 1:54 PM, Guillaume Quintard < guillaume at varnish-software.com> wrote: > Sure, here you go. Please note I haven't integrated new changes since I > first posted (was waiting for the 4.1 release) > > -- > Guillaume Quintard > > On Mon, Sep 21, 2015 at 1:49 PM, Poul-Henning Kamp > wrote: > >> -------- >> In message > m44c-Qw at mail.gmail.com> >> , Guillaume Quintard writes: >> >> >Here's a big patch for the (autotools) build system. It has been one of >> my >> >pet peeves, so I took some time during evenings to make it non-recursive. >> >I'm not sure everybody will be okay with it, but my OCD compelled me to >> try >> >:-) >> >> I have not been able to get the patch out of the email and the copy >> in patchwork seems to have the same problem. >> >> Can you try again with the patch as an actual attachment ? >> >> -- >> Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 >> phk at FreeBSD.ORG | TCP/IP since RFC 956 >> FreeBSD committer | BSD since 4.3-tahoe >> Never attribute to malice what can adequately be explained by >> incompetence. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: non-recursive_build.patch Type: text/x-patch Size: 74447 bytes Desc: not available URL: From fgsch at lodoss.net Mon Sep 21 12:18:40 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Mon, 21 Sep 2015 13:18:40 +0100 Subject: Adding -b (buffer size) parameter to varnishtest In-Reply-To: <67698CE3-1D39-4462-B85B-CEEF3F6AF9EC@gmail.com> References: <67784.1441890031@critter.freebsd.dk> <67698CE3-1D39-4462-B85B-CEEF3F6AF9EC@gmail.com> Message-ID: Committed. Thanks for the patch Carlos! On Thu, Sep 10, 2015 at 3:50 PM, Carlos Abalde wrote: > > > On 10 Sep 2015, at 15:00, Poul-Henning Kamp wrote: > > > > -------- > > In message f53dbP-KogJ7Cepb1t_vZjDpfTgSaCu6Ptdw8GB05Q at mail.gmail.com> > > , Dridi Boukelmoune writes: > >> On Thu, Sep 10, 2015 at 1:26 PM, Carlos Abalde > wrote: > >>> Hi, > >>> > >>> When implementing in VCL complex logic (not necessarily related with > caching contents -e.g. access control, rate limiting, etc.-) varnishtest is > a powerful tool to automate VCL testing. These type of tests sometimes are > complex and they are not easy to split in smaller pieces. > >> > >> Hi Carlos, > >> > >> One nitpick: I believe it should display the default value in the man > >> (and maybe usage too). > > > > Also, please use the VNUM_2bytes() function so one can write "512K" > > rather than a implied "K" > > Hi, > > Thanks! New patch attached: improved docs (default value, alphabetical > order) and now using VNUM_2bytes() function. > > > > > Best, > > -- > Carlos Abalde > > > _______________________________________________ > varnish-dev mailing list > varnish-dev at varnish-cache.org > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From phk at phk.freebsd.dk Mon Sep 21 12:25:15 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Mon, 21 Sep 2015 12:25:15 +0000 Subject: [PATCH] fix phk build system In-Reply-To: References: Message-ID: <23946.1442838315@critter.freebsd.dk> -------- In message , Kacper Wysocki writes: >attached patch fixes the phk buildsystem as of master, except for the >sphinx doc stuff. Committed with a couple of bits of polish. Thanks! -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From fgsch at lodoss.net Mon Sep 21 12:40:27 2015 From: fgsch at lodoss.net (Federico Schwindt) Date: Mon, 21 Sep 2015 13:40:27 +0100 Subject: Fix accept_filter for GNU/Linux In-Reply-To: References: <20150902182340.793a7c35@taghos.com.br> <20150904093147.17c5c665@taghos.com.br> <20150904102645.5cb433db@taghos.com.br> Message-ID: Hi, For a chance to get this included in 4.1 (although it'd be off by default) can you test the attached patch with real traffic and report back? Please note this patch has the accept_filter feature enabled so there is no need to do anything besides ensuring it works as expected. Thanks. On Fri, Sep 4, 2015 at 3:12 PM, Federico Schwindt wrote: > > > On Fri, Sep 4, 2015 at 2:26 PM, Rafael Zalamena > wrote: > >> Em Fri, 4 Sep 2015 13:42:40 +0100 >> Federico Schwindt escreveu: >> >> > Diff aside looking at the code my impression is that the >> VTCP_filter_http() >> > function is meant to be compiled in always so erroring out if it's not >> > supported might be wrong here, or at least not when errno is EOPNOTSUPP/ >> > multiple times. >> >> People without it must have a way to find it out. The old way was not >> including any code and avoid it at all, but then we had a code that >> behaves >> differently according to the system which seems better than not giving >> any clues. >> > > The older code will always include VTCP_filter_http() for Linux, it was > not calling it though. > > >> >> > On 4 Sep 2015 1:35 pm, "Federico Schwindt" wrote: >> > >> > > Did you see my second diff? :) >> > --- SNIPPED --- >> >> Yes, I read your second diff. >> >> I agree with you that it would be better to kill the accept_filter >> param ifdef guards to keep it avaliable in every system, but I don't >> think it's a good idea to break the old behavior because people might >> be expecting it. That's why I suggested the TCP_DEFER_ACCEPT detection >> to make the code more portable instead of just looking for __linux. >> > > My second diff doesn't change any behaviour so nothing will break unless > you enable it. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: accept-filter-linux.patch Type: text/x-patch Size: 778 bytes Desc: not available URL: From phk at phk.freebsd.dk Mon Sep 21 12:45:06 2015 From: phk at phk.freebsd.dk (Poul-Henning Kamp) Date: Mon, 21 Sep 2015 12:45:06 +0000 Subject: Fix accept_filter for GNU/Linux In-Reply-To: References: <20150902182340.793a7c35@taghos.com.br> <20150904093147.17c5c665@taghos.com.br> <20150904102645.5cb433db@taghos.com.br> Message-ID: <57233.1442839506@critter.freebsd.dk> -------- In message , Federico Schwindt writes: >For a chance to get this included in 4.1 (although it'd be off by default) >can you test the attached patch with real traffic and report back? > >Please note this patch has the accept_filter feature enabled so there is no >need to do anything besides ensuring it works as expected. Let me clarify my stance: I have no objection to adding this as "default disabled" in 4.1-R, as long as we have tangible evidence that enabling it actually works on at least some Linux distros. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk at FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From martin at varnish-software.com Tue Sep 22 14:09:22 2015 From: martin at varnish-software.com (Martin Blix Grydeland) Date: Tue, 22 Sep 2015 16:09:22 +0200 Subject: [PATCH] Only add size of struct object when using default storeobj_methods Message-ID: <1442930962-22512-1-git-send-email-martin@varnish-software.com> --- bin/varnishd/storage/stevedore.c | 14 ++++++-------- bin/varnishd/storage/storage_persistent.c | 4 +++- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/varnishd/storage/stevedore.c b/bin/varnishd/storage/stevedore.c index 77a601c..0929ba8 100644 --- a/bin/varnishd/storage/stevedore.c +++ b/bin/varnishd/storage/stevedore.c @@ -219,12 +219,14 @@ STV_MkObject(const struct stevedore *stv, struct objcore *oc, void *ptr) int stv_default_allocobj(const struct stevedore *stv, struct objcore *oc, - unsigned ltot) + unsigned wsl) { struct object *o; struct storage *st; + unsigned ltot; CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); + ltot = sizeof(struct object) + PRNDUP(wsl); st = stv->alloc(stv, ltot); if (st == NULL) return (0); @@ -250,24 +252,20 @@ STV_NewObject(struct objcore *oc, struct worker *wrk, const char *hint, unsigned wsl) { struct stevedore *stv, *stv0; - unsigned ltot; int i, j; CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); assert(wsl > 0); - wsl = PRNDUP(wsl); - - ltot = sizeof(struct object) + wsl; stv = stv0 = stv_pick_stevedore(wrk->vsl, &hint); AN(stv->allocobj); - j = stv->allocobj(stv, oc, ltot); + j = stv->allocobj(stv, oc, wsl); if (j == 0 && hint == NULL) { do { stv = stv_pick_stevedore(wrk->vsl, &hint); AN(stv->allocobj); - j = stv->allocobj(stv, oc, ltot); + j = stv->allocobj(stv, oc, wsl); } while (j == 0 && stv != stv0); } if (j == 0) { @@ -275,7 +273,7 @@ STV_NewObject(struct objcore *oc, struct worker *wrk, for (i = 0; j == 0 && i < cache_param->nuke_limit; i++) { if (EXP_NukeOne(wrk, stv->lru) == -1) break; - j = stv->allocobj(stv, oc, ltot); + j = stv->allocobj(stv, oc, wsl); } } diff --git a/bin/varnishd/storage/storage_persistent.c b/bin/varnishd/storage/storage_persistent.c index 160cc35..2679675 100644 --- a/bin/varnishd/storage/storage_persistent.c +++ b/bin/varnishd/storage/storage_persistent.c @@ -502,7 +502,7 @@ smp_allocx(const struct stevedore *st, size_t min_size, size_t max_size, */ static int -smp_allocobj(const struct stevedore *stv, struct objcore *oc, unsigned ltot) +smp_allocobj(const struct stevedore *stv, struct objcore *oc, unsigned wsl) { struct object *o; struct storage *st; @@ -510,6 +510,7 @@ smp_allocobj(const struct stevedore *stv, struct objcore *oc, unsigned ltot) struct smp_seg *sg; struct smp_object *so; unsigned objidx; + unsigned ltot; CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); CAST_OBJ_NOTNULL(sc, stv->priv, SMP_SC_MAGIC); @@ -518,6 +519,7 @@ smp_allocobj(const struct stevedore *stv, struct objcore *oc, unsigned ltot) if ((oc->exp.ttl + oc->exp.grace + oc->exp.keep) <= 0.) return (0); + ltot = sizeof(struct object) + PRNDUP(wsl); ltot = IRNUP(sc, ltot); st = smp_allocx(stv, ltot, ltot, &so, &objidx, &sg); -- 2.1.4 From dridi at varni.sh Mon Sep 28 11:38:00 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Mon, 28 Sep 2015 13:38:00 +0200 Subject: [PATCH,VDD15Q3] Changes related to VCL temperature In-Reply-To: References: Message-ID: On Thu, Sep 10, 2015 at 7:38 PM, Dridi Boukelmoune wrote: > Hi, > > This is Varnish 4.1 material. > > I have finally done and tested the changes we had decided to make > during the last VDD: > - removing the USE event > - allowing VMODs to fail a WARM event > - VCL reference counting for VMODs > - relaxing the "cold" restrictions on cooling VCLs > > I have found and fixed more issues than anticipated after I updated my > DNS director draft to comply to the new rules. I'm happy to say that > the director is actually simpler to implement now. I have also updated > the documentation along with the code, but I may have missed some > changes and I'm running late for tonight's rehearsal :) > > Best Regards, > Dridi Following today's discussion on IRC, there's an error I introduced when cleaning up the patch set before submission, and did not notice. Attached is the fix for the 10th patch. Best Regards, Dridi -------------- next part -------------- A non-text attachment was scrubbed... Name: 0010-Catch-a-vcl.state-failure-on-the-manager-side.patch Type: text/x-patch Size: 6667 bytes Desc: not available URL: From dridi at varni.sh Mon Sep 28 11:47:04 2015 From: dridi at varni.sh (Dridi Boukelmoune) Date: Mon, 28 Sep 2015 13:47:04 +0200 Subject: [PATCH,VDD15Q3] Changes related to VCL temperature In-Reply-To: References: Message-ID: > Following today's discussion on IRC, there's an error I introduced > when cleaning up the patch set before submission, and did not notice. > > Attached is the fix for the 10th patch. Reattaching the whole patch set again, rebased against the current master to fix documentation conflicts. Best Regards, Dridi -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Get-rid-of-VCL_EVENT_USE.patch Type: text/x-patch Size: 4824 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Turn-VCL-state-magic-numbers-into-an-enum.patch Type: text/x-patch Size: 4480 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Remove-unused-handling.patch Type: text/x-patch Size: 742 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0004-Reserve-space-for-the-cooling-state-in-vcl.list.patch Type: text/x-patch Size: 1389 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0005-VMODs-can-now-fail-a-VCL-warm-up.patch Type: text/x-patch Size: 17325 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0006-VMODs-handling-of-VCL_EVENT_COLD-must-be-failsafe.patch Type: text/x-patch Size: 1108 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0007-Allow-VMODs-to-hold-a-reference-on-a-warm-VCL.patch Type: text/x-patch Size: 5037 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0008-Don-t-allow-a-VCL-transition-from-cooling-to-warm.patch Type: text/x-patch Size: 1646 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0009-Allow-VMODs-to-create-backends-for-a-cooling-VCL.patch Type: text/x-patch Size: 1573 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0010-Catch-a-vcl.state-failure-on-the-manager-side.patch Type: text/x-patch Size: 6667 bytes Desc: not available URL: