summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2009-05-30 23:35:21 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2009-05-30 23:35:21 +0200
commitdfebc88d56e2c5b470fce20cd7b25914cf2507d4 (patch)
tree52c4aa9b87c8510cabe14baf8a519b2424aa3ef7 /src/or/config.c
parentdb576626e1d09c183d0c5153a78ebff4b95fc53b (diff)
downloadtor-dfebc88d56e2c5b470fce20cd7b25914cf2507d4.tar.gz
tor-dfebc88d56e2c5b470fce20cd7b25914cf2507d4.zip
Warn and exit when we are configured to measure GeoIP statistics, but have no GeoIP database.
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 0cf0db7578..c0f473bf2d 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1378,6 +1378,14 @@ options_act(or_options_t *old_options)
geoip_load_file(actual_fname, options);
tor_free(actual_fname);
}
+#ifdef ENABLE_GEOIP_STATS
+ /* Check if GeoIP database could be loaded. */
+ if (!geoip_is_loaded()) {
+ log_warn(LD_CONFIG, "Configured to measure GeoIP statistics, but no "
+ "GeoIP database found!");
+ return -1;
+ }
+#endif
/* Check if we need to parse and add the EntryNodes config option. */
if (options->EntryNodes &&
(!old_options ||