vcl_init, VMODs & workspaces

Carlos Abalde carlos.abalde at gmail.com
Wed May 4 09:45:34 CEST 2016


> On 04 May 2016, at 09:13, Dridi Boukelmoune <dridi at varni.sh> wrote:
> ...
> 
> If you decilare an $Event [1] function in your VCC file you will
> receive at LOAD-time a PRIV_VCL private pointer [2] to track per-VCL
> data. This can be used by your module for functions that need to
> allocate during vcl_init{} but there's no END-OF-INIT event you could
> catch to free this state early, so unless you provide a specific
> function to do the cleaning, your free callback will be called later
> when the VCL is discarded.

Thanks Dridi. In fact I'm considering implementing a private VMOD's workspace in PRIV_VCL using WS_Init() in order to reuse WS_* functions and keep life simple when calling VMOD functions from vcl_init and a ctx->ws is not available. I wanted to check I wasn't missing anything here :)

Thanks,

--
Carlos Abalde




More information about the varnish-dev mailing list