]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: retrieve session pointer from stream-int
authorWilly Tarreau <w@1wt.eu>
Fri, 28 Nov 2014 17:30:25 +0000 (18:30 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Dec 2014 22:47:31 +0000 (23:47 +0100)
sess_from_si() does this via the owner (struct task). It works because
all stream ints belong to a task nowadays.

include/proto/stream_interface.h

index 418fc8392cc3fa90e50e055ae0fab1c4dcc56dcd..9505a87b9c2b755c5a84522aa408a186d4d8de8d 100644 (file)
@@ -347,6 +347,12 @@ static inline int si_connect(struct stream_interface *si)
        return ret;
 }
 
+/* finds the session which owns a stream interface */
+static inline struct session *si_sess(struct stream_interface *si)
+{
+       return (struct session *)((struct task *)si->owner)->context;
+}
+
 /* for debugging, reports the stream interface state name */
 static inline const char *si_state_str(int state)
 {