}
+/* The conn-stream 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 cs_is_conn_error(const struct conn_stream *cs)
+{
+ struct connection *conn;
+
+ if (cs->state >= CS_ST_EST)
+ return 0;
+
+ conn = __cs_conn(cs);
+ BUG_ON(!conn);
+ return !!(conn->flags & CO_FL_ERROR);
+}
+
+
/* Returns the source address of the conn-stream and, if not set, fallbacks on
* the session for frontend CS and the server connection for the backend CS. It
* returns a const address on success or NULL on failure.
return ret;
}
-/* 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 */
/*
if (!(cs->wait_event.events & SUB_RETRY_SEND) && !channel_is_empty(cs_oc(cs)))
cs_conn_send(cs);
- if (cs->endp->flags & (CS_EP_ERROR|CS_EP_ERR_PENDING) || si_is_conn_error(cs->si)) {
+ if (cs->endp->flags & (CS_EP_ERROR|CS_EP_ERR_PENDING) || cs_is_conn_error(cs)) {
/* Write error on the file descriptor */
if (cs->state >= CS_ST_CON)
cs->endp->flags |= CS_EP_ERROR;
*/
if (cs->state >= CS_ST_CON) {
- if (si_is_conn_error(cs->si))
+ if (cs_is_conn_error(cs))
cs->endp->flags |= CS_EP_ERROR;
}
int ret;
int did_send = 0;
- if (cs->endp->flags & (CS_EP_ERROR|CS_EP_ERR_PENDING) || si_is_conn_error(cs->si)) {
+ if (cs->endp->flags & (CS_EP_ERROR|CS_EP_ERR_PENDING) || cs_is_conn_error(cs)) {
/* We're probably there because the tasklet was woken up,
* but process_stream() ran before, detected there were an
* error and put the si back to CS_ST_TAR. There's still