]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: add si_done_{get,put} to indicate that we won't do it anymore
authorWilly Tarreau <w@1wt.eu>
Tue, 6 Nov 2018 18:17:31 +0000 (19:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 11 Nov 2018 09:18:37 +0000 (10:18 +0100)
This is useful on close or stream aborts as it saves us from having
to manipulate the (sometimes confusing) flags.

include/proto/stream_interface.h

index f636094ed6bda2e4cd0ace606b8eb907053236a8..c320784e781d191cc0219a15b7a87e21dd72a13a 100644 (file)
@@ -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,