• Nils Goroll's avatar
    Clarify (struct vrt_ctx).handling for PRIVs · 4ccd356d
    Nils Goroll authored
    Ref 43d9e5fb :
    
    PRIV_* fini methods need to leave (struct vrt_ctx).handling alone,
    except that they might call VRT_fail(), see also
    746384b2
    
    Thus we add assertions that handling be either 0 or VCL_RET_FAIL
    outside the FSM.
    
    To be able to do so, we need to change VCL_RET_OK into 0 when
    vcl_init{} has returned successfully.
    
    The vcl_fini{} case is slightly more complicated:
    
    By design, only "ok" (VCL_RET_OK) is allowed, but VRT_fail() also
    added VCL_RET_FAIL, so we de-facto get a "fail" return if any vmod
    code called VRT_fail().
    
    Because PRIV_* handling happens from VCC generated code via
    VGC_Discard(), we need to check and change (struct vrt_ctx).handling
    right after calling vcl_fini{} / VGC_function_vcl_fini() from
    VGC_Discard(). This is VPI_vcl_fini().
    
    Implementation note:
    
    I also considered void VPI_vcl_fini(VRT_CTX, vcl_func_f fini_sub),
    having VPI_vcl_fini call the fini_sub, but that stirred up includes of
    VPI where vcl.h is not included.
    4ccd356d
Name
Last commit
Last update
.circleci Loading commit data...
.github Loading commit data...
bin Loading commit data...
doc Loading commit data...
etc Loading commit data...
include Loading commit data...
lib Loading commit data...
m4 Loading commit data...
man Loading commit data...
tools Loading commit data...
vmod Loading commit data...
.dir-locals.el Loading commit data...
.gitignore Loading commit data...
.lgtm.yml Loading commit data...
.syntastic_c_config Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING Loading commit data...
ChangeLog Loading commit data...
INSTALL Loading commit data...
LICENSE Loading commit data...
Makefile.am Loading commit data...
README.Packaging Loading commit data...
README.rst Loading commit data...
autogen.des Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
flint.lnt Loading commit data...
varnish-legacy.m4 Loading commit data...
varnish.m4 Loading commit data...
varnishapi-uninstalled.pc.in Loading commit data...
varnishapi.pc.in Loading commit data...
vtc.am Loading commit data...