diff --git a/include/proto/connection.h b/include/proto/connection.h index b08044996..84f2f0e48 100644 --- a/include/proto/connection.h +++ b/include/proto/connection.h @@ -30,6 +30,14 @@ */ int conn_fd_handler(int fd); +/* Calls the close() function of the data layer if any */ +static inline void conn_data_close(struct connection *conn) +{ + if (conn->data->close) + conn->data->close(conn); +} + + #endif /* _PROTO_CONNECTION_H */ /* diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index c7ae117cc..91691c09c 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -199,13 +199,6 @@ static inline int si_connect(struct stream_interface *si) return si_ctrl(si)->connect(si); } -/* Calls the close() function of the data layer if any */ -static inline void si_data_close(struct stream_interface *si) -{ - if (si->conn.data->close) - si->conn.data->close(&si->conn); -} - #endif /* _PROTO_STREAM_INTERFACE_H */ /* diff --git a/src/session.c b/src/session.c index eca06d934..cca23a5f7 100644 --- a/src/session.c +++ b/src/session.c @@ -546,7 +546,7 @@ static int sess_update_st_con_tcp(struct session *s, struct stream_interface *si si->flags &= ~SI_FL_CAP_SPLICE; fd_delete(si_fd(si)); - si_data_close(si); + conn_data_close(&si->conn); if (si->release) si->release(si); diff --git a/src/sock_raw.c b/src/sock_raw.c index a50d77ad3..39a962e01 100644 --- a/src/sock_raw.c +++ b/src/sock_raw.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -710,7 +711,7 @@ static void sock_raw_shutw(struct stream_interface *si) /* we may have to close a pending connection, and mark the * response buffer as shutr */ - si_data_close(si); + conn_data_close(&si->conn); fd_delete(si_fd(si)); /* fall through */ case SI_ST_CER: @@ -748,7 +749,7 @@ static void sock_raw_shutr(struct stream_interface *si) return; if (si->ob->flags & BF_SHUTW) { - si_data_close(si); + conn_data_close(&si->conn); fd_delete(si_fd(si)); si->state = SI_ST_DIS; si->exp = TICK_ETERNITY; diff --git a/src/stream_interface.c b/src/stream_interface.c index cf26b51ab..030c7c10d 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -230,7 +231,7 @@ static void stream_int_shutr(struct stream_interface *si) si->state = SI_ST_DIS; si->exp = TICK_ETERNITY; - si_data_close(si); + conn_data_close(&si->conn); if (si->release) si->release(si); } @@ -267,7 +268,7 @@ static void stream_int_shutw(struct stream_interface *si) si->state = SI_ST_DIS; /* fall through */ - si_data_close(si); + conn_data_close(&si->conn); if (si->release) si->release(si); default: