Mercurial > dnsbl
diff src/dnsbl.cpp @ 63:579dc5955cbe
only keep 20% of the open resolver sockets in the ready pool.
author | carl |
---|---|
date | Sun, 16 Jan 2005 08:33:55 -0800 |
parents | 7ad7d8b100bf |
children | 6add229288a8 |
line wrap: on
line diff
--- a/src/dnsbl.cpp Sun Jan 16 08:25:36 2005 -0800 +++ b/src/dnsbl.cpp Sun Jan 16 08:33:55 2005 -0800 @@ -444,14 +444,14 @@ else { int result = pthread_mutex_lock(&fd_pool_mutex); if (!result) { - if (resolver_sock_count > resolver_pool_size*5) { + if ((resolver_sock_count > resolver_pool_size*5) || (resolver_pool_size < 5)) { // return the fd to the pool fd_pool.insert(fd); resolver_pool_size++; } else { - // more than 20% of the open resolver sockets are in the pool - // that is enough, so just close this one. + // more than 20% of the open resolver sockets are in the pool, and the + // pool as at least 5 sockets. that is enough, so just close this one. my_disconnect(fd); } pthread_mutex_unlock(&fd_pool_mutex);