mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-05 10:58:14 +00:00
MINOR: stream-int: Add function to attach a connection to a SI
si_attach_conn() function should be used to attach a connection to a stream-interface. It created a conn-stream if necessary. This function is mandatory to be able to keep the backend conn-stream during connection retries.
This commit is contained in:
parent
20a6501051
commit
1a3b598b47
@ -229,6 +229,23 @@ static inline void si_attach_cs(struct stream_interface *si, struct conn_stream
|
||||
cs_attach(cs, si, &si_conn_cb);
|
||||
}
|
||||
|
||||
static inline struct conn_stream *si_attach_conn(struct stream_interface *si, struct connection *conn)
|
||||
{
|
||||
struct conn_stream *cs;
|
||||
|
||||
si_reset_endpoint(si);
|
||||
cs = objt_cs(si->end);
|
||||
if (!cs)
|
||||
cs = cs_new(conn, conn->target);
|
||||
if (cs) {
|
||||
cs_init(cs, conn);
|
||||
if (!conn->ctx)
|
||||
conn->ctx = cs;
|
||||
si_attach_cs(si, cs);
|
||||
}
|
||||
return cs;
|
||||
}
|
||||
|
||||
/* Returns true if a connection is attached to the stream interface <si> and
|
||||
* if this connection is ready.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user