From: wessels <> Date: Tue, 21 Jul 1998 23:34:20 +0000 (+0000) Subject: examine_select got duplicated X-Git-Tag: SQUID_3_0_PRE1~3023 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b8ffae4f2c6da6f85b7a59d153b69ae83baa906;p=thirdparty%2Fsquid.git examine_select got duplicated --- diff --git a/src/comm.cc b/src/comm.cc index be6f0ecdd7..a8573ce53c 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,7 +1,7 @@ /* - * $Id: comm.cc,v 1.276 1998/07/21 17:03:50 wessels Exp $ + * $Id: comm.cc,v 1.277 1998/07/21 17:34:20 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -133,9 +133,6 @@ typedef struct { /* STATIC */ static int commBind(int s, struct in_addr, u_short port); -#if !HAVE_POLL -static int examine_select(fd_set *, fd_set *); -#endif static void commSetReuseAddr(int); static void commSetNoLinger(int); static void CommWriteStateCallbackAndFree(int fd, int code); @@ -832,75 +829,6 @@ comm_init(void) RESERVED_FD = XMIN(100, Squid_MaxFD / 4); } - -#if !HAVE_POLL -/* - * examine_select - debug routine. - * - * I spend the day chasing this core dump that occurs when both the client - * and the server side of a cache fetch simultaneoulsy abort the - * connection. While I haven't really studied the code to figure out how - * it happens, the snippet below may prevent the cache from exitting: - * - * Call this from where the select loop fails. - */ -static int -examine_select(fd_set * readfds, fd_set * writefds) -{ - int fd = 0; - fd_set read_x; - fd_set write_x; - int num; - struct timeval tv; - close_handler *ch = NULL; - fde *F = NULL; - - debug(5, 0) ("examine_select: Examining open file descriptors...\n"); - for (fd = 0; fd < Squid_MaxFD; fd++) { - FD_ZERO(&read_x); - FD_ZERO(&write_x); - tv.tv_sec = tv.tv_usec = 0; - if (FD_ISSET(fd, readfds)) - FD_SET(fd, &read_x); - else if (FD_ISSET(fd, writefds)) - FD_SET(fd, &write_x); - else - continue; - num = select(Squid_MaxFD, &read_x, &write_x, NULL, &tv); - if (num > -1) { - debug(5, 5) ("FD %d is valid.\n", fd); - continue; - } - F = &fd_table[fd]; - debug(5, 0) ("FD %d: %s\n", fd, xstrerror()); - debug(5, 0) ("WARNING: FD %d has handlers, but it's invalid.\n", fd); - debug(5, 0) ("FD %d is a %s called '%s'\n", - fd, - fdTypeStr[fd_table[fd].type], - F->desc); - debug(5, 0) ("tmout:%p read:%p write:%p\n", - F->timeout_handler, - F->read_handler, - F->write_handler); - for (ch = F->close_handler; ch; ch = ch->next) - debug(5, 0) (" close handler: %p\n", ch->handler); - if (F->close_handler) { - commCallCloseHandlers(fd); - } else if (F->timeout_handler) { - debug(5, 0) ("examine_select: Calling Timeout Handler\n"); - F->timeout_handler(fd, F->timeout_data); - } - F->close_handler = NULL; - F->timeout_handler = NULL; - F->read_handler = NULL; - F->write_handler = NULL; - FD_CLR(fd, readfds); - FD_CLR(fd, writefds); - } - return 0; -} -#endif - /* Write to FD. */ static void commHandleWrite(int fd, void *data)