mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Avoid long "hanging" if Windows UNC path is not reachable
Use own "isDirExisting" function checking UNC paths
This commit is contained in:
@@ -74,7 +74,14 @@ namespace BlackMisc
|
||||
}
|
||||
process.start();
|
||||
process.waitForFinished();
|
||||
return process.exitCode() == 0;
|
||||
const int rc = process.exitCode();
|
||||
if (rc != 0) { return false; }
|
||||
|
||||
const QString std = process.readAllStandardOutput();
|
||||
const QString err = process.readAllStandardError();
|
||||
if (std.contains("unreachable", Qt::CaseInsensitive)) { return false; }
|
||||
if (err.contains("unreachable", Qt::CaseInsensitive)) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CNetworkUtils::canPing(const CUrl &url)
|
||||
@@ -92,7 +99,7 @@ namespace BlackMisc
|
||||
if (address.isNull()) { continue; }
|
||||
if (address.protocol() == QAbstractSocket::IPv4Protocol)
|
||||
{
|
||||
QString a = address.toString();
|
||||
const QString a = address.toString();
|
||||
ips.append(a);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user