|
|
|
|
@ -111,7 +111,23 @@ void CG2Handler::process(CHeaderData& header)
|
|
|
|
|
|
|
|
|
|
CG2Handler *route = new CG2Handler(repeater, address, id);
|
|
|
|
|
|
|
|
|
|
for (unsigned int i = 0U; i < m_maxRoutes; i++) {
|
|
|
|
|
for (unsigned int i = 0U; i < m_maxRoutes; i++)
|
|
|
|
|
{
|
|
|
|
|
if (m_routes[i] != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (m_routes[i]->m_id == id)
|
|
|
|
|
{
|
|
|
|
|
// This should never happen, but if it does, delete the old route and replace it with the new one
|
|
|
|
|
CLog::logDebug("Duplicate G2 route received, replacing existing route");
|
|
|
|
|
|
|
|
|
|
delete m_routes[i];
|
|
|
|
|
m_routes[i] = route;
|
|
|
|
|
|
|
|
|
|
repeater->process(header, DIR_INCOMING, AS_G2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (m_routes[i] == NULL) {
|
|
|
|
|
m_routes[i] = route;
|
|
|
|
|
|
|
|
|
|
@ -123,6 +139,7 @@ void CG2Handler::process(CHeaderData& header)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CLog::logInfo("No space to add new G2 route, ignoring");
|
|
|
|
|
|
|
|
|
|
|