MINOR: connection: Set the conncetion target during its initialisation

When a new connection is created, its target is always set just after. So the
connection target may set when it is created instead, during its initialisation
to be precise. It is the purpose of this patch. Now, conn_new() function is
called with the connection target as parameter. The target is then passed to
conn_init(). It means the target must be passed when cs_new() is called. In this
case, the target is only used when the conn-stream is created with no
connection. This only happens for tcpchecks for now.
This commit is contained in:
Christopher Faulet
2020-07-02 09:19:54 +02:00
parent fcc3d8a1c0
commit 236c93b108
9 changed files with 18 additions and 24 deletions

View File

@@ -372,7 +372,7 @@ static inline struct conn_stream *si_alloc_cs(struct stream_interface *si, struc
si_release_endpoint(si);
cs = cs_new(conn);
cs = cs_new(conn, conn->target);
if (cs)
si_attach_cs(si, cs);