[prev in list] [next in list] [prev in thread] [next in thread] 

List:       varnish-dev
Subject:    Re: bo access from VFP
From:       Guillaume Quintard <guillaume.quintard () gmail ! com>
Date:       2021-12-31 23:48:46
Message-ID: CAOrPork_=nwUULBvk3s=hZyunZiGkT8UN6U=4pXHyvXn_eB_pQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Small follow-up on that one: it would be nice for VFP to be able to disable
streaming (bo->do_stream), so that's an extra argument to be able to access
the busyobj

-- 
Guillaume Quintard


On Sun, Dec 26, 2021 at 6:11 PM Guillaume Quintard <
guillaume.quintard@gmail.com> wrote:

> Happy holidays to everyone,
>
> Unless I'm mistaken, there's no way for a VFP to access the busyobj, and
> was wondering if that could change as I need it to retrieve a vmod_priv.
>
> For some context, I stumbled on this while working on this vmod:
> https://github.com/gquintard/vmod_rers/tree/v0.0.2
> (It's in rust, and I'm using it to explore what kind of bindings we need.
> I already have a couple of examples for VDP[1] and VFP[2] in the crate[3]
> repo, but of course they don't need as much as a real vmod.)
>
> With vmod_rers, the user is able to add regex/sub pairs on a per-request
> basis [4], and they will be acted upon by the VDP. To store and retrieve
> the pairs I use the regular "fake vrt_ctx trick"[4], since the VDP has
> access to the req struct, it's very easy to build.
> However, I'm unable to do the same thing on the VFP side since I have
> neither a req (fair) nor a bo.
>
> Is there a big reason for not having access to it, or is it just that
> nobody asked for it until now?
>
> Happy new year!
>
> [1]: https://github.com/gquintard/varnish-rs/tree/main/examples/vmod_vdp
> [2]: https://github.com/gquintard/varnish-rs/tree/main/examples/vmod_vfp
> [3]: https://crates.io/crates/varnish
> [4]: https://github.com/gquintard/vmod_rers/blob/v0.0.2/vmod.vcc#L47
> [5]: https://github.com/gquintard/vmod_rers/blob/v0.0.2/src/lib.rs#L221
> --
> Guillaume Quintard
>

[Attachment #5 (text/html)]

<div dir="ltr"><div>Small follow-up on that one: it would be nice for VFP to be able \
to disable streaming (bo-&gt;do_stream), so that&#39;s an extra argument to be able \
to access the busyobj</div><div><br></div><div><div><div dir="ltr" \
class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- \
<br></div><div>Guillaume Quintard<br></div></div></div></div><br></div></div><br><div \
class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 26, 2021 at 6:11 PM \
Guillaume Quintard &lt;<a \
href="mailto:guillaume.quintard@gmail.com">guillaume.quintard@gmail.com</a>&gt; \
wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div \
dir="ltr"><div>Happy holidays to everyone,</div><div><br></div><div>Unless I&#39;m \
mistaken, there&#39;s no way for a VFP to access the busyobj, and was wondering if \
that could change as I need it to retrieve a \
vmod_priv.<br></div><div><br></div><div>For some context, I stumbled on this while \
working on this vmod: <a href="https://github.com/gquintard/vmod_rers/tree/v0.0.2" \
target="_blank">https://github.com/gquintard/vmod_rers/tree/v0.0.2</a></div><div>(It&#39;s \
in rust, and I&#39;m using it to explore what kind of bindings we need. I already \
have a couple of examples for VDP[1] and VFP[2] in the crate[3] repo, but of course \
they don&#39;t need as much as a real vmod.)<br></div><div><br></div><div>With \
vmod_rers, the user is able to add regex/sub pairs on a per-request basis [4], and \
they will be acted upon by the VDP. To store and retrieve the pairs I use the regular \
&quot;fake vrt_ctx trick&quot;[4], since the VDP has access to the req struct, \
it&#39;s very easy to build.<br></div><div>However, I&#39;m unable to do the same \
thing on the VFP side since I have neither a req (fair) nor a \
bo.</div><div><br></div><div>Is there a big reason for not having access to it, or is \
it just that nobody asked for it until now?</div><div><br></div>Happy new \
year!<br><div><br></div><div>[1]: <a \
href="https://github.com/gquintard/varnish-rs/tree/main/examples/vmod_vdp" \
target="_blank">https://github.com/gquintard/varnish-rs/tree/main/examples/vmod_vdp</a></div><div>[2]: \
<a href="https://github.com/gquintard/varnish-rs/tree/main/examples/vmod_vfp" \
target="_blank">https://github.com/gquintard/varnish-rs/tree/main/examples/vmod_vfp</a></div><div>[3]: \
<a href="https://crates.io/crates/varnish" \
target="_blank">https://crates.io/crates/varnish</a></div><div>[4]: <a \
href="https://github.com/gquintard/vmod_rers/blob/v0.0.2/vmod.vcc#L47" \
target="_blank">https://github.com/gquintard/vmod_rers/blob/v0.0.2/vmod.vcc#L47</a></div><div>[5]: \
<a href="https://github.com/gquintard/vmod_rers/blob/v0.0.2/src/lib.rs#L221" \
target="_blank">https://github.com/gquintard/vmod_rers/blob/v0.0.2/src/lib.rs#L221</a></div><div><div><div \
dir="ltr"><div dir="ltr"><div>-- <br></div><div>Guillaume \
Quintard<br></div></div></div></div></div></div> </blockquote></div>



_______________________________________________
varnish-dev mailing list
varnish-dev@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic