Hi,

Somewhat related to the objvar vmods, I've been pondering how best get PRIV_TASK
based custom state across the req/bereq boundary.

How about a sub vcl_backend_init {} with read-access to req.* and write-access
to bereq.* ? This would be called when we prepare the bereq before continuing
with the req.

For vmods, there could be a VRT_priv_task_req variant which allows read-only
access to the req PRIV_TASK state. With such an interface, vmods could implement
methods to copy over objects from the client side, for example

vcl_init {
        new foo = taskvar.int();        # exists
}

sub vcl_recv {
        foo.set(42);                    # exists
}

sub vcl_backend_init {
        foo.inherit();                  # new
}

sub vcl_backend.fetch {
        set bereq.http.foo = foo.get(); # exists, should give 42
}

Nils
_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to