From 58a96f63877267fadd3faf91f4ec896deaa03bfd Mon Sep 17 00:00:00 2001 From: wessels <> Date: Sat, 1 Nov 1997 05:52:38 +0000 Subject: [PATCH] fix up includes and defines --- test-suite/tcp-banger2.c | 64 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/test-suite/tcp-banger2.c b/test-suite/tcp-banger2.c index 0b72c85c0f..e6ecb7d1a9 100644 --- a/test-suite/tcp-banger2.c +++ b/test-suite/tcp-banger2.c @@ -1,21 +1,81 @@ +#include "config.h" -#define FD_SETSIZE 1024 +/* + * On some systems, FD_SETSIZE is set to something lower than the + * actual number of files which can be opened. IRIX is one case, + * NetBSD is another. So here we increase FD_SETSIZE to our + * configure-discovered maximum *before* any system includes. + */ +#define CHANGE_FD_SETSIZE 1 -#include +/* Cannot increase FD_SETSIZE on Linux */ +#if defined(_SQUID_LINUX_) +#undef CHANGE_FD_SETSIZE +#define CHANGE_FD_SETSIZE 0 +#endif + +/* Cannot increase FD_SETSIZE on FreeBSD before 2.2.0, causes select(2) + * to return EINVAL. */ +/* Marian Durkovic */ +/* Peter Wemm */ +#if defined(_SQUID_FREEBSD_) +#include +#if __FreeBSD_version < 220000 +#undef CHANGE_FD_SETSIZE +#define CHANGE_FD_SETSIZE 0 +#endif +#endif + +/* Increase FD_SETSIZE if SQUID_MAXFD is bigger */ +#if CHANGE_FD_SETSIZE && SQUID_MAXFD > DEFAULT_FD_SETSIZE +#define FD_SETSIZE SQUID_MAXFD +#endif + +#if HAVE_UNISTD_H #include +#endif +#if HAVE_STDLIB_H #include +#endif +#if HAVE_STDIO_H +#include +#endif +#if HAVE_FCNTL_H #include +#endif +#ifdef HAVE_STRING_H #include +#endif +#ifdef HAVE_STRINGS_H #include +#endif +#if HAVE_SYS_TYPES_H #include +#endif +#if HAVE_SYS_SELECT_H #include +#endif +#if HAVE_SIGNAL_H #include +#endif +#if HAVE_TIME_H #include +#endif +#if HAVE_SYS_TIME_H #include +#endif +#if HAVE_SYS_SOCKET_H #include +#endif +#if HAVE_NETINET_IN_H #include +#endif +#if HAVE_ARPA_INET_H #include +#endif +#if HAVE_ERRNO_H #include +#endif #define PROXY_PORT 3128 #define PROXY_ADDR "127.0.0.1" -- 2.47.3