MEDIUM: http: Ignore http-pretend-keepalive option on frontend

This option is backends specific, so there is no reason to support it on
frontends. So now, it is ignored if it is set on a frontend and a warning is
emitted during the startup. The change is quite trivial, but the commit is
tagged as MEDIUM because it is a small breakage with previous versions and
configurations using this options could emit a warning now.
This commit is contained in:
Christopher Faulet 2018-09-21 10:25:19 +02:00 committed by Willy Tarreau
parent 10079f59b7
commit 98db9768e5
2 changed files with 9 additions and 8 deletions

View File

@ -2116,7 +2116,7 @@ option http-buffer-request (*) X X X X
option http-ignore-probes (*) X X X - option http-ignore-probes (*) X X X -
option http-keep-alive (*) X X X X option http-keep-alive (*) X X X X
option http-no-delay (*) X X X X option http-no-delay (*) X X X X
option http-pretend-keepalive (*) X X X X option http-pretend-keepalive (*) X - X X
option http-server-close (*) X X X X option http-server-close (*) X X X X
option http-tunnel (*) X X X X option http-tunnel (*) X X X X
option http-use-proxy-header (*) X X X - option http-use-proxy-header (*) X X X -
@ -5898,7 +5898,7 @@ option http-pretend-keepalive
no option http-pretend-keepalive no option http-pretend-keepalive
Define whether haproxy will announce keepalive to the server or not Define whether haproxy will announce keepalive to the server or not
May be used in sections : defaults | frontend | listen | backend May be used in sections : defaults | frontend | listen | backend
yes | yes | yes | yes yes | no | yes | yes
Arguments : none Arguments : none
When running with "option http-server-close" or "option forceclose", haproxy When running with "option http-server-close" or "option forceclose", haproxy
@ -5925,11 +5925,12 @@ no option http-pretend-keepalive
less work to do. So if haproxy is the bottleneck on the whole architecture, less work to do. So if haproxy is the bottleneck on the whole architecture,
enabling this option might save a few CPU cycles. enabling this option might save a few CPU cycles.
This option may be set both in a frontend and in a backend. It is enabled if This option may be set in backend and listen sections. Using it in a frontend
at least one of the frontend or backend holding a connection has it enabled. section will be ignored and a warning will be reported during startup. It is
This option may be combined with "option httpclose", which will cause a backend related option, so there is no real reason to set it on a
keepalive to be announced to the server and close to be announced to the frontend. This option may be combined with "option httpclose", which will
client. This practice is discouraged though. cause keepalive to be announced to the server and close to be announced to
the client. This practice is discouraged though.
If this option has been enabled in a "defaults" section, it can be disabled If this option has been enabled in a "defaults" section, it can be disabled
in a specific instance by prepending the "no" keyword before it. in a specific instance by prepending the "no" keyword before it.

View File

@ -206,7 +206,7 @@ static const struct cfg_opt cfg_opts2[] =
{ "independant-streams", PR_O2_INDEPSTR, PR_CAP_FE|PR_CAP_BE, 0, 0 }, { "independant-streams", PR_O2_INDEPSTR, PR_CAP_FE|PR_CAP_BE, 0, 0 },
{ "independent-streams", PR_O2_INDEPSTR, PR_CAP_FE|PR_CAP_BE, 0, 0 }, { "independent-streams", PR_O2_INDEPSTR, PR_CAP_FE|PR_CAP_BE, 0, 0 },
{ "http-use-proxy-header", PR_O2_USE_PXHDR, PR_CAP_FE, 0, PR_MODE_HTTP }, { "http-use-proxy-header", PR_O2_USE_PXHDR, PR_CAP_FE, 0, PR_MODE_HTTP },
{ "http-pretend-keepalive", PR_O2_FAKE_KA, PR_CAP_FE|PR_CAP_BE, 0, PR_MODE_HTTP }, { "http-pretend-keepalive", PR_O2_FAKE_KA, PR_CAP_BE, 0, PR_MODE_HTTP },
{ "http-no-delay", PR_O2_NODELAY, PR_CAP_FE|PR_CAP_BE, 0, PR_MODE_HTTP }, { "http-no-delay", PR_O2_NODELAY, PR_CAP_FE|PR_CAP_BE, 0, PR_MODE_HTTP },
{ NULL, 0, 0, 0 } { NULL, 0, 0, 0 }
}; };