Commit c2e576ab authored by Harald Sitter's avatar Harald Sitter 🌈
Browse files

smb: throw out discovery timeout

it was only ever a safety net and shouldn't practically be necessary.
with the dust around the new discovery system having settled we should
probably deal with potentially getting stuck on discovery instead of
aborting the discovery through the safety net and hiding the defect.

also, technically speaking discovery could take longer than N seconds
since both WSD and NMB are broadcast systems without local caching
daemon like avahi, so they can be affected by network latency much more
than DNSSD
parent 77517010
......@@ -384,11 +384,6 @@ void SMBSlave::listDir(const QUrl &kurl)
list.clear();
};
const auto quitLoop = [&e, &flushEntries]() {
flushEntries();
e.quit();
};
// Since slavebase has no eventloop it wont publish results
// on a timer, since we do not know how long our discovery
// will take this is super meh because we may appear
......@@ -423,7 +418,8 @@ void SMBSlave::listDir(const QUrl &kurl)
allFinished = allFinished && discoverer->isFinished();
}
if (allFinished) {
quitLoop();
flushEntries();
e.quit();
}
};
......@@ -450,14 +446,6 @@ void SMBSlave::listDir(const QUrl &kurl)
wsd->start();
qCDebug(KIO_SMB_LOG) << "Modern discovery set up.";
// Conceivably discovery could be kept from finishing by breakage in the stack.
// At some point we'll forcefully consider it finished to prevent broken servers and the like from
// holding up use of potentially working servers.
// NB: This must only be done for SMBURLTYPE_ENTIRE_NETWORK. Other types
// may take a long time to discover by necessity - e.g. listing a server with a
// million shares or a directory with a billion files. https://bugs.kde.org/show_bug.cgi?id=427644
QTimer::singleShot(16000, &e, quitLoop); // max execution time!
}
qCDebug(KIO_SMB_LOG) << "Starting discovery.";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment