diff --git a/include/proto/connection.h b/include/proto/connection.h index a7b596a50..f67465832 100644 --- a/include/proto/connection.h +++ b/include/proto/connection.h @@ -501,6 +501,15 @@ static inline void cs_close(struct conn_stream *cs) cs->flags = CS_FL_NONE; } +/* sets CS_FL_ERROR or CS_FL_ERR_PENDING on the cs */ +static inline void cs_set_error(struct conn_stream *cs) +{ + if (cs->flags & CS_FL_EOS) + cs->flags |= CS_FL_ERROR; + else + cs->flags |= CS_FL_REOS | CS_FL_ERR_PENDING; +} + /* detect sock->data read0 transition */ static inline int conn_xprt_read0_pending(struct connection *c) {