From 834bfde45cca74095d2723a0960b717a320e98ff Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Sat, 6 Jun 2009 16:34:32 +0000 Subject: [PATCH] * Timestamper: Use locale country if geoip unavailable --- core/java/src/net/i2p/time/Timestamper.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/java/src/net/i2p/time/Timestamper.java b/core/java/src/net/i2p/time/Timestamper.java index 356689f85..b3f5290e3 100644 --- a/core/java/src/net/i2p/time/Timestamper.java +++ b/core/java/src/net/i2p/time/Timestamper.java @@ -2,6 +2,7 @@ package net.i2p.time; import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.StringTokenizer; import net.i2p.I2PAppContext; @@ -246,7 +247,12 @@ public class Timestamper implements Runnable { if ( (serverList == null) || (serverList.trim().length() <= 0) ) { serverList = DEFAULT_SERVER_LIST; String country = _context.getProperty(PROP_IP_COUNTRY); - if (country != null) { + if (country == null) { + country = Locale.getDefault().getCountry(); + if (country != null) + country = country.toLowerCase(); + } + if (country != null && country.length() > 0) { _priorityServers = new ArrayList(3); for (int i = 0; i < 3; i++) _priorityServers.add(i + "." + country + ".pool.ntp.org"); -- GitLab