summaryrefslogtreecommitdiff
path: root/src/or/config.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-10-13 09:16:40 -0400
committerNick Mathewson <nickm@torproject.org>2016-10-13 09:19:37 -0400
commit1fc3e291083493bd7517901f467a7341d5c6f650 (patch)
treecc3cf770302fe58571a758a0d72d3d2b20b6ffee /src/or/config.h
parent0e1b228aa6b5ed7665ba5167a2b88924e58fb9b5 (diff)
downloadtor-1fc3e291083493bd7517901f467a7341d5c6f650.tar.gz
tor-1fc3e291083493bd7517901f467a7341d5c6f650.zip
Remove duplicate code that checks for default authorities
Patch from ericho. Fixes 18529. Simple refactoring.
Diffstat (limited to 'src/or/config.h')
-rw-r--r--src/or/config.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/config.h b/src/or/config.h
index 208659acb7..1b40efc5ec 100644
--- a/src/or/config.h
+++ b/src/or/config.h
@@ -76,6 +76,8 @@ MOCK_DECL(char *,
#define get_datadir_fname_suffix(sub1, suffix) \
get_datadir_fname2_suffix((sub1), NULL, (suffix))
+inline int is_default_dir_authorities(const or_options_t *options);
+
int check_or_create_data_subdir(const char *subdir);
int write_to_data_subdir(const char* subdir, const char* fname,
const char* str, const char* descr);
@@ -147,6 +149,14 @@ smartlist_t *get_options_from_transport_options_line(const char *line,
const char *transport);
smartlist_t *get_options_for_server_transport(const char *transport);
+/* Check if we are using default authorities */
+inline int
+is_default_dir_authorities(const or_options_t *options)
+{
+ return (!options->DirAuthorities &&
+ !options->AlternateDirAuthority) ? 1 : 0;
+}
+
#ifdef CONFIG_PRIVATE
#define CL_PORT_NO_STREAM_OPTIONS (1u<<0)