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
322c728e
Commit
322c728e
authored
Feb 05, 2005
by
Nick Mathewson
🎨
Browse files
Fix tor-resolve implementation to prevent crashes and send resolves when we should.
svn:r3561
parent
0ff41a3b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/or/connection_edge.c
View file @
322c728e
...
...
@@ -904,18 +904,17 @@ int connection_exit_begin_resolve(cell_t *cell, circuit_t *circ) {
dummy_conn
->
state
=
EXIT_CONN_STATE_RESOLVEFAILED
;
dummy_conn
->
purpose
=
EXIT_PURPOSE_RESOLVE
;
dummy_conn
->
next_stream
=
circ
->
resolving_streams
;
circ
->
resolving_streams
=
dummy_conn
;
/* send it off to the gethostbyname farm */
switch
(
dns_resolve
(
dummy_conn
))
{
case
1
:
/* The result was cached; a resolved cell was sent. */
case
-
1
:
/* dummy_conn got freed, don't touch it */
case
-
1
:
/* Impossible to resolve; a resolved cell was sent. */
connection_free
(
dummy_conn
);
return
0
;
case
0
:
/* resolve added to pending list */
dummy_conn
->
next_stream
=
circ
->
resolving_streams
;
circ
->
resolving_streams
=
dummy_conn
;
assert_circuit_ok
(
circ
);
;
break
;
}
return
0
;
}
...
...
src/or/dns.c
View file @
322c728e
...
...
@@ -216,6 +216,8 @@ int dns_resolve(connection_t *exitconn) {
* know the answer. */
if
(
tor_inet_aton
(
exitconn
->
address
,
&
in
)
!=
0
)
{
exitconn
->
addr
=
ntohl
(
in
.
s_addr
);
if
(
exitconn
->
purpose
==
EXIT_PURPOSE_RESOLVE
)
send_resolved_cell
(
exitconn
,
RESOLVED_TYPE_IPV4
);
return
1
;
}
...
...
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