mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-23 18:03:44 +03:00
make extension robust to dns failures (test0)
This commit is contained in:
parent
5b3e6f1f51
commit
86d07b79c3
|
@ -469,24 +469,24 @@
|
|||
reject([err, ...warns]);
|
||||
return;
|
||||
}
|
||||
resolve(err, res, ...warns);
|
||||
resolve([err, res, ...warns]);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
const ipsErrorPromise = !ifUnattended
|
||||
const ipsPromise = !ifUnattended
|
||||
? updateIpsAsync()
|
||||
: tryPromiseSeveralTimesAsync(updateIpsAsync, [20, 40, 60]);
|
||||
|
||||
Promise.all([pacSetPromise, ipsErrorPromise]).then(
|
||||
([[pacErr, pacRes, ...pacWarns], ipsErr]) => {
|
||||
Promise.all([pacSetPromise, ipsPromise]).then(
|
||||
([[pacErr, pacRes, ...pacWarns], [ipsErr, ipsRes, ...ipsWarns]]) => {
|
||||
|
||||
if (pacErr && ipsErr) {
|
||||
if (pacErr) {
|
||||
return cb(pacErr, pacRes);
|
||||
}
|
||||
const warns = pacWarns;
|
||||
if (ipsErr) {
|
||||
warns.push(ipsErr);
|
||||
if (ipsErr || ipsWarns.length) {
|
||||
warns.push(...[ipsErr], ...ipsWarns);
|
||||
}
|
||||
this.pushToStorageAsync(
|
||||
(pushErr) => cb(pacErr || pushErr, null, ...warns),
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
const promises = types.map(
|
||||
(type) => new Promise((resolve) =>
|
||||
httpLib.get(
|
||||
`https://dnsssssss.google.com/resolve?type=${type}&name=${host}&random_padding=${generateRandomHexString(30,500)}`,
|
||||
`https://dns.google.com/resolve?type=${type}&name=${host}&random_padding=${generateRandomHexString(30,500)}`,
|
||||
(err, res) => {
|
||||
|
||||
if (res) {
|
||||
|
@ -282,7 +282,6 @@
|
|||
' блокировок может не отображаться.'
|
||||
);
|
||||
}
|
||||
console.log('IP ERRORS:', ipErrors); // TODO:
|
||||
cb(null, null, ipErrors);
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user