#include <haproxy/api.h>
#include <haproxy/connection.h>
#include <haproxy/hstream-t.h>
+#include <haproxy/hldstream-t.h>
#include <haproxy/htx-t.h>
#include <haproxy/obj_type.h>
#include <haproxy/stconn-t.h>
return NULL;
}
+/* Returns the haload stream from a sc if the application is a
+ * haload stream. Otherwise NULL is returned. __sc_hldstream() returns the haterm
+ * stream without any control while sc_hldstream() check the application type.
+ */
+static inline struct hldstream *__sc_hldstream(const struct stconn *sc)
+{
+ return __objt_hldstream(sc->app);
+}
+static inline struct hldstream *sc_hldstream(const struct stconn *sc)
+{
+ if (obj_type(sc->app) == OBJ_TYPE_HALOAD)
+ return __objt_hldstream(sc->app);
+ return NULL;
+}
+
/* Returns non-zero if the stream connector's Rx path is blocked because of
* lack of room in the input buffer. This usually happens after applets failed
* to deliver data into the channel's buffer and reported it via sc_need_room().