summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-09-25 21:06:32 +0000
committerNick Mathewson <nickm@torproject.org>2008-09-25 21:06:32 +0000
commit02c71a7eb4ddbe3841a7b804a99b7b509e05a9d9 (patch)
treeb86dd38756044645f158c157a2b5279289198739 /src/or/config.c
parente06f140f978cb95c3f4655f24ccdf1753a04d230 (diff)
downloadtor-02c71a7eb4ddbe3841a7b804a99b7b509e05a9d9.tar.gz
tor-02c71a7eb4ddbe3841a7b804a99b7b509e05a9d9.zip
Widen the conditions under which we whine about not having a geoip file to include "a country code was configured in a node list."
svn:r16968
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 36c0d4287d..219be16481 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1163,6 +1163,30 @@ options_act_reversible(or_options_t *old_options, char **msg)
return r;
}
+/** DOCDOC */
+int
+options_need_geoip_info(or_options_t *options, const char **reason_out)
+{
+ int bridge_usage =
+ options->BridgeRelay && options->BridgeRecordUsageByCountry;
+ int routerset_usage =
+ routerset_needs_geoip(options->EntryNodes) ||
+ routerset_needs_geoip(options->ExitNodes) ||
+ routerset_needs_geoip(options->ExcludeExitNodes) ||
+ routerset_needs_geoip(options->ExcludeNodes);
+
+ if (routerset_usage && reason_out) {
+ *reason_out = "We've been configured to use (or avoid) nodes in certain "
+ "contries, and we need GEOIP information to figure out which ones they "
+ "are.";
+ } else if (bridge_usage && reason_out) {
+ *reason_out = "We've been configured to see which countries can access "
+ "us as a bridge, and we need GEOIP information to tell which countries "
+ "clients are in.";
+ }
+ return bridge_usage || routerset_usage;
+}
+
/** Fetch the active option list, and take actions based on it. All of the
* things we do should survive being done repeatedly. If present,
* <b>old_options</b> contains the previous value of the options.