From: Willy Tarreau Date: Fri, 28 Nov 2014 17:30:25 +0000 (+0100) Subject: MINOR: stream-int: retrieve session pointer from stream-int X-Git-Tag: v1.6-dev1~228 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dd6a25;p=thirdparty%2Fhaproxy.git MINOR: stream-int: retrieve session pointer from stream-int sess_from_si() does this via the owner (struct task). It works because all stream ints belong to a task nowadays. --- diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index 418fc8392c..9505a87b9c 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -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) {