diff --git a/exec/load/geoip.js b/exec/load/geoip.js index ddacc47cf734b905ec96f59ca5e35d94d2598cb4..b4a8ee1ef2df1a3ffa03b9e773f5d8da414d6e38 100644 --- a/exec/load/geoip.js +++ b/exec/load/geoip.js @@ -58,17 +58,20 @@ function get_geoip(host, countryonly) else geoip_url='http://api.ipinfodb.com/v3/ip-city/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host); } - try { - do { - result='ret='+new HTTPRequest().Get(geoip_url); - GeoIP=js.eval(result); - } while(GeoIP==undefined); - if(GeoIP.Locations != undefined) { - if(isarray) - return GeoIP.Locations; - return GeoIP.Locations[0]; + for(i=0; i<10; i++) { + try { + do { + result='ret='+new HTTPRequest().Get(geoip_url); + GeoIP=js.eval(result); + } while(GeoIP==undefined); + if(GeoIP.Locations != undefined) { + if(isarray) + return GeoIP.Locations; + return GeoIP.Locations[0]; + } + return GeoIP; + } + catch(e) { } - return GeoIP; } - catch(e) {} }