]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: stream-int: Move si_is_conn_error() in the header file
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 1 Apr 2022 11:56:30 +0000 (13:56 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Apr 2022 13:10:15 +0000 (15:10 +0200)
To ease next changes, this function is moved in the header file. It is a
transient commit.

include/haproxy/stream_interface.h
src/stream_interface.c

index 6c74007a787d41c11fef6a68b87e8a1235ccd6cf..3239c059dd72a709a7885069e1d1d84fdd6cd600 100644 (file)
@@ -313,6 +313,24 @@ static inline void si_update(struct stream_interface *si)
        si_update_tx(si);
 }
 
+/* The stream interface is only responsible for the connection during the early
+ * states, before plugging a mux. Thus it should only care about CO_FL_ERROR
+ * before CS_ST_EST, and after that it must absolutely ignore it since the mux
+ * may hold pending data. This function returns true if such an error was
+ * reported. Both the CS and the CONN must be valid.
+ */
+static inline int si_is_conn_error(const struct stream_interface *si)
+{
+       struct connection *conn;
+
+       if (si->cs->state >= CS_ST_EST)
+               return 0;
+
+       conn = __cs_conn(si->cs);
+       BUG_ON(!conn);
+       return !!(conn->flags & CO_FL_ERROR);
+}
+
 #endif /* _HAPROXY_STREAM_INTERFACE_H */
 
 /*
index ddeab7cc634dd43aaee3a5aa0b7c3531fe16fd08..f2dfbcdb4594ba6ee8a7083379193cb89e7529c0 100644 (file)
@@ -395,24 +395,6 @@ static void stream_int_notify(struct stream_interface *si)
                ic->flags &= ~CF_READ_DONTWAIT;
 }
 
-/* The stream interface is only responsible for the connection during the early
- * states, before plugging a mux. Thus it should only care about CO_FL_ERROR
- * before CS_ST_EST, and after that it must absolutely ignore it since the mux
- * may hold pending data. This function returns true if such an error was
- * reported. Both the CS and the CONN must be valid.
- */
-static inline int si_is_conn_error(const struct stream_interface *si)
-{
-       struct connection *conn;
-
-       if (si->cs->state >= CS_ST_EST)
-               return 0;
-
-       conn = __cs_conn(si->cs);
-       BUG_ON(!conn);
-       return !!(conn->flags & CO_FL_ERROR);
-}
-
 /* Called by I/O handlers after completion.. It propagates
  * connection flags to the stream interface, updates the stream (which may or
  * may not take this opportunity to try to forward data), then update the