mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 08:05:21 +00:00
win32: new -> newtable
(cherry picked from commit 5060d8639e932680456ab07519687d68298be5e0)
This commit is contained in:
@@ -122,7 +122,7 @@ dns_badcache_destroy(dns_badcache_t **bcp) {
|
|||||||
|
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
badcache_resize(dns_badcache_t *bc, isc_time_t *now, isc_boolean_t grow) {
|
badcache_resize(dns_badcache_t *bc, isc_time_t *now, isc_boolean_t grow) {
|
||||||
dns_bcentry_t **new, *bad, *next;
|
dns_bcentry_t **newtable, *bad, *next;
|
||||||
unsigned int newsize, i;
|
unsigned int newsize, i;
|
||||||
|
|
||||||
if (grow)
|
if (grow)
|
||||||
@@ -130,10 +130,10 @@ badcache_resize(dns_badcache_t *bc, isc_time_t *now, isc_boolean_t grow) {
|
|||||||
else
|
else
|
||||||
newsize = (bc->size - 1) / 2;
|
newsize = (bc->size - 1) / 2;
|
||||||
|
|
||||||
new = isc_mem_get(bc->mctx, sizeof(dns_bcentry_t *) * newsize);
|
newtable = isc_mem_get(bc->mctx, sizeof(dns_bcentry_t *) * newsize);
|
||||||
if (new == NULL)
|
if (newtable == NULL)
|
||||||
return (ISC_R_NOMEMORY);
|
return (ISC_R_NOMEMORY);
|
||||||
memset(new, 0, sizeof(dns_bcentry_t *) * newsize);
|
memset(newtable, 0, sizeof(dns_bcentry_t *) * newsize);
|
||||||
|
|
||||||
for (i = 0; bc->count > 0 && i < bc->size; i++) {
|
for (i = 0; bc->count > 0 && i < bc->size; i++) {
|
||||||
for (bad = bc->table[i]; bad != NULL; bad = next) {
|
for (bad = bc->table[i]; bad != NULL; bad = next) {
|
||||||
@@ -143,8 +143,8 @@ badcache_resize(dns_badcache_t *bc, isc_time_t *now, isc_boolean_t grow) {
|
|||||||
sizeof(*bad) + bad->name.length);
|
sizeof(*bad) + bad->name.length);
|
||||||
bc->count--;
|
bc->count--;
|
||||||
} else {
|
} else {
|
||||||
bad->next = new[bad->hashval % newsize];
|
bad->next = newtable[bad->hashval % newsize];
|
||||||
new[bad->hashval % newsize] = bad;
|
newtable[bad->hashval % newsize] = bad;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bc->table[i] = NULL;
|
bc->table[i] = NULL;
|
||||||
@@ -152,7 +152,7 @@ badcache_resize(dns_badcache_t *bc, isc_time_t *now, isc_boolean_t grow) {
|
|||||||
|
|
||||||
isc_mem_put(bc->mctx, bc->table, sizeof(*bc->table) * bc->size);
|
isc_mem_put(bc->mctx, bc->table, sizeof(*bc->table) * bc->size);
|
||||||
bc->size = newsize;
|
bc->size = newsize;
|
||||||
bc->table = new;
|
bc->table = newtable;
|
||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user