Nils Goroll slink at
Tue Oct 30 13:14:50 UTC 2018


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 =;	# exists

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

sub vcl_backend_init {
	foo.inherit();			# new

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


More information about the varnish-dev mailing list