]> git.kaiwu.me - haproxy.git/commit
[MEDIUM]: Inversion for options
authorKrzysztof Oledzki <ole@ans.pl>
Tue, 25 Dec 2007 01:40:22 +0000 (02:40 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 20 Jan 2008 22:42:27 +0000 (23:42 +0100)
commit353114a2c8ca9a67b25edebf6564956f7151d880
tree59f20b9c94d9ca9755c5b553337875ae2f5bd47d
parentb68424102aeed687cc2e01d972299635c1f7692e
[MEDIUM]: Inversion for options

This patch adds a possibility to invert most of available options by
introducing the "no" keyword, available as an additional prefix.
If it is found arguments are shifted left and an additional flag (inv)
is set.

It allows to use all options from a current defaults section, except
the selected ones, for example:

-- cut here --
defaults
        contimeout      4200
        clitimeout      50000
        srvtimeout      40000
        option contstats

listen stats 1.2.3.4:80
no option contstats
-- cut here --

Currenly inversion works only with the "option" keyword.

The patch also moves last_checks calculation at the end of the readcfgfile()
function and changes "PR_O_FORCE_CLO | PR_O_HTTP_CLOSE" into "PR_O_FORCE_CLO"
in cfg_opts so it is possible to invert forceclose without breaking httpclose
(and vice versa) and to invert tcpsplice in one proxy but to keep a proper
last_checks value when tcpsplice is used in another proxy. Now, the code
checks for PR_O_FORCE_CLO everywhere it checks for PR_O_HTTP_CLOSE.

I also decided to depreciate "redisp" and "redispatch" keywords as it is IMHO
better to use "option redispatch" which can be inverted.

Some useful documentation were added and at the same time I sorted
(alfabetically) all valid options both in the code and the documentation.
doc/configuration.txt
include/common/cfgparse.h
src/cfgparse.c
src/proto_http.c