From 7dee63af083f766417499df3014033e2db94eecd Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 10 Apr 2006 22:17:05 +0000 Subject: [PATCH] rate limit 'soft limit execeeded' messages --- bin/named/query.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/named/query.c b/bin/named/query.c index 1faae69fa3..d01bb9c21d 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.198.2.13.4.36.4.1 2006/03/31 00:29:47 marka Exp $ */ +/* $Id: query.c,v 1.198.2.13.4.36.4.2 2006/04/10 22:17:05 marka Exp $ */ #include @@ -2091,10 +2091,16 @@ query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qdomain, result = isc_quota_attach(&ns_g_server->recursionquota, &client->recursionquota); if (result == ISC_R_SOFTQUOTA) { - ns_client_log(client, NS_LOGCATEGORY_CLIENT, - NS_LOGMODULE_QUERY, ISC_LOG_WARNING, - "recursive-clients soft limit exceeded, " - "aborting oldest query"); + static isc_stdtime_t last = 0; + isc_stdtime_t now; + isc_stdtime_get(&now); + if (now != last) { + ns_client_log(client, NS_LOGCATEGORY_CLIENT, + NS_LOGMODULE_QUERY, + ISC_LOG_WARNING, + "recursive-clients soft limit " + "exceeded, aborting oldest query"); + } ns_client_killoldestquery(client); result = ISC_R_SUCCESS; } else if (result == ISC_R_QUOTA) {