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
ccfda2e3
Commit
ccfda2e3
authored
Jul 17, 2007
by
Roger Dingledine
Browse files
a few fixes for bug 463. needs a changelog. might need more fixes.
svn:r10849
parent
ad45ddfb
Changes
1
Show whitespace changes
Inline
Side-by-side
src/or/dns.c
View file @
ccfda2e3
...
@@ -536,8 +536,8 @@ dns_resolve(edge_connection_t *exitconn)
...
@@ -536,8 +536,8 @@ dns_resolve(edge_connection_t *exitconn)
r
=
dns_resolve_impl
(
exitconn
,
is_resolve
,
oncirc
,
&
hostname
);
r
=
dns_resolve_impl
(
exitconn
,
is_resolve
,
oncirc
,
&
hostname
);
switch
(
r
)
{
switch
(
r
)
{
case
1
:
case
1
:
/* We got an answer without a lookup
. (E
ither the answer was
/* We got an answer without a lookup
-- e
ither the answer was
* cached, or it was obvious (like an IP address).
)
*/
* cached, or it was obvious (like an IP address).
*/
if
(
is_resolve
)
{
if
(
is_resolve
)
{
/* Send the answer back right now, and detach. */
/* Send the answer back right now, and detach. */
if
(
hostname
)
if
(
hostname
)
...
@@ -562,7 +562,7 @@ dns_resolve(edge_connection_t *exitconn)
...
@@ -562,7 +562,7 @@ dns_resolve(edge_connection_t *exitconn)
case
-
2
:
case
-
2
:
case
-
1
:
case
-
1
:
/* The request failed before it could start: cancel this connection,
/* The request failed before it could start: cancel this connection,
* and stop everybody waiting forthe same connection. */
* and stop everybody waiting for
the same connection. */
if
(
is_resolve
)
{
if
(
is_resolve
)
{
send_resolved_cell
(
exitconn
,
send_resolved_cell
(
exitconn
,
(
r
==
-
1
)
?
RESOLVED_TYPE_ERROR
:
RESOLVED_TYPE_ERROR_TRANSIENT
);
(
r
==
-
1
)
?
RESOLVED_TYPE_ERROR
:
RESOLVED_TYPE_ERROR_TRANSIENT
);
...
@@ -578,7 +578,7 @@ dns_resolve(edge_connection_t *exitconn)
...
@@ -578,7 +578,7 @@ dns_resolve(edge_connection_t *exitconn)
// If it's marked for close, it's on closeable_connection_lst in
// If it's marked for close, it's on closeable_connection_lst in
// main.c. If it's on the closeable list, it will get freed from
// main.c. If it's on the closeable list, it will get freed from
// main.c. -NM
// main.c. -NM
// "<armadev> If that's true, there are other bugs arond, where we
// "<armadev> If that's true, there are other bugs aro
u
nd, where we
// don't check if it's marked, and will end up double-freeing."
// don't check if it's marked, and will end up double-freeing."
}
}
break
;
break
;
...
@@ -822,9 +822,12 @@ dns_cancel_pending_resolve(const char *address)
...
@@ -822,9 +822,12 @@ dns_cancel_pending_resolve(const char *address)
strlcpy
(
search
.
address
,
address
,
sizeof
(
search
.
address
));
strlcpy
(
search
.
address
,
address
,
sizeof
(
search
.
address
));
resolve
=
HT_FIND
(
cache_map
,
&
cache_root
,
&
search
);
resolve
=
HT_FIND
(
cache_map
,
&
cache_root
,
&
search
);
if
(
!
resolve
||
resolve
->
state
!=
CACHE_STATE_PENDING
)
{
if
(
!
resolve
)
log_notice
(
LD_BUG
,
"Address %s is not pending. Dropping."
,
return
;
escaped_safe_str
(
address
));
if
(
resolve
->
state
!=
CACHE_STATE_PENDING
)
{
log_notice
(
LD_BUG
,
"Address %s is not pending (state %d). Dropping."
,
escaped_safe_str
(
address
),
resolve
->
state
);
return
;
return
;
}
}
...
...
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