MINOR: haproxy: Add an command option to disable data fast-forward
The -dF option can now be used to disable data fast-forward. It does the
same than the global option "tune.fast-forward off". Some reg-tests may rely
on this optim. To detect the feature and skip such script, the following
vtest command must be used:
feature cmd "$HAPROXY_PROGRAM -cc '!(globa.tune & GTUNE_NO_FAST_FWD)'"
diff --git a/doc/management.txt b/doc/management.txt
index 2678fdf..a56a9d5 100644
--- a/doc/management.txt
+++ b/doc/management.txt
@@ -217,6 +217,13 @@
suspicious configuration statements. This will never prevent startup even in
"zero-warning" mode nor change the exit status code.
+ -dF : disable data fast-forward. It is a mechanism to optimize the data
+ forwarding by passing data directly from a side to the other one without
+ waking the stream up. Thanks to this directive, it is possible to disable
+ this optimization. Note it also disable any kernel tcp splicing. This
+ command is not meant for regular use, it will generally only be suggested by
+ developers along complex debugging sessions.
+
-dG : disable use of getaddrinfo() to resolve host names into addresses. It
can be used when suspecting that getaddrinfo() doesn't work as expected.
This option was made available because many bogus implementations of
diff --git a/reg-tests/http-messaging/http_splicing.vtc b/reg-tests/http-messaging/http_splicing.vtc
index 2456cdd..c76ebf3 100644
--- a/reg-tests/http-messaging/http_splicing.vtc
+++ b/reg-tests/http-messaging/http_splicing.vtc
@@ -4,6 +4,7 @@
feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.6-dev0)'"
feature cmd "$HAPROXY_PROGRAM -cc 'feature(LINUX_SPLICE)'"
+feature cmd "$HAPROXY_PROGRAM -cc '!(globa.tune & GTUNE_NO_FAST_FWD)'"
feature ignore_unknown_macro
#REGTEST_TYPE=slow
diff --git a/src/haproxy.c b/src/haproxy.c
index 507a4aa..09e4198 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -622,6 +622,7 @@
" -dV disables SSL verify on servers side\n"
" -dW fails if any warning is emitted\n"
" -dD diagnostic mode : warn about suspicious configuration statements\n"
+ " -dF disable fast-forward\n"
" -sf/-st [pid ]* finishes/terminates old pids.\n"
" -x <unix_socket> get listening sockets from a unix socket\n"
" -S <bind>[,<bind options>...] new master CLI\n"
@@ -1647,6 +1648,8 @@
else if (*flag == 'd' && flag[1] == 'R')
global.tune.options &= ~GTUNE_USE_REUSEPORT;
#endif
+ else if (*flag == 'd' && flag[1] == 'F')
+ global.tune.options |= GTUNE_NO_FAST_FWD;
else if (*flag == 'd' && flag[1] == 'V')
global.ssl_server_verify = SSL_SERVER_VERIFY_NONE;
else if (*flag == 'V')