From: Karsten Loesing Date: Sat, 30 May 2009 21:35:21 +0000 (+0200) Subject: Warn and exit when we are configured to measure GeoIP statistics, but have no GeoIP... X-Git-Tag: tor-0.2.2.1-alpha~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfebc88d56e2c5b470fce20cd7b25914cf2507d4;p=thirdparty%2Ftor.git Warn and exit when we are configured to measure GeoIP statistics, but have no GeoIP database. --- 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 ||