--------------------- PatchSet 5360 Date: 2002/10/13 03:16:41 Author: adri Branch: commloops Tag: (none) Log: * trim some old code out * comm_old_accept() returns ERROR_NOMESSAGE if the error can be ignored. Use this! Members: src/comm.c:1.21.4.27->1.21.4.28 Index: squid/src/comm.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm.c,v retrieving revision 1.21.4.27 retrieving revision 1.21.4.28 diff -u -r1.21.4.27 -r1.21.4.28 --- squid/src/comm.c 12 Oct 2002 04:43:01 -0000 1.21.4.27 +++ squid/src/comm.c 13 Oct 2002 03:16:41 -0000 1.21.4.28 @@ -1,6 +1,6 @@ /* - * $Id: comm.c,v 1.21.4.27 2002/10/12 04:43:01 adri Exp $ + * $Id: comm.c,v 1.21.4.28 2002/10/13 03:16:41 adri Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -717,26 +717,6 @@ return new_socket; } -/* - * NOTE: set the listen queue to Squid_MaxFD/4 and rely on the kernel to - * impose an upper limit. Solaris' listen(3n) page says it has - * no limit on this parameter, but sys/socket.h sets SOMAXCONN - * to 5. HP-UX currently has a limit of 20. SunOS is 5 and - * OSF 3.0 is 8. - */ -int -comm_old_listen(int sock) -{ - int x; - if ((x = listen(sock, Squid_MaxFD >> 2)) < 0) { - debug(50, 0) ("comm_old_listen: listen(%d, %d): %s\n", - Squid_MaxFD >> 2, - sock, xstrerror()); - return x; - } - return sock; -} - void commConnectStart(int fd, const char *host, u_short port, CNCB * callback, void *data) { @@ -998,7 +978,7 @@ } /* Wait for an incoming connection on FD. FD should be a socket returned - * from comm_old_listen. */ + * from comm_listen. */ int comm_old_accept(int fd, struct sockaddr_in *pn, struct sockaddr_in *me) { @@ -1575,7 +1555,14 @@ int comm_listen(int sock) { - return comm_old_listen(sock); + int x; + if ((x = listen(sock, Squid_MaxFD >> 2)) < 0) { + debug(50, 0) ("comm_listen: listen(%d, %d): %s\n", + Squid_MaxFD >> 2, + sock, xstrerror()); + return x; + } + return sock; } @@ -1598,7 +1585,7 @@ if (newfd < 0) { /* Issues - check them */ - if (ignoreErrno(errno)) { + if (newfd == COMM_NOMESSAGE) { /* register interest again */ commSetSelect(fd, COMM_SELECT_READ, comm_accept_try, NULL, 0); return;