From 4da009a3298ae9090ce466a5a1327e82c9ae72d9 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Mon, 10 Apr 2023 12:44:13 -0700 Subject: [PATCH] Fixed bug if GetBase --- reflector/Callsign.cpp | 2 +- reflector/InterlinkMap.cpp | 13 ++++++++++++- reflector/URFProtocol.cpp | 1 - 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/reflector/Callsign.cpp b/reflector/Callsign.cpp index 84184b8..b4b9666 100644 --- a/reflector/Callsign.cpp +++ b/reflector/Callsign.cpp @@ -354,7 +354,7 @@ std::string CCallsign::GetBase() const auto u = GetKey(); std::string rval(u.c, CALLSIGN_LEN); auto pos = rval.find(' '); - if (std::string::npos == rval.find(' ')) + if (std::string::npos != pos) rval.resize(pos); return rval; } diff --git a/reflector/InterlinkMap.cpp b/reflector/InterlinkMap.cpp index 64bb36d..4767dc0 100644 --- a/reflector/InterlinkMap.cpp +++ b/reflector/InterlinkMap.cpp @@ -67,7 +67,6 @@ bool CInterlinkMap::LoadFromFile(const std::string &filename) { if (m_InterlinkMap.end() == m_InterlinkMap.find(token[0])) { - CCallsign callsign(token[0]); // read remaining tokens // 1=IP 2=Modules 3=Port Port is optional and defaults to 10017 // OR... 1=Modules and the dht will be used @@ -179,8 +178,20 @@ bool CInterlinkMap::IsCallsignListed(const std::string &callsign, const CIp &ip, { return true; } + else + { + std::cout << ip << " is not equal to " << item->second.GetIp() << std::endl; + } + } + else + { + std::cout << "Problem with linking " << callsign << " modules '" << modules << "'\n"; } } + else + { + std::cout << "'" << callsign << "' not found in interlink map\n"; + } return false; } diff --git a/reflector/URFProtocol.cpp b/reflector/URFProtocol.cpp index df0de7e..59c5dc9 100644 --- a/reflector/URFProtocol.cpp +++ b/reflector/URFProtocol.cpp @@ -65,7 +65,6 @@ void CURFProtocol::Task(void) if ( Receive4(Buffer, Ip, 20) ) #endif { - Buffer.Dump("Received buffer"); // crack the packet if ( IsValidDvFramePacket(Buffer, Frame) ) {