]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: sample: add us/ms support to date/http_date
authorDamien Claisse <d.claisse@criteo.com>
Wed, 30 Oct 2019 15:57:28 +0000 (15:57 +0000)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 Oct 2019 07:47:31 +0000 (08:47 +0100)
commitae6f125c7b33454770aaa363101384e8daafc2a2
treecf36137a179f41647db3155b1670a95a32beb0b1
parente1583751b67704f297060afaabe87fd7d8d602a2
MINOR: sample: add us/ms support to date/http_date

It can be sometimes interesting to have a timestamp with a
resolution of less than a second.
It is currently painful to obtain this, because concatenation
of date and date_us lead to a shorter timestamp during first
100ms of a second, which is not parseable and needs ugly ACLs
in configuration to prepend 0s when needed.
To improve this, add an optional <unit> parameter to date sample
to report an integer with desired unit.
Also support this unit in http_date converter to report
a date string with sub-second precision.
doc/configuration.txt
include/proto/sample.h
src/http_conv.c
src/sample.c