From: Willy Tarreau Date: Tue, 6 Nov 2018 18:17:31 +0000 (+0100) Subject: MINOR: stream-int: add si_done_{get,put} to indicate that we won't do it anymore X-Git-Tag: v1.9-dev6~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=394970c29737ad808f29dbe331aece73b6d37262;p=thirdparty%2Fhaproxy.git MINOR: stream-int: add si_done_{get,put} to indicate that we won't do it anymore This is useful on close or stream aborts as it saves us from having to manipulate the (sometimes confusing) flags. --- diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index f636094ed6..c320784e78 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -266,6 +266,12 @@ static inline void si_stop_put(struct stream_interface *si) si->flags &= ~SI_FL_WANT_PUT; } +/* Report that a stream interface won't put any more data into the input buffer */ +static inline void si_done_put(struct stream_interface *si) +{ + si->flags &= ~(SI_FL_WANT_PUT | SI_FL_WAIT_ROOM); +} + /* Report that a stream interface wants to get some data from the output buffer */ static inline void si_want_get(struct stream_interface *si) { @@ -284,6 +290,12 @@ static inline void si_stop_get(struct stream_interface *si) si->flags &= ~SI_FL_WANT_GET; } +/* Report that a stream interface won't get any more data from the output buffer */ +static inline void si_done_get(struct stream_interface *si) +{ + si->flags &= ~(SI_FL_WANT_GET | SI_FL_WAIT_DATA); +} + /* Try to allocate a new conn_stream and assign it to the interface. If * an endpoint was previously allocated, it is released first. The newly * allocated conn_stream is initialized, assigned to the stream interface,