From 97314589dec9feca4c10c2350dfbd7702ff44cb1 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 13 Nov 2018 18:44:39 +0100 Subject: swrap: Do not log if we are over the limit in find_socket_info_index() There are applications which do: for (fd = 0; fd <= getdtablesize(); fd++) { close(fd) }; This produced millions of error messsages. Signed-off-by: Andreas Schneider Reviewed-by: Ralph Boehme --- src/socket_wrapper.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index e02f083..df70df5 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -1540,11 +1540,23 @@ static int find_socket_info_index(int fd) } if ((size_t)fd >= socket_fds_max) { + /* + * Do not add a log here as some applications do stupid things + * like: + * + * for (fd = 0; fd <= getdtablesize(); fd++) { + * close(fd) + * }; + * + * This would produce millions of lines of debug messages. + */ +#if 0 SWRAP_LOG(SWRAP_LOG_ERROR, - "The max socket index limit of %zu has been reached, " - "trying to add %d", - socket_fds_max, - fd); + "Looking for a socket info for the fd %d is over the " + "max socket index limit of %zu.", + fd, + socket_fds_max); +#endif return -1; } -- cgit v1.2.3