Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
David Goulet
Tor
Commits
c2f28615
Commit
c2f28615
authored
Jul 27, 2006
by
Nick Mathewson
🏃
Browse files
More asserts in dns.c
svn:r6926
parent
8786b4b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/or/dns.c
View file @
c2f28615
...
...
@@ -224,10 +224,11 @@ static cached_resolve_t *newest_cached_resolve = NULL;
static
void
purge_expired_resolves
(
uint32_t
now
)
{
cached_resolve_t
*
resolve
;
cached_resolve_t
*
resolve
,
*
removed
;
pending_connection_t
*
pend
;
edge_connection_t
*
pendconn
;
assert_cache_ok
();
/* this is fast because the linked list
* oldest_cached_resolve is ordered by when they came in.
*/
...
...
@@ -264,10 +265,12 @@ purge_expired_resolves(uint32_t now)
if
(
!
oldest_cached_resolve
)
/* if there are no more, */
newest_cached_resolve
=
NULL
;
/* then make sure the list's tail knows
* that too */
HT_REMOVE
(
cache_map
,
&
cache_root
,
resolve
);
removed
=
HT_REMOVE
(
cache_map
,
&
cache_root
,
resolve
);
tor_assert
(
removed
==
resolve
);
resolve
->
magic
=
0xF0BBF0BB
;
tor_free
(
resolve
);
}
assert_cache_ok
();
}
/** Send a response to the RESOVLE request of a connection. answer_type must
...
...
@@ -595,7 +598,8 @@ dns_purge_resolve(cached_resolve_t *resolve)
}
/* remove resolve from the map */
HT_REMOVE
(
cache_map
,
&
cache_root
,
resolve
);
tmp
=
HT_REMOVE
(
cache_map
,
&
cache_root
,
resolve
);
tor_assert
(
tmp
==
resolve
);
resolve
->
magic
=
0xAAAAAAAA
;
tor_free
(
resolve
);
}
...
...
Write
Preview
Markdown
is supported
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