[master] d13249f9c varnishncsa: Add support for the -k option

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Tue Jun 28 09:02:04 UTC 2022


commit d13249f9c68d29923b3c0b63ed27664c557199ce
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Jun 28 10:47:16 2022 +0200

    varnishncsa: Add support for the -k option
    
    I found myself needing this option to incrementally build a query and a
    format on a large VSL compressed file. Because of the small nature of
    the ncsa output I was working with and the narrow query I was refining,
    and the decompression delay, it would take forever to complete this
    pipeline:
    
        zcat '...' | varnishncsa -r - -g request -q '...' -F '...' | head -n 5
    
    With the -k option it happens instantly. Alternatively, it could
    probably have worked also with the -u option, but it wouldn't be a
    one-liner change, and it would also result in a more complex command:
    
        zcat '...' | varnishncsa -r - -g request -q '...' -F '...' -k 5
        # vs
        zcat '...' | varnishncsa -r - -g request -q '...' -F '...' -u | head -n 5
    
    The -k option would also generally be useful in "live" mode.

diff --git a/bin/varnishncsa/varnishncsa_options.h b/bin/varnishncsa/varnishncsa_options.h
index ccd2a3098..b907888af 100644
--- a/bin/varnishncsa/varnishncsa_options.h
+++ b/bin/varnishncsa/varnishncsa_options.h
@@ -103,6 +103,7 @@ NCSA_OPT_f
 NCSA_OPT_g
 VUT_OPT_h
 NCSA_OPT_j
+VUT_OPT_k
 VSL_OPT_L
 VUT_OPT_n
 VUT_GLOBAL_OPT_P


More information about the varnish-commit mailing list