mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-27 05:41:10 +01:00
MINOR: stream-int: add a new pointer to the end point
The end point will correspond to either an applet context or a connection, depending on the object type. For now the pointer remains null.
This commit is contained in:
parent
372d6708fb
commit
7d67d7b9e5
@ -54,6 +54,7 @@ static inline const struct protocol *si_ctrl(struct stream_interface *si)
|
|||||||
static inline void si_prepare_none(struct stream_interface *si)
|
static inline void si_prepare_none(struct stream_interface *si)
|
||||||
{
|
{
|
||||||
si->ops = &si_embedded_ops;
|
si->ops = &si_embedded_ops;
|
||||||
|
si->end = NULL;
|
||||||
conn_prepare(si->conn, NULL, NULL, NULL, si);
|
conn_prepare(si->conn, NULL, NULL, NULL, si);
|
||||||
si->conn->target = NULL;
|
si->conn->target = NULL;
|
||||||
}
|
}
|
||||||
@ -61,18 +62,21 @@ static inline void si_prepare_none(struct stream_interface *si)
|
|||||||
static inline void si_prepare_conn(struct stream_interface *si, const struct protocol *ctrl, const struct xprt_ops *xprt)
|
static inline void si_prepare_conn(struct stream_interface *si, const struct protocol *ctrl, const struct xprt_ops *xprt)
|
||||||
{
|
{
|
||||||
si->ops = &si_conn_ops;
|
si->ops = &si_conn_ops;
|
||||||
|
si->end = NULL;
|
||||||
conn_prepare(si->conn, &si_conn_cb, ctrl, xprt, si);
|
conn_prepare(si->conn, &si_conn_cb, ctrl, xprt, si);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void si_takeover_conn(struct stream_interface *si, const struct protocol *ctrl, const struct xprt_ops *xprt)
|
static inline void si_takeover_conn(struct stream_interface *si, const struct protocol *ctrl, const struct xprt_ops *xprt)
|
||||||
{
|
{
|
||||||
si->ops = &si_conn_ops;
|
si->ops = &si_conn_ops;
|
||||||
|
si->end = NULL;
|
||||||
conn_assign(si->conn, &si_conn_cb, ctrl, xprt, si);
|
conn_assign(si->conn, &si_conn_cb, ctrl, xprt, si);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void si_prepare_applet(struct stream_interface *si, struct si_applet *applet)
|
static inline void si_prepare_applet(struct stream_interface *si, struct si_applet *applet)
|
||||||
{
|
{
|
||||||
si->ops = &si_embedded_ops;
|
si->ops = &si_embedded_ops;
|
||||||
|
si->end = NULL;
|
||||||
conn_prepare(si->conn, NULL, NULL, NULL, si);
|
conn_prepare(si->conn, NULL, NULL, NULL, si);
|
||||||
si->conn->target = &applet->obj_type;
|
si->conn->target = &applet->obj_type;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -160,6 +160,7 @@ struct stream_interface {
|
|||||||
unsigned int exp; /* wake up time for connect, queue, turn-around, ... */
|
unsigned int exp; /* wake up time for connect, queue, turn-around, ... */
|
||||||
void *owner; /* generally a (struct task*) */
|
void *owner; /* generally a (struct task*) */
|
||||||
unsigned int err_type; /* first error detected, one of SI_ET_* */
|
unsigned int err_type; /* first error detected, one of SI_ET_* */
|
||||||
|
enum obj_type *end; /* points to the end point (connection or appctx) */
|
||||||
|
|
||||||
struct connection *conn; /* descriptor for a connection */
|
struct connection *conn; /* descriptor for a connection */
|
||||||
struct si_ops *ops; /* general operations at the stream interface layer */
|
struct si_ops *ops; /* general operations at the stream interface layer */
|
||||||
|
|||||||
@ -372,6 +372,7 @@ void stream_int_unregister_handler(struct stream_interface *si)
|
|||||||
si->release = NULL;
|
si->release = NULL;
|
||||||
si->owner = NULL;
|
si->owner = NULL;
|
||||||
si->conn->target = NULL;
|
si->conn->target = NULL;
|
||||||
|
si->end = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This callback is used to send a valid PROXY protocol line to a socket being
|
/* This callback is used to send a valid PROXY protocol line to a socket being
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user