You get a compiler error. The sub keyword is not allowed within a sub. Per.
On Thu, Dec 16, 2010 at 6:41 PM, Stefan Pommerening <[email protected]> wrote: > Ok, very good statement - normally I know the override mechanism used by > the custom VCL. > Nevertheless my last email was incorrect - sorry for that. > > But: What happens when you include a vcl_recv INSIDE another vcl_recv > subroutine? > This is what Frank did. > > Stefan > -- > http://dmsp.de > > Am 16.12.2010 17:59, schrieb Per Buer: > > On Thu, Dec 16, 2010 at 2:30 PM, Stefan Pommerening <[email protected]> wrote: > > >> of couse you only need one single vcl_recv subroutine. This applies to all >> vcl subroutines. >> I usually start with grabbing the default vcl and then add everything I >> need to the existing (default) subroutines. >> >> If you use the include statement you have to keep in mind that inclusion >> is a textual >> substitution - therefore no repeated definition of vcl_recv (or even other >> subroutines) >> is allowed. >> > > Actually, multiple definitions of the same subroutine is allowed. They > are then concatenated, the flow being terminated only by the return > statements. This is how the default VCL get overridden by your custom VCL. > > There is a good example in the man vcl. Of course, this might get very > confusing when you have multiple vcl_recv subroutines spread over several > included files. Caution advised. :-) > > > _______________________________________________ > varnish-misc mailing list > [email protected] > http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > -- Per Buer, Varnish Software Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer Varnish makes websites fly! Want to learn more about Varnish? http://www.varnish-software.com/whitepapers
_______________________________________________ varnish-misc mailing list [email protected] http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
