MEDIUM: proto_tcp: remove any dependence on stream_interface
The last uses of the stream interfaces were in tcp_connect_server() and
could easily and more appropriately be moved to its callers, si_connect()
and connect_server(), making a lot more sense.
Now the function should theorically be usable for health checks.
It also appears more obvious that the file is split into two distinct
parts :
- the protocol layer used at the connection level
- the tcp analysers executing tcp-* rules and their samples/acls.
diff --git a/src/backend.c b/src/backend.c
index 3cb10fe..c2ecda8 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1009,11 +1009,18 @@
if (s->fe->options2 & PR_O2_SRC_ADDR)
s->req->cons->flags |= SI_FL_SRC_ADDR;
+ /* disable lingering */
+ if (s->be->options & PR_O_TCP_NOLING)
+ s->req->cons->flags |= SI_FL_NOLINGER;
+
err = si_connect(s->req->cons);
if (err != SN_ERR_NONE)
return err;
+ /* set connect timeout */
+ s->req->cons->exp = tick_add_ifset(now_ms, s->be->timeout.connect);
+
srv = target_srv(&s->target);
if (srv) {
s->flags |= SN_CURR_SESS;