# HG changeset patch # User carl # Date 1105893235 28800 # Node ID 579dc5955cbe3f2528a5a2aacdceb3a6deeecf39 # Parent 7ad7d8b100bfc0ad6f1508b923b43afad45b58a4 only keep 20% of the open resolver sockets in the ready pool. diff -r 7ad7d8b100bf -r 579dc5955cbe src/dnsbl.cpp --- 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);