]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: add a new pointer to the end point
authorWilly Tarreau <w@1wt.eu>
Sun, 29 Sep 2013 14:05:22 +0000 (16:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2013 14:40:22 +0000 (15:40 +0100)
The end point will correspond to either an applet context or a connection,
depending on the object type. For now the pointer remains null.

include/proto/stream_interface.h
include/types/stream_interface.h
src/stream_interface.c

index 516b11e8a76562d79c50a0a4324f1ffc13870d49..6dffcaf84155a3de1fb748a3c7e22fa89883111c 100644 (file)
@@ -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)
 {
        si->ops = &si_embedded_ops;
+       si->end = NULL;
        conn_prepare(si->conn, NULL, NULL, NULL, si);
        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)
 {
        si->ops = &si_conn_ops;
+       si->end = NULL;
        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)
 {
        si->ops = &si_conn_ops;
+       si->end = NULL;
        conn_assign(si->conn, &si_conn_cb, ctrl, xprt, si);
 }
 
 static inline void si_prepare_applet(struct stream_interface *si, struct si_applet *applet)
 {
        si->ops = &si_embedded_ops;
+       si->end = NULL;
        conn_prepare(si->conn, NULL, NULL, NULL, si);
        si->conn->target = &applet->obj_type;
 }
index b7f1a5a09728c4d83228b8f5c4efb1e9e7dee661..fc09aa613755d2e5c0afa03a9fbe13a4041973cb 100644 (file)
@@ -160,6 +160,7 @@ struct stream_interface {
        unsigned int exp;       /* wake up time for connect, queue, turn-around, ... */
        void *owner;            /* generally a (struct task*) */
        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 si_ops *ops;     /* general operations at the stream interface layer */
index 7faf85f1602d188cc36bd8c7fb3e7e8b5125eb10..55342e7ca416c1ac156f56b3e3db0d73d5b5ba06 100644 (file)
@@ -372,6 +372,7 @@ void stream_int_unregister_handler(struct stream_interface *si)
        si->release = NULL;
        si->owner = NULL;
        si->conn->target = NULL;
+       si->end = NULL;
 }
 
 /* This callback is used to send a valid PROXY protocol line to a socket being