varnish-cache icon indicating copy to clipboard operation
varnish-cache copied to clipboard

cache_req{,_fsm}: Add resp.storage control over synth body's storage

Open nigoroll opened this issue 7 months ago • 2 comments

draft PR of WIP for early review / feedback opportunities.

Next steps (planned, do not nail me down on this)

  • same change for beresp - will postpone because of #4359
  • add beresp.filters
  • change VRT_l_{,be}resp_body() to write directly to the {body,vfp} without the VSB de-tour
  • add special-purpose ssy (synth) storage to remove last remaining memcpy for vcl_synth {} use

This adds the vcl variable resp.storage, available from vcl_synth {} to control which storage the synth response body gets created on.

Rather than just remembering the stroage for use after VCL has returned, we actually create an object on it when the variable changes.

This is the first step towards #4344

nigoroll avatar Jul 08 '25 12:07 nigoroll

Bugwash: Does Resp_l_storage() exist for a could reason or could we use just the VRT_ functions?

nigoroll avatar Nov 10 '25 14:11 nigoroll

Bugwash: Does Resp_l_storage() exist for a could reason or could we use just the VRT_ functions?

The answer is that we do not have a VRT_CTX in cnt_synth, because we only create it in the "fsm wrapper" VCL_*_method, but we need to call the "set the default storage" function from cnt_synth in case VCL has not set (or unset) the storage.

nigoroll avatar Nov 10 '25 15:11 nigoroll