mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
Pulling rt15970 into HEAD.
This commit is contained in:
parent
602784c4ce
commit
1e844d04a7
@ -14,7 +14,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: acache.c,v 1.12 2006/04/26 12:03:08 shane Exp $ */
|
||||
/* $Id: acache.c,v 1.13 2006/04/26 12:12:45 shane Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -1247,6 +1247,21 @@ dns_acache_createentry(dns_acache_t *acache, dns_db_t *origdb,
|
||||
REQUIRE(entryp != NULL && *entryp == NULL);
|
||||
REQUIRE(origdb != NULL);
|
||||
|
||||
/*
|
||||
* Should we exceed our memory limit for some reason (for
|
||||
* example, if the cleaner does not run aggressively enough),
|
||||
* then we will not create additional entries.
|
||||
*
|
||||
* XXX: It might be better to lock the acache->cleaner->lock,
|
||||
* but locking may be an expensive bottleneck. If we misread
|
||||
* the value, we will occasionally refuse to create a few
|
||||
* cache entries, or create a few that we should not. I do not
|
||||
* expect this to happen often, and it will not have very bad
|
||||
* effects when it does. So no lock for now.
|
||||
*/
|
||||
if (acache->cleaner.overmem)
|
||||
return (ISC_R_NORESOURCES);
|
||||
|
||||
newentry = isc_mem_get(acache->mctx, sizeof(*newentry));
|
||||
if (newentry == NULL)
|
||||
return (ISC_R_NOMEMORY);
|
||||
|
Loading…
x
Reference in New Issue
Block a user