refs #712, improved readers

* only trigger read when network interface is available
* do not trigger all reads at same time but slightly shifted
* renamed to hasReceivedOkReply()
This commit is contained in:
Klaus Basan
2016-07-24 01:36:09 +02:00
parent 31b03fe2e1
commit 0357dbde8f
9 changed files with 102 additions and 42 deletions

View File

@@ -197,6 +197,15 @@ namespace BlackCore
CStatusMessageList CSetupReader::triggerReadSetup()
{
if (m_shutdown) { return CStatusMessage(this, CStatusMessage::SeverityError, "shutdown"); }
if (!CNetworkUtils::hasConnectedInterface())
{
const CStatusMessage m(this, CStatusMessage::SeverityError,
"No network, cancelled reading of setup");
CStatusMessageList msgs(m);
msgs.push_back(this->manageSetupAvailability(false, false));
return msgs;
}
const CUrl url(this->m_bootstrapUrls.obtainNextWorkingUrl());
if (url.isEmpty())
{
@@ -456,7 +465,7 @@ namespace BlackCore
}
else
{
bool cacheAvailable = this->m_setup.getThreadLocal().wasLoaded();
bool cacheAvailable = this->m_setup.get().wasLoaded();
available = cacheAvailable && this->m_bootstrapMode != Explicit;
}