]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stream-interface: set the pointer to the applet into the applet context
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Oct 2013 18:03:27 +0000 (20:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Dec 2013 14:40:22 +0000 (15:40 +0100)
In preparation for a later move of all the applet context outside of the
stream interface, we'll need to have access to the applet itself from the
context. Let's have a pointer to it inside the context.

include/proto/stream_interface.h
include/types/stream_interface.h

index 6dffcaf84155a3de1fb748a3c7e22fa89883111c..26e9bfa5345fe03ec83ca6fa9e30c596d5ddc62e 100644 (file)
@@ -57,6 +57,7 @@ static inline void si_prepare_none(struct stream_interface *si)
        si->end = NULL;
        conn_prepare(si->conn, NULL, NULL, NULL, si);
        si->conn->target = NULL;
+       si->appctx.applet = NULL;
 }
 
 static inline void si_prepare_conn(struct stream_interface *si, const struct protocol *ctrl, const struct xprt_ops *xprt)
@@ -79,6 +80,7 @@ static inline void si_prepare_applet(struct stream_interface *si, struct si_appl
        si->end = NULL;
        conn_prepare(si->conn, NULL, NULL, NULL, si);
        si->conn->target = &applet->obj_type;
+       si->appctx.applet = applet;
 }
 
 /* Sends a shutr to the connection using the data layer */
index fc09aa613755d2e5c0afa03a9fbe13a4041973cb..588f4c48b49dd1b8a35d7da185bee2f63227d29b 100644 (file)
@@ -79,6 +79,7 @@ enum {
 };
 
 struct stream_interface;
+struct si_applet;
 
 /* operations available on a stream-interface */
 struct si_ops {
@@ -95,6 +96,7 @@ struct appctx {
        unsigned int st0;          /* CLI state for stats, session state for peers */
        unsigned int st1;          /* prompt for stats, session error for peers */
        unsigned int st2;          /* output state for stats, unused by peers  */
+       struct si_applet *applet;  /* applet this context refers to */
 
        union {
                struct {