<br><br><div><span class="gmail_quote">On 2/22/07, <b class="gmail_sendername">Poul-Henning Kamp</b> <<a href="mailto:phk@phk.freebsd.dk">phk@phk.freebsd.dk</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In message <<a href="mailto:dacbdcd10702210839n1d8b3be5gdb73de697a492c0c@mail.gmail.com">dacbdcd10702210839n1d8b3be5gdb73de697a492c0c@mail.gmail.com</a>>, cripy<br> writes:<br><br>>Hello, we recently ran into an issue with varnish when http authorizations
<br>>were concerned so I created this patch [ it can probably be done a whole lot<br>>better ]. The attached patch has a function cnt_auth which calls an<br>>external function that you must insert yourself.<br><br>
One of the most damanging accusations ever launched against any<br>programming language was in one of the historical attacks on PASCAL.<br><br>I can't remember who exactly wrote it, but the operative sentence was:<br>
<br> "Worst of all, there is no escape."<br><br>VCL has a planned escape mechanism, but I have not said anything<br>about it yet, wanting to see if anybody actually needed it.<br><br>The concept is that hat arbitrary C-code can be inserted into VCL
<br>programs, possibly something like:<br><br> sub vcl_recv {<br> C{<br> {<br> char *p = VRT_GetHdr(sp, 1, "\005Host:");<br><br> ...<br> }
<br> }C<br> }<br><br>That should allow you to do what your patch does, entirely<br>from within VCL.<br><br>--<br>Poul-Henning Kamp | UNIX since Zilog Zeus 3.20<br><a href="mailto:phk@FreeBSD.ORG">
phk@FreeBSD.ORG</a> | TCP/IP since RFC 956<br>FreeBSD committer | BSD since 4.3-tahoe<br>Never attribute to malice what can adequately be explained by incompetence.<br></blockquote></div><br><br>Hey Poul, <br>
Thanks for the prompt response and help. However, I can't seem to get this to work properly I am receiving the following error upon varnishd startup:<br><br>Expected action, 'if' or '}'<br>In VCL code Line 7 Pos 16
<br> C{<br>----------------#-<br><br>Any help is appreciated as I believe that VCL is the best approach for implementing this until something similar is implemented in varnish. Thanks again.<br><br><br>