Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
c2955d0a
Commit
c2955d0a
authored
Nov 18, 2015
by
Mark Andrews
Browse files
win32: new -> newtable
(cherry picked from commit 5060d8639e932680456ab07519687d68298be5e0)
parent
dec590a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/dns/badcache.c
View file @
c2955d0a
...
...
@@ -122,7 +122,7 @@ dns_badcache_destroy(dns_badcache_t **bcp) {
static
isc_result_t
badcache_resize
(
dns_badcache_t
*
bc
,
isc_time_t
*
now
,
isc_boolean_t
grow
)
{
dns_bcentry_t
**
new
,
*
bad
,
*
next
;
dns_bcentry_t
**
new
table
,
*
bad
,
*
next
;
unsigned
int
newsize
,
i
;
if
(
grow
)
...
...
@@ -130,10 +130,10 @@ badcache_resize(dns_badcache_t *bc, isc_time_t *now, isc_boolean_t grow) {
else
newsize
=
(
bc
->
size
-
1
)
/
2
;
new
=
isc_mem_get
(
bc
->
mctx
,
sizeof
(
dns_bcentry_t
*
)
*
newsize
);
if
(
new
==
NULL
)
new
table
=
isc_mem_get
(
bc
->
mctx
,
sizeof
(
dns_bcentry_t
*
)
*
newsize
);
if
(
new
table
==
NULL
)
return
(
ISC_R_NOMEMORY
);
memset
(
new
,
0
,
sizeof
(
dns_bcentry_t
*
)
*
newsize
);
memset
(
new
table
,
0
,
sizeof
(
dns_bcentry_t
*
)
*
newsize
);
for
(
i
=
0
;
bc
->
count
>
0
&&
i
<
bc
->
size
;
i
++
)
{
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
);
bc
->
count
--
;
}
else
{
bad
->
next
=
new
[
bad
->
hashval
%
newsize
];
new
[
bad
->
hashval
%
newsize
]
=
bad
;
bad
->
next
=
new
table
[
bad
->
hashval
%
newsize
];
new
table
[
bad
->
hashval
%
newsize
]
=
bad
;
}
}
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
);
bc
->
size
=
newsize
;
bc
->
table
=
new
;
bc
->
table
=
new
table
;
return
(
ISC_R_SUCCESS
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment