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
22c0cd8a
Commit
22c0cd8a
authored
Apr 28, 2004
by
Roger Dingledine
Browse files
clean dns.c better
svn:r1737
parent
fd0d48e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/or/dns.c
View file @
22c0cd8a
...
...
@@ -451,6 +451,7 @@ int dnsworker_main(void *data) {
char
address
[
MAX_ADDRESSLEN
];
unsigned
char
address_len
;
char
answer
[
5
];
uint32_t
ip
;
int
*
fdarray
=
data
;
int
fd
;
...
...
@@ -475,7 +476,7 @@ int dnsworker_main(void *data) {
address
[
address_len
]
=
0
;
/* null terminate it */
/* XXX isn't this non-aligned uint32 going to cause problems? */
switch
(
tor_lookup_hostname
(
address
,
(
uint32_t
*
)
answer
+
1
))
{
switch
(
tor_lookup_hostname
(
address
,
&
ip
))
{
case
1
:
log_fn
(
LOG_INFO
,
"Could not resolve dest addr %s (transient)."
,
address
);
answer
[
0
]
=
DNS_RESOLVE_FAILED_TRANSIENT
;
...
...
@@ -489,6 +490,7 @@ int dnsworker_main(void *data) {
answer
[
0
]
=
DNS_RESOLVE_SUCCEEDED
;
break
;
}
set_uint32
(
answer
+
1
,
ip
);
if
(
write_all
(
fd
,
answer
,
5
,
1
)
!=
5
)
{
log_fn
(
LOG_ERR
,
"writing answer failed. Child exiting."
);
spawn_exit
();
...
...
src/or/routerlist.c
View file @
22c0cd8a
...
...
@@ -505,9 +505,7 @@ int router_set_routerlist_from_directory(const char *s, crypto_pk_env_t *pkey)
static
int
router_resolve
(
routerinfo_t
*
router
)
{
struct
hostent
*
rent
;
if
(
tor_lookup_hostname
(
router
->
address
,
&
router
->
addr
))
{
if
(
tor_lookup_hostname
(
router
->
address
,
&
router
->
addr
)
!=
0
)
{
log_fn
(
LOG_WARN
,
"Could not get address for router %s (%s)."
,
router
->
address
,
router
->
nickname
);
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