From 10d6040679e57562da99c0401a9f7455a69c9a59 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 28 Nov 2014 18:30:25 +0100 Subject: 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. --- include/proto/stream_interface.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index 418fc83..9505a87 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) { -- 1.7.12.1