From 2686dcad1ea8252ac4851bb02a1c5c734ced8115 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 26 Apr 2017 16:25:12 +0200 Subject: [PATCH] CLEANUP: connection: remove unused CO_FL_WAIT_DATA Very early in the connection rework process leading to v1.5-dev12, commit 56a77e5 ("MEDIUM: connection: complete the polling cleanups") marked the end of use for this flag which since was never set anymore, but it continues to be tested. Let's kill it now. --- contrib/debug/flags.c | 1 - include/proto/connection.h | 2 +- include/types/connection.h | 10 +++++----- src/connection.c | 2 +- src/stream_interface.c | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/contrib/debug/flags.c b/contrib/debug/flags.c index cf11a71f1..2638dd343 100644 --- a/contrib/debug/flags.c +++ b/contrib/debug/flags.c @@ -122,7 +122,6 @@ void show_conn_flags(unsigned int f) SHOW_FLAG(f, CO_FL_ADDR_TO_SET); SHOW_FLAG(f, CO_FL_ADDR_FROM_SET); SHOW_FLAG(f, CO_FL_WAIT_ROOM); - SHOW_FLAG(f, CO_FL_WAIT_DATA); SHOW_FLAG(f, CO_FL_XPRT_READY); SHOW_FLAG(f, CO_FL_CTRL_READY); SHOW_FLAG(f, CO_FL_CURR_WR_ENA); diff --git a/include/proto/connection.h b/include/proto/connection.h index 2380bb811..e8674462b 100644 --- a/include/proto/connection.h +++ b/include/proto/connection.h @@ -178,7 +178,7 @@ void conn_update_data_polling(struct connection *c); */ static inline void conn_refresh_polling_flags(struct connection *conn) { - conn->flags &= ~(CO_FL_WAIT_ROOM | CO_FL_WAIT_DATA); + conn->flags &= ~CO_FL_WAIT_ROOM; if (conn_ctrl_ready(conn)) { unsigned int flags = conn->flags & ~(CO_FL_CURR_RD_ENA | CO_FL_CURR_WR_ENA); diff --git a/include/types/connection.h b/include/types/connection.h index 9d1b51af2..60d977218 100644 --- a/include/types/connection.h +++ b/include/types/connection.h @@ -74,12 +74,12 @@ enum { CO_FL_CTRL_READY = 0x00000100, /* FD was registered, fd_delete() needed */ CO_FL_XPRT_READY = 0x00000200, /* xprt_init() done, xprt_close() needed */ - /* These flags are used by data layers to indicate they had to stop - * sending data because a buffer was empty (WAIT_DATA) or stop receiving - * data because a buffer was full (WAIT_ROOM). The connection handler - * clears them before first calling the I/O and data callbacks. + /* unused : 0x00000400 */ + + /* This flag is used by data layers to indicate they had to stop + * receiving data because a buffer was full. The connection handler + * clears it before first calling the I/O and data callbacks. */ - CO_FL_WAIT_DATA = 0x00000400, /* data source is empty */ CO_FL_WAIT_ROOM = 0x00000800, /* data sink is full */ /* These flags are used to report whether the from/to addresses are set or not */ diff --git a/src/connection.c b/src/connection.c index c23f464d3..f054cd13b 100644 --- a/src/connection.c +++ b/src/connection.c @@ -109,7 +109,7 @@ void conn_fd_handler(int fd) } if (conn->xprt && fd_send_ready(fd) && - ((conn->flags & (CO_FL_DATA_WR_ENA|CO_FL_WAIT_DATA|CO_FL_ERROR|CO_FL_HANDSHAKE)) == CO_FL_DATA_WR_ENA)) { + ((conn->flags & (CO_FL_DATA_WR_ENA|CO_FL_ERROR|CO_FL_HANDSHAKE)) == CO_FL_DATA_WR_ENA)) { /* force reporting of activity by clearing the previous flags : * we'll have at least ERROR or CONNECTED at the end of an I/O, * both of which will be detected below. diff --git a/src/stream_interface.c b/src/stream_interface.c index 4a0038842..47ba8c1f6 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -633,7 +633,7 @@ static void si_conn_send(struct connection *conn) /* when we're here, we already know that there is no spliced * data left, and that there are sendable buffered data. */ - if (!(conn->flags & (CO_FL_ERROR | CO_FL_SOCK_WR_SH | CO_FL_DATA_WR_SH | CO_FL_WAIT_DATA | CO_FL_HANDSHAKE))) { + if (!(conn->flags & (CO_FL_ERROR | CO_FL_SOCK_WR_SH | CO_FL_DATA_WR_SH | CO_FL_HANDSHAKE))) { /* check if we want to inform the kernel that we're interested in * sending more data after this call. We want this if : * - we're about to close after this last send and want to merge