]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Warn and exit when we are configured to measure GeoIP statistics, but have no GeoIP...
authorKarsten Loesing <karsten.loesing@gmx.net>
Sat, 30 May 2009 21:35:21 +0000 (23:35 +0200)
committerKarsten Loesing <karsten.loesing@gmx.net>
Sat, 30 May 2009 21:35:21 +0000 (23:35 +0200)
src/or/config.c

index 0cf0db7578fc2eddd186c3e4e419e7b23f263199..c0f473bf2d1ffffe181580373e87c20b31f79177 100644 (file)
@@ -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 ||