MAJOR: stream-interface: restore splicing mechanism
The splicing is now provided by the data-layer rcv_pipe/snd_pipe functions
which in turn are called by the stream interface's recv and send callbacks.
The presence of the rcv_pipe/snd_pipe functions is used to attest support
for splicing at the data layer. It looks like the stream-interface's
SI_FL_CAP_SPLICE flag does not make sense anymore as it's used as a proxy
for the pointers above.
It also appears that we call chk_snd() from the recv callback and then
try to call it again in update_conn(). It is very likely that this last
function will progressively slip into the recv/send callbacks in order
to avoid duplicate check code.
The code works right now with and without splicing. Only raw_sock provides
support for it and it is automatically selected when the various splice
options are set. However it looks like splice-auto doesn't enable it, which
possibly means that the streamer detection code does not work anymore, or
that it's only called at a time where it's too late to enable splicing (in
process_session).
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 86fd6bd..9ff5b66 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -479,7 +479,8 @@
conn_data_want_send(&si->conn); /* prepare to send data if any */
si->state = SI_ST_CON;
- si->flags |= SI_FL_CAP_SPLTCP; /* TCP supports splicing */
+ if (si->conn.data->rcv_pipe && si->conn.data->snd_pipe)
+ si->flags |= SI_FL_CAP_SPLTCP; /* TCP supports splicing */
si->exp = tick_add_ifset(now_ms, be->timeout.connect);
return SN_ERR_NONE; /* connection is OK */