You get a compiler error. The sub keyword is not allowed within a sub.<div><br></div><div>Per.<br><div><br><div class="gmail_quote">On Thu, Dec 16, 2010 at 6:41 PM, Stefan Pommerening <span dir="ltr"><<a href="mailto:pom@dmsp.de">pom@dmsp.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div text="#000000" bgcolor="#ffffff"><div class="im">
Ok, very good statement - normally I know the override mechanism
used by the custom VCL.<br>
Nevertheless my last email was incorrect - sorry for that.<br>
<br>
But: What happens when you include a vcl_recv INSIDE another
vcl_recv subroutine?<br>
This is what Frank did.<br>
<br></div>
Stefan<br>
--<br>
<a href="http://dmsp.de" target="_blank">http://dmsp.de</a><br><div class="im">
<br>
Am 16.12.2010 17:59, schrieb Per Buer:
</div><blockquote type="cite">On Thu, Dec 16, 2010 at 2:30 PM, Stefan Pommerening <span dir="ltr"><<a href="mailto:pom@dmsp.de" target="_blank">pom@dmsp.de</a>></span>
wrote:<div class="im"><br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"> <br>
of couse you only need one single vcl_recv subroutine. This
applies to all vcl subroutines.<br>
I usually start with grabbing the default vcl and then add
everything I need to the existing (default) subroutines.<br>
<br>
If you use the include statement you have to keep in mind that
inclusion is a textual<br>
substitution - therefore no repeated definition of vcl_recv
(or even other subroutines)<br>
is allowed.<br>
</blockquote>
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>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. :-)</div>
</div>
</div></blockquote>
</div>
<br>_______________________________________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br></blockquote></div><br><br clear="all"><br>-- <br>Per Buer, Varnish Software<br>
Phone: +47 21 98 92 61 / Mobile: +47 958 39 117 / Skype: per.buer<br>Varnish makes websites fly!<br>Want to learn more about Varnish? <a href="http://www.varnish-software.com/whitepapers" target="_blank">http://www.varnish-software.com/whitepapers</a><br>
<br>
</div></div>