you can put anything in the priv field of the task, but the issue is that you have to put that data in there, meaning a call to your vmod from the vcl.
the VUT.dispatch_f function isn't to be called from a vmod, and I don't think you need to. Maybe it's time to take a step back, can you fill us in the whole workflow, notably: - what data do you inject, and how do you create it? - what do you need to know about the req/resp/bereq/beresp? I almost have the feeling that this could be solved through pure vcl+shell. -- Guillaume Quintard On Thu, May 11, 2017 at 5:33 PM, Ryan Burn <[email protected]> wrote: > From the free function, is there any way to get the status code or > other properties of the request? I tried using VRT_r_obj_status with a > stored reference to the context, but that doesn't seem to work since > some of the request's resources have already been reclaimed: > > https://github.com/rnburn/varnish-opentracing/blob/ > master/opentracing/src/trace.cpp#L22 > > Is there any other place something like the status would be stored? > > > On Mon, May 8, 2017 at 11:13 AM, Reza Naghibi <[email protected]> > wrote: > > Sorry, email misfire. > > > > You can do this in a VMOD via PRIV_TASK: > > > > https://varnish-cache.org/docs/trunk/reference/vmod. > html#private-pointers > > > > It might make sense to track this stuff in some kind of struct, in which > > case, put it into *priv and then register a *free callback. Otherwise, > just > > put a dummy value into the *priv. *free will get called after the > request is > > done and you can put your custom code in there. > > > > -- > > Reza Naghibi > > Varnish Software > > > > On Mon, May 8, 2017 at 11:10 AM, Reza Naghibi <[email protected] > > > > wrote: > >> > >> You can do this in a VMOD via PRIV_TASK: > >> > >> > >> -- > >> Reza Naghibi > >> Varnish Software > >> > >> On Fri, May 5, 2017 at 10:15 PM, Ryan Burn <[email protected]> wrote: > >>> > >>> Hello, > >>> From VCL, is it possible to execute code that runs after a request has > >>> been processed? > >>> > >>> I'm looking into writing a module that enables Varnish for distributed > >>> tracing using the OpenTracing project [opentracing.io]. This requires > >>> invoking code at the beginning of a request to start a span and insert > >>> tracing context into the request's headers and invoking code after a > >>> request's been processed to finish the span and measure how long it > >>> took to process. > >>> > >>> I recently did a similar project for nginx > >>> [github.com/rnburn/nginx-opentracing]. Nginx provides an > >>> NGX_HTTP_LOG_PHASE [www.nginxguts.com/2011/01/phases/] that allows you > >>> to set up handlers run after requests are serviced. Can anything > >>> equivalent be done using VCL? > >>> > >>> I image you could accomplish this by subscribing and regularly reading > >>> from Varnish's shared memory log, but I'd much rather do it directly > >>> if possible. > >>> > >>> Thanks, Ryan > >>> > >>> _______________________________________________ > >>> varnish-misc mailing list > >>> [email protected] > >>> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc > >> > >> > > > > _______________________________________________ > varnish-misc mailing list > [email protected] > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc >
_______________________________________________ varnish-misc mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
