Browse Source

no peers in links & better via/Peer data

master
Tom Early 12 months ago
parent
commit
1dc4c8ee5c
  1. 6
      m17protocol.cpp
  2. 2
      reflector.cpp

6
m17protocol.cpp

@ -479,12 +479,10 @@ void CM17Protocol::OnFirstPacketIn(std::unique_ptr<CPacket> &packet, const CIp &
// save the source and destination for Hearing().
// We're going to lose packet on OpenStream();
auto s = packet->GetSourceCallsign();
auto d = packet->GetDestCallsign();
// try to open the stream
stream = g_Reflector.OpenStream(packet, client);
if ( nullptr == stream )
{
std::cerr << "Cant open the stream for " << client->GetCallsign() << std::endl;
packet.release(); // couldn't open the stream, so destroy the packet
}
else
@ -493,7 +491,9 @@ void CM17Protocol::OnFirstPacketIn(std::unique_ptr<CPacket> &packet, const CIp &
m_Streams.push_back(stream);
// update last heard
g_Reflector.GetUsers()->Hearing(s, d);
auto from = client->GetCallsign();
from.SetModule(client->GetReflectorModule());
g_Reflector.GetUsers()->Hearing(s, from);
g_Reflector.ReleaseUsers();
}

2
reflector.cpp

@ -444,7 +444,7 @@ void CReflector::WriteXmlFile(std::ofstream &xmlFile)
// iterate on clients
for ( auto cit=clients->cbegin(); cit!=clients->cend(); cit++ )
{
if ( (*cit)->IsNode() )
if ( (*cit)->IsNode() && (*cit)->GetCallsign().GetCS(4).compare("M17-") )
{
(*cit)->WriteXml(xmlFile);
}

Loading…
Cancel
Save