varnishcache / varnish-cache

Varnish Cache source code repository
https://www.varnish-cache.org
Other
3.56k stars 366 forks source link

Generalize the VDP API (WIP, early comments welcome) #4034

Closed nigoroll closed 6 months ago

nigoroll commented 6 months ago

This commit is to prepare for use of the VDP API also for the backend side to filter bereq.body through bereq.filters:

The req member of struct vdp_ctx is removed, because it should only be used for initialization and, consequently, is already nulled in VDP_DeliverObj().

vdp_init_f() and its caller VDP_Push() gain arguments:

VDPs should aim for compatibility with both the client and backend use case by using only hd and cl instead of req. If they depend on req, they should return an error if req is NULL.

Note that none of the new arguments would be necessary, they could all (including the existing oc argument) be derived from the VRT_CTX. The reasons for having these arguments are code clarity and avoidance of code duplication, e.g. for repeatedly figuring out the correct header and length pointer on the client vs. backend side.

nigoroll commented 6 months ago

Continued in #4035