• 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
..
cache.h Loading commit data...
cache_acceptor.c Loading commit data...
cache_backend.c Loading commit data...
cache_backend.h Loading commit data...
cache_backend_probe.c Loading commit data...
cache_ban.c Loading commit data...
cache_ban.h Loading commit data...
cache_ban_build.c Loading commit data...
cache_ban_lurker.c Loading commit data...
cache_busyobj.c Loading commit data...
cache_cli.c Loading commit data...
cache_deliver_proc.c Loading commit data...
cache_director.c Loading commit data...
cache_director.h Loading commit data...
cache_esi.h Loading commit data...
cache_esi_deliver.c Loading commit data...
cache_esi_fetch.c Loading commit data...
cache_esi_parse.c Loading commit data...
cache_expire.c Loading commit data...
cache_fetch.c Loading commit data...
cache_fetch_proc.c Loading commit data...
cache_filter.h Loading commit data...
cache_gzip.c Loading commit data...
cache_hash.c Loading commit data...
cache_http.c Loading commit data...
cache_lck.c Loading commit data...
cache_main.c Loading commit data...
cache_mempool.c Loading commit data...
cache_obj.c Loading commit data...
cache_obj.h Loading commit data...
cache_objhead.h Loading commit data...
cache_panic.c Loading commit data...
cache_pool.c Loading commit data...
cache_pool.h Loading commit data...
cache_range.c Loading commit data...
cache_req.c Loading commit data...
cache_req_body.c Loading commit data...
cache_req_fsm.c Loading commit data...
cache_rfc2616.c Loading commit data...
cache_session.c Loading commit data...
cache_shmlog.c Loading commit data...
cache_tcp_pool.c Loading commit data...
cache_tcp_pool.h Loading commit data...
cache_transport.h Loading commit data...
cache_varnishd.h Loading commit data...
cache_vary.c Loading commit data...
cache_vcl.c Loading commit data...
cache_vcl.h Loading commit data...
cache_vgz.h Loading commit data...
cache_vpi.c Loading commit data...
cache_vrt.c Loading commit data...
cache_vrt_filter.c Loading commit data...
cache_vrt_priv.c Loading commit data...
cache_vrt_re.c Loading commit data...
cache_vrt_var.c Loading commit data...
cache_vrt_vcl.c Loading commit data...
cache_vrt_vmod.c Loading commit data...
cache_wrk.c Loading commit data...
cache_ws.c Loading commit data...