1. 04 Mar, 2019 3 commits
    • Nils Goroll's avatar
      Retire return(miss) from vcl_hit {} · 3ad34e87
      Nils Goroll authored
      Ref #1799
      3ad34e87
    • Nils Goroll's avatar
      make vmod_std conversions more flexible · 5a1a9b08
      Nils Goroll authored
      In order to avoid the cross product problem with conversion functions
      (from x to y types would require x*y functions), we add flexibility
      regarding the input parameters to conversion functions:
      
      Each convertion function named after the destination type now takes all
      sensible arguments by name.
      
      int is named integer because of the reserved symbol name "int" in C.
      
      All functions should be fully backwards compatible (existing vtcs
      continue to work), but compile time checks are now effectively removed.
      The conversion functions now trigger vcl errors if used incorrectly or
      if conversion errors occur and no failback is provided. However, if a
      failback is provided, vcl errors are only raised for usage errors.
      
      For consistency, the conversion functions now only ever truncate if
      necessary. std.round() is added for explicit rounding where required.
      
      Existing functions which are now obsolete are marked deprecated.
      
      Ref #2899
      Ref https://github.com/varnishcache/varnish-cache/wiki/VIP12:-vmod-polymorphism-(for-type-conversions)
      5a1a9b08
    • Poul-Henning Kamp's avatar
      Add the VCF - aka "The CatFlap" · 141ea56a
      Poul-Henning Kamp authored
      I have reimplemented this based on Nils's #2858, because I found
      it too complex and intrusive.  (In particular we try to avoid
      unions in Varnish).
      
      Testcase m00051 by:	Nils Goroll
      
      Closes:	#2858
      141ea56a
  2. 03 Mar, 2019 9 commits
  3. 01 Mar, 2019 1 commit
  4. 27 Feb, 2019 4 commits
  5. 26 Feb, 2019 9 commits
  6. 25 Feb, 2019 6 commits
    • Poul-Henning Kamp's avatar
      Flexelint constification · 05d59c65
      Poul-Henning Kamp authored
      05d59c65
    • Nils Goroll's avatar
      complement the cleanup started in the previous commit · 5666ed7a
      Nils Goroll authored
      Thank you, @Dridi
      
      - yes, allocations outside the lock were motivated by minimizing the
        critical section, but n_backend could actually change, so this was
        wrong. As we use an RW lock, doing more work under it should only have
        marginal impact.
      
      - n_backend == 0 is probably best handled as a special case
      5666ed7a
    • Dridi Boukelmoune's avatar
      Kill goto statements in vmod-shard · fda04bf3
      Dridi Boukelmoune authored
      With that, (almost) only libvgz carries goto statements from zlib.
      
      This isn't changing any of the previous semantics, in particular the
      AN(be) assertion from the "ok:" jump is honored by all code paths
      formerly leading to it.
      
      Previously, the bitmap was allocated on the stack prior to the magic
      check of shardd, which is now fixed at the expense of a potential code
      style violation. But more importantly, we currently read the number of
      backends prior to acquiring the read lock, but there is no evidence
      that this was done on purpose and not overlooked, besides moving a
      possibly expensive state initialization outside of the critical
      section.
      
      If that was on purpose, please document it.
      fda04bf3
    • Geoff Simmons's avatar
      Add criteria for bundling new VMODs to the dev-guide. · 492c9bfb
      Geoff Simmons authored
      References #2912
      492c9bfb
    • Poul-Henning Kamp's avatar
      Whitespace OCD · 1a7f60ee
      Poul-Henning Kamp authored
      1a7f60ee
    • Poul-Henning Kamp's avatar
      6473fa9e
  7. 23 Feb, 2019 3 commits
  8. 22 Feb, 2019 5 commits
    • Nils Goroll's avatar
      polish vtc from previous commit · 97ef14c8
      Nils Goroll authored
      things I seem to only notice in my email reader...
      97ef14c8
    • Nils Goroll's avatar
      Incremental freeing of storage for hfm/hpf and proper vtc · 08403b1d
      Nils Goroll authored
      Previously, we did not test for the storage being actually freed and
      freeing only happened for passes, either explicit or a hit on hfm or
      hfp, but not the for the object becoming the hfm/hfp.
      
      We now handle incremental freeing for hfm/hfp as for private objects and
      add a test which actually checks that storage is being freed on the go.
      
      Fixes #2653
      08403b1d
    • Nils Goroll's avatar
      teach vtc to read bodies partially · a2c41bf1
      Nils Goroll authored
      also polished http_swallow_body() and made the body dump prefix name
      more consistent to indicate the receive method:
      
      	(new)		(old)
      
      	chunked		body
      	c-l		body
      	eof		rxeof
      a2c41bf1
    • Nils Goroll's avatar
      polish · f52ce734
      Nils Goroll authored
      f52ce734
    • Poul-Henning Kamp's avatar
      The vsc and vsc_seg variables are global to the VMOD, rather than · dd45b549
      Poul-Henning Kamp authored
      per-VCL, so cleanup should only happen on the last discard event.
      
      This brought confusion to #2576, and while that ticket is probably
      easier to debug if the counters were per-vcl, I think it is important
      to keep the "per-vmod" behaviour around as an example.
      dd45b549