|
|
@ -87,11 +87,10 @@ exports.ping = async (hostname, size = 56) => {
|
|
|
|
return await exports.pingAsync(hostname, false, size);
|
|
|
|
return await exports.pingAsync(hostname, false, size);
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
// If the host cannot be resolved, try again with ipv6
|
|
|
|
// If the host cannot be resolved, try again with ipv6
|
|
|
|
// As node-ping does not report a specific error for this, try again with ipv6 no matter what.
|
|
|
|
|
|
|
|
console.debug("ping", "IPv6 error message: " + e.message);
|
|
|
|
console.debug("ping", "IPv6 error message: " + e.message);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// As node-ping does not report a specific error for this, try again if it is an empty message with ipv6 no matter what.
|
|
|
|
if (!e.message) {
|
|
|
|
if (!e.message) {
|
|
|
|
// TODO: Problem, the error message is always from the ipv6 ping! Misleading!
|
|
|
|
|
|
|
|
return await exports.pingAsync(hostname, true, size);
|
|
|
|
return await exports.pingAsync(hostname, true, size);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw e;
|
|
|
|
throw e;
|
|
|
|