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

http_conn is not really private

Open gquintard opened this issue 3 years ago • 2 comments

TL;DR: in master, even though http_conn is private, backends are expected to know about it.

http_conn is located in a file saying Stuff that should never be exposed to a VMOD, however, both cache_fetch.c and cache_vrt_filter.c use it (and don't even check it exists before accessing it)

This is problematic notably for vmods as they need to create a dummy http_conn that they should not know about.

gquintard avatar Apr 21 '22 12:04 gquintard

FWIW cache_varnishd.h says that, but it is also installed as a header so you can use it from a VMOD. One could say you may manage your htc but here be dragons, for now. As you pointed out, a VMOD implementing its own backend transport needs a clear http_conn contract before it can move to cache.h or some other public header for VMODs.

dridi avatar May 12 '22 14:05 dridi

in the same vein: vcldiir->health_changed is a bit murky too. It's obviously there, and we can modify it with VRT_SetChanged, but we can't retrieve it's value, which would be useful when implementing the healthy method

gquintard avatar Jun 06 '22 16:06 gquintard