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
8fe504fe
Commit
8fe504fe
authored
Mar 04, 2004
by
Roger Dingledine
Browse files
bugfix: don't pass complex things to the connection_mark_for_close macro
svn:r1231
parent
c03e9206
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/or/dns.c
View file @
8fe504fe
...
...
@@ -214,7 +214,7 @@ void connection_dns_remove(connection_t *conn)
if
(
pend
->
conn
==
conn
)
{
resolve
->
pending_connections
=
pend
->
next
;
tor_free
(
pend
);
log_fn
(
LOG_DEBUG
,
"
C
onnection (fd %d) no longer waiting for resolve of '%s'"
,
log_fn
(
LOG_DEBUG
,
"
First c
onnection (fd %d) no longer waiting for resolve of '%s'"
,
conn
->
s
,
conn
->
address
);
return
;
}
else
{
...
...
@@ -239,6 +239,7 @@ void dns_cancel_pending_resolve(char *address) {
struct
pending_connection_t
*
pend
;
struct
cached_resolve
search
;
struct
cached_resolve
*
resolve
,
*
tmp
;
connection_t
*
pendconn
;
strncpy
(
search
.
address
,
address
,
MAX_ADDRESSLEN
);
search
.
address
[
MAX_ADDRESSLEN
-
1
]
=
0
;
...
...
@@ -258,7 +259,9 @@ void dns_cancel_pending_resolve(char *address) {
pend
=
resolve
->
pending_connections
;
/* So that mark_for_close doesn't double-remove the connection. */
pend
->
conn
->
state
=
EXIT_CONN_STATE_RESOLVEFAILED
;
connection_mark_for_close
(
pend
->
conn
,
END_STREAM_REASON_MISC
);
pendconn
=
pend
->
conn
;
/* don't pass complex things to the
connection_mark_for_close macro */
connection_mark_for_close
(
pendconn
,
END_STREAM_REASON_MISC
);
resolve
->
pending_connections
=
pend
->
next
;
tor_free
(
pend
);
}
...
...
@@ -288,6 +291,7 @@ static void dns_found_answer(char *address, uint32_t addr) {
struct
pending_connection_t
*
pend
;
struct
cached_resolve
search
;
struct
cached_resolve
*
resolve
;
connection_t
*
pendconn
;
strncpy
(
search
.
address
,
address
,
MAX_ADDRESSLEN
);
search
.
address
[
MAX_ADDRESSLEN
-
1
]
=
0
;
...
...
@@ -324,7 +328,9 @@ static void dns_found_answer(char *address, uint32_t addr) {
if
(
resolve
->
state
==
CACHE_STATE_FAILED
)
{
/* prevent double-remove */
pend
->
conn
->
state
=
EXIT_CONN_STATE_RESOLVEFAILED
;
connection_mark_for_close
(
pend
->
conn
,
END_STREAM_REASON_RESOLVEFAILED
);
pendconn
=
pend
->
conn
;
/* don't pass complex things to the
connection_mark_for_close macro */
connection_mark_for_close
(
pendconn
,
END_STREAM_REASON_RESOLVEFAILED
);
}
else
{
connection_exit_connect
(
pend
->
conn
);
}
...
...
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