]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MEDIUM] add support for time units in the configuration
authorWilly Tarreau <w@1wt.eu>
Sun, 2 Dec 2007 21:15:14 +0000 (22:15 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Dec 2007 21:15:14 +0000 (22:15 +0100)
commitb3f32f5f8abc40b90a4fca4c9be19a571e63b7eb
tree77e64d5b2fbdacb351715a7ea2d9bfb6e2598e6f
parenta0d37b69ef8f4362f606aacd673eedc292e78af7
[MEDIUM] add support for time units in the configuration

It is not always handy to manipulate large values exprimed
in milliseconds for timeouts. Also, some values are entered
in seconds (such as the stats refresh interval). This patch
adds support for time units. It knows about 'us', 'ms', 's',
'm', 'h', and 'd'. It automatically converts each value into
the caller's expected unit. Unit-less values are still passed
unchanged.

The unit must be passed as a suffix to the number. For instance:

     clitimeout 15m

If any character is not understood, an error is returned.
src/cfgparse.c
src/dumpstats.c
tests/test-time.cfg [new file with mode: 0644]