Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Core
Tor
Commits
22c0cd8a
Commit
22c0cd8a
authored
20 years ago
by
Roger Dingledine
Browse files
Options
Downloads
Patches
Plain Diff
clean dns.c better
svn:r1737
parent
fd0d48e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/or/dns.c
+3
-1
3 additions, 1 deletion
src/or/dns.c
src/or/routerlist.c
+1
-3
1 addition, 3 deletions
src/or/routerlist.c
with
4 additions
and
4 deletions
src/or/dns.c
+
3
−
1
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
();
...
...
This diff is collapsed.
Click to expand it.
src/or/routerlist.c
+
1
−
3
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment