• Nils Goroll's avatar
    An overflowed workspace must remain overflowed after WS_Reset() · 896151b4
    Nils Goroll authored
    We use workspace overflows to signal to bail out for example after a
    failing `VRT_SetHdr()`. This is a guarantee that if some serious issue
    occurred during processing, we rather send an error downstream than an
    incomplete response or the result of incomplete processing.
    
    We use the `WS_Snapshot() ...  WS_Reset()` pattern as some kind of
    second order workspace allocation where the called code itself uses
    `WS_Reserve()`.
    
    With this usage pattern, `WS_Reset()` called `ws_ClearOverflow(ws)`,
    potentially clearing the overflow bit from a previous relevant
    failure.
    
    We now avoid any other unintended clears of the overflow bit by
    splitting two functions:
    
    * WS_Rollback() is now what WS_Reset() used to be: It clears overflows
      and accepts the zero cookie for a reset-to-start
    
      It is only intended for use within varnishd and is thus declared
      in cache_varnishd.h
    
    * WS_Reset() does not touch the overflow bit any longer, ensuring that
      a once-overflowed workspace stays overflowed
    
    `WS_Snapshot()` now returns a magic value which gets recognized by
    `WS_Reset()` to ensure that the overflowed marker is still present.
    This serves two purposes:
    
    - better debugging and
    
    - a safety measure against passing a cookie from an already overflowed
      workspace to WS_Rollback()
    
    Fixes #3194
    896151b4
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...