• Pål Hermunn Johansen's avatar
    Introduce ttl_now and the new way of calculating TTLs in VCL · a02e4f27
    Pål Hermunn Johansen authored
    This is a back port of 33143e05 in
    master, and for this reason it is a little strange.
    
    The strangeness is due to the fact that obj.ttl is not available
    in vcl_deliver here, but it is in master. This commit could have
    been much simpler without ttl_now, but the function is taken to
    4.1 regardles. The reason is that introducing obj.ttl in
    vcl_deliver is straightforward, and if someone is to do that in
    the future, the code in ttl_now(VRT_CTX) makes sure that obj.ttl
    will behave as in master, also in vcl_deliver.
    
    If obj.ttl is introduced in vcl_deliver, than also the two test
    cases s00008.vtc and s00009.vtc should be brought in, to make sure
    that obj.ttl works as expected.
    
    The following is the test from the commit in master:
    
    A new fucntion, ttl_now(VRT_CTX), defines what "now" is when ttl
    and age are calculated in various VCL subs. To sum up,
    
    * Before a backend fetch on the client side (vcl_recv, vcl_hit,
      vcl_miss) we use t_req from the request. This is the significance
      in this commit, and fixes the bug demonstrated by r02555.vtc.
    * On the backend side, most notably vcl_backend_responce, we keep
      the old "now" by simply using ctx->now.
    * In vcl_deliver we use ctx->now, as before.
    
    It was necessary to make all purges use t_req as their base time.
    Then, to not break c00041.vtc it was necessary to change from ">="
    to ">" in HSH_Lookup.
    
    All VMODs that currently use HSH_purge must change to using
    VRT_purge.
    
    Conflicts:
    	bin/varnishd/cache/cache_hash.c
    	bin/varnishd/cache/cache_objhead.h
    	bin/varnishd/cache/cache_req_fsm.c
    	bin/varnishd/cache/cache_vrt.c
    	bin/varnishd/cache/cache_vrt_var.c
    a02e4f27
Name
Last commit
Last update
bin Loading commit data...
devscripts 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...
.gitignore 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...
Makefile.inc.phk Loading commit data...
Makefile.phk Loading commit data...
README.Packaging Loading commit data...
README.rst Loading commit data...
autogen.des Loading commit data...
autogen.sh Loading commit data...
config.phk 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...