• Nils Goroll's avatar
    add std.ban() and std.ban_error() for vcl access to ban errors · 6eee0074
    Nils Goroll authored
    The ban() vcl action adds bans like the ban CLI command, but has no
    facility for in-band error reporting. Errors are only reported to VSL.
    
    We add std.ban() as a replacement for ban() with identical semantics,
    but returning if the ban was successfully added.
    
    std.ban_error() is added to report the error, if any.
    
    We add v00009.vtc mirroring v00011.vtc, but with std.ban() replacing
    ban(). The test number was chosen to fill a gap close to v00011.vtc.
    
    Implementation:
    
    We change VRT_ban_string() to return any error or NULL for
    success. Where the error is not a constant string, we need to format
    it on the workspace. For workspace overflows, we need to fall back to
    canned constant error strings to ensure that the error case never
    appears as success.
    6eee0074
v00009.vtc 3.24 KB