Bug 713991 - Geolocation fails when used with large number of access points. r=gmealer

This commit is contained in:
Doug Turner 2012-01-03 20:13:34 -08:00
parent 3ef0679ab6
commit 34c8a90042

View File

@ -218,17 +218,19 @@ WifiGeoPositionProvider.prototype = {
if (accessPoints) {
providerUrl = providerUrl + accessPoints.sort(sort).map(encode).join("");
// max length is 2k. make sure we are under that
let x = providerUrl.length - 2000;
if (x >= 0) {
// we need to trim
let doomed = providerUrl.lastIndexOf("&", 2000);
LOG("Doomed:"+doomed);
providerUrl = providerUrl.substring(0, doomed);
}
}
providerUrl = encodeURI(providerUrl);
// max length is 2k. make sure we are under that
let x = providerUrl.length - 2000;
if (x >= 0) {
// we need to trim
let doomed = providerUrl.lastIndexOf("&", 2000);
LOG("Doomed:"+doomed);
providerUrl = providerUrl.substring(0, doomed);
}
LOG("************************************* Sending request:\n" + providerUrl + "\n");
// send our request to a wifi geolocation network provider: