summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorTaylor Yu <catalyst@torproject.org>2017-04-21 20:17:27 -0400
committerNick Mathewson <nickm@torproject.org>2017-04-24 09:20:59 -0400
commit7bc636fdc937c5cd050cb243e5bebb8a52c1c144 (patch)
treecf5f3912ec5e8bdd363d64aacd3c2fd9f3b601ed /src/or
parent8b89faf424e662d09bec57c96e923773438e737e (diff)
downloadtor-7bc636fdc937c5cd050cb243e5bebb8a52c1c144.tar.gz
tor-7bc636fdc937c5cd050cb243e5bebb8a52c1c144.zip
Add regression test for #22304
Diffstat (limited to 'src/or')
-rw-r--r--src/or/control.c2
-rw-r--r--src/or/control.h4
-rw-r--r--src/or/routerlist.c4
-rw-r--r--src/or/routerlist.h3
4 files changed, 9 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 8e86005b83..56f1329029 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1873,7 +1873,7 @@ getinfo_helper_listeners(control_connection_t *control_conn,
/** Implementation helper for GETINFO: knows the answers for questions about
* directory information. */
-static int
+STATIC int
getinfo_helper_dir(control_connection_t *control_conn,
const char *question, char **answer,
const char **errmsg)
diff --git a/src/or/control.h b/src/or/control.h
index a786dfe1af..41a194bfcb 100644
--- a/src/or/control.h
+++ b/src/or/control.h
@@ -290,6 +290,10 @@ STATIC int getinfo_helper_downloads(
control_connection_t *control_conn,
const char *question, char **answer,
const char **errmsg);
+STATIC int getinfo_helper_dir(
+ control_connection_t *control_conn,
+ const char *question, char **answer,
+ const char **errmsg);
#endif
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 0b0bb4b1d2..35fe501228 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3045,8 +3045,8 @@ router_get_by_extrainfo_digest,(const char *digest))
/** Return the signed descriptor for the extrainfo_t in our routerlist whose
* extra-info-digest is <b>digest</b>. Return NULL if no such extra-info
* document is known. */
-signed_descriptor_t *
-extrainfo_get_by_descriptor_digest(const char *digest)
+MOCK_IMPL(signed_descriptor_t *,
+extrainfo_get_by_descriptor_digest,(const char *digest))
{
extrainfo_t *ei;
tor_assert(digest);
diff --git a/src/or/routerlist.h b/src/or/routerlist.h
index 5376369e8d..5c1f76c8e7 100644
--- a/src/or/routerlist.h
+++ b/src/or/routerlist.h
@@ -92,7 +92,8 @@ routerinfo_t *router_get_mutable_by_digest(const char *digest);
signed_descriptor_t *router_get_by_descriptor_digest(const char *digest);
MOCK_DECL(signed_descriptor_t *,router_get_by_extrainfo_digest,
(const char *digest));
-signed_descriptor_t *extrainfo_get_by_descriptor_digest(const char *digest);
+MOCK_DECL(signed_descriptor_t *,extrainfo_get_by_descriptor_digest,
+ (const char *digest));
const char *signed_descriptor_get_body(const signed_descriptor_t *desc);
const char *signed_descriptor_get_annotations(const signed_descriptor_t *desc);
routerlist_t *router_get_routerlist(void);