Properly handling the initial node status broadcast in passive mode

This commit is contained in:
Pavel Kirienko
2014-07-23 03:17:11 +04:00
parent 43c5d2e090
commit 99b7aa8579
@@ -69,10 +69,15 @@ int NodeStatusProvider::startAndPublish()
return -ErrNotInited;
}
int res = publish(); // Initial broadcast
if (res < 0)
int res = -1;
if (!getNode().isPassiveMode())
{
goto fail;
res = publish();
if (res < 0) // Initial broadcast
{
goto fail;
}
}
res = gdr_sub_.start(GlobalDiscoveryRequestCallback(this, &NodeStatusProvider::handleGlobalDiscoveryRequest));