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
43a8457b
Commit
43a8457b
authored
9 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'dgoulet/bug14845_026_01'
parents
01d988d7
65172190
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/or/control.c
+23
-0
23 additions, 0 deletions
src/or/control.c
with
23 additions
and
0 deletions
src/or/control.c
+
23
−
0
View file @
43a8457b
...
...
@@ -41,6 +41,8 @@
#include
"router.h"
#include
"routerlist.h"
#include
"routerparse.h"
#include
"rendclient.h"
#include
"rendcommon.h"
#ifndef _WIN32
#include
<pwd.h>
...
...
@@ -1713,6 +1715,25 @@ getinfo_helper_dir(control_connection_t *control_conn,
*
answer
=
smartlist_join_strings
(
sl
,
""
,
0
,
NULL
);
SMARTLIST_FOREACH
(
sl
,
char
*
,
c
,
tor_free
(
c
));
smartlist_free
(
sl
);
}
else
if
(
!
strcmpstart
(
question
,
"hs/client/desc/id/"
))
{
char
*
msg
;
rend_cache_entry_t
*
e
=
NULL
;
question
+=
strlen
(
"hs/client/desc/id/"
);
if
(
strlen
(
question
)
!=
REND_SERVICE_ID_LEN_BASE32
)
{
tor_asprintf
(
&
msg
,
"
\"
%s
\"
invalid address."
,
question
);
*
errmsg
=
msg
;
return
-
1
;
}
if
(
rend_cache_lookup_entry
(
question
,
-
1
,
&
e
)
>
0
)
{
/* Descriptor found in cache */
*
answer
=
tor_strdup
(
e
->
desc
);
}
else
{
tor_asprintf
(
&
msg
,
"
\"
%s
\"
not found in cache."
,
question
);
*
errmsg
=
msg
;
return
-
1
;
}
}
else
if
(
!
strcmpstart
(
question
,
"md/id/"
))
{
const
node_t
*
node
=
node_get_by_hex_id
(
question
+
strlen
(
"md/id/"
));
const
microdesc_t
*
md
=
NULL
;
...
...
@@ -2216,6 +2237,8 @@ static const getinfo_item_t getinfo_items[] = {
PREFIX
(
"md/id/"
,
dir
,
"Microdescriptors by ID"
),
PREFIX
(
"md/name/"
,
dir
,
"Microdescriptors by name"
),
PREFIX
(
"extra-info/digest/"
,
dir
,
"Extra-info documents by digest."
),
PREFIX
(
"hs/client/desc/id"
,
dir
,
"Hidden Service descriptor in client's cache by onion."
),
PREFIX
(
"net/listeners/"
,
listeners
,
"Bound addresses by type"
),
ITEM
(
"ns/all"
,
networkstatus
,
"Brief summary of router status (v2 directory format)"
),
...
...
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