From: wessels <> Date: Sat, 23 May 1998 05:07:39 +0000 (+0000) Subject: dont push persistent connections if were low on FDs X-Git-Tag: SQUID_3_0_PRE1~3275 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47c9d5797d4213405917a8673265477f1304b5cc;p=thirdparty%2Fsquid.git dont push persistent connections if were low on FDs --- diff --git a/src/pconn.cc b/src/pconn.cc index cba871f6fa..3a2bd4911e 100644 --- a/src/pconn.cc +++ b/src/pconn.cc @@ -1,6 +1,6 @@ /* - * $Id: pconn.cc,v 1.14 1998/02/26 18:00:48 wessels Exp $ + * $Id: pconn.cc,v 1.15 1998/05/22 23:07:39 wessels Exp $ * * DEBUG: section 48 Persistent Connections * AUTHOR: Duane Wessels @@ -173,6 +173,11 @@ pconnPush(int fd, const char *host, u_short port) struct _pconn *p; LOCAL_ARRAY(char, key, SQUIDHOSTNAMELEN + 10); LOCAL_ARRAY(char, desc, FD_DESC_SZ); + if (fdNFree() < (RESERVED_FD<<2)) { + debug(48, 3) ("pconnPush: Not many unused FDs\n"); + comm_close(fd); + return; + } assert(table != NULL); strcpy(key, pconnKey(host, port)); p = (struct _pconn *) hash_lookup(table, key);