From: Willy Tarreau Date: Fri, 28 Nov 2014 13:22:12 +0000 (+0100) Subject: MAJOR: channel: only rely on the new CF_ISRESP flag to find the SI X-Git-Tag: v1.6-dev1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5decc05a9e065de28f6bc69e5bd554bfefa1db4f;p=thirdparty%2Fhaproxy.git MAJOR: channel: only rely on the new CF_ISRESP flag to find the SI Now we exclusively use this flag to find what side a channel is and where the stream ints are. The ->prod and ->cons are not used anymore. --- diff --git a/include/proto/channel.h b/include/proto/channel.h index 28043f0795..0c547dd74f 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -33,6 +33,7 @@ #include #include +#include #include /* perform minimal intializations, report 0 in case of error, 1 if OK. */ @@ -56,13 +57,19 @@ int bo_getblk_nc(struct channel *chn, char **blk1, int *len1, char **blk2, int * /* returns a pointer to the stream interface feeding the channel (producer) */ static inline struct stream_interface *chn_prod(const struct channel *chn) { - return chn->prod; + if (chn->flags & CF_ISRESP) + return &LIST_ELEM(chn, struct session *, res)->si[1]; + else + return &LIST_ELEM(chn, struct session *, req)->si[0]; } /* returns a pointer to the stream interface consuming the channel (producer) */ static inline struct stream_interface *chn_cons(const struct channel *chn) { - return chn->cons; + if (chn->flags & CF_ISRESP) + return &LIST_ELEM(chn, struct session *, res)->si[0]; + else + return &LIST_ELEM(chn, struct session *, req)->si[1]; } /* Initialize all fields in the channel. */