• Nils Goroll's avatar
    initialize PRIV_TASK and PRIV_TOP vmod arguments once per subroutine · f03948f4
    Nils Goroll authored
    ... and fail the VCL unless successful.
    
    Providing the PRIVs to vmods is a core function, so error handling
    should happen outside vmods.
    
    Besides being safe, this initialization can be more efficient than
    previous code for PRIVs used frequently within the same subroutine.
    
    An alternative approach would be to initialize all privs once per
    task / top request, but unless all privs are actually used in a VCL,
    this approach could impose significant overhead, both in terms of time
    and memory. By initializing privs once per sub, we impose overhead for
    privs which are referenced but not actually used in a subroutine, but
    not for all of the vcl.
    
    Fixes #2708
    f03948f4
vcc_xref.c 9.1 KB