Learning C and VRT_SetHdr()

Dan dan at retrobadger.net
Thu Mar 31 15:28:21 CEST 2011


On 31/03/11 12:58, AD wrote:
> use -C to display the default VCL , or just put in a command you want 
> to do in C inside the vcl and then see how it looks when running -C -f 
> against the config.
>
>
> On Thu, Mar 31, 2011 at 7:39 AM, Dan <dan at retrobadger.net 
> <mailto:dan at retrobadger.net>> wrote:
>
>     I would like to do some more advanced functionality within our VCL
>     file, and to do so need to use the inline-c capabilities of
>     varnish.  So, to start off with, I thought I would get my VCL file
>     to set the headers, so I can test variables, and be sure it is
>     working.  But am getting a WSOD when I impliment my seemingly
>     simple code.
>
>
>     So my main questions are:
>     * Are there any good docs on the VRT variables
>     * Are there examples/tutorials on using C within the VCL (for
>     beginners to the subject)
>     * Is there something obvious I have overlooked when writing my code
>
>
>     The snipper from my current code is:
>     /sub detectmobile {/
>     /  C{/
>     /    VRT_SetHdr(sp, HDR_BEREQ, "\020X-Varnish-TeraWurfl:", "no1",
>     vrt_magic_string_end);/
>     /  }C/
>     /}/
>     /sub vcl_miss {/
>     /  call detectmobile;/
>     /  return(fetch);/
>     /}/
>     /sub vcl_pipe {/
>     /  call detectmobile;/
>     /  return(pipe);/
>     /}/
>     /sub vcl_pass {/
>     /  call detectmobile;/
>     /  return(pass);/
>     /}/
>
>
>     Thanks for your advice,
>     Dan
>
>     _______________________________________________
>     varnish-misc mailing list
>     varnish-misc at varnish-cache.org <mailto:varnish-misc at varnish-cache.org>
>     http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
>
Sorry, I am confused, where would I put -C, in my /etc/default/varnish 
file?  Is this required to use inline-c within my vcl file?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20110331/a5048122/attachment-0003.html>


More information about the varnish-misc mailing list