diff --git a/reflector/Main.h b/reflector/Main.h index 6c81f61..f79ed48 100644 --- a/reflector/Main.h +++ b/reflector/Main.h @@ -61,7 +61,7 @@ // version ----------------------------------------------------- -#define VERSION_MAJOR 1 +#define VERSION_MAJOR 0 #define VERSION_MINOR 0 #define VERSION_REVISION 0 @@ -180,13 +180,12 @@ enum class EProtocol { any, none, dextra, dplus, dcs, xlx, urf, dmrplus, dmrmmdv #endif // system paths ------------------------------------------------- -//#define XML_PATH "/var/log/urfd.xml" +//#define XML_PATH "/var/log/xlxd.xml" #define XML_PATH "./urfd.xml" #define WHITELIST_PATH "/usr/local/etc/urfd.whitelist" #define BLACKLIST_PATH "/usr/local/etc/urfd.blacklist" #define INTERLINKLIST_PATH "/usr/local/etc/urfd.interlink" #define TERMINALOPTIONS_PATH "/usr/local/etc/urfd.terminal" -#define DEBUGDUMP_PATH "/var/log/urfd.debug" #define PIDFILE_PATH "/var/run/urfd.pid" diff --git a/reflector/PacketQueue.h b/reflector/PacketQueue.h index fbea39a..42df702 100644 --- a/reflector/PacketQueue.h +++ b/reflector/PacketQueue.h @@ -21,11 +21,6 @@ #include "Packet.h" #include "Client.h" -//////////////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////////////// -// CPacketQueue - class CClient; class CPacketQueue @@ -35,13 +30,33 @@ public: virtual ~CPacketQueue() {} // lock - void Lock() { m_Mutex.lock(); } - void Unlock() { m_Mutex.unlock(); } + void Lock() + { + m_Mutex.lock(); + } + + void Unlock() + { + m_Mutex.unlock(); + } // pass thru - std::unique_ptr pop() { auto pack = std::move(queue.front()); queue.pop(); return std::move(pack); } - bool empty() const { return queue.empty(); } - void push(std::unique_ptr &packet) { queue.push(std::move(packet)); } + std::unique_ptr pop() + { + auto pack = std::move(queue.front()); + queue.pop(); + return std::move(pack); + } + + bool empty() const + { + return queue.empty(); + } + + void push(std::unique_ptr &packet) + { + queue.push(std::move(packet)); + } protected: // status @@ -50,6 +65,6 @@ protected: std::mutex m_Mutex; // owner - CClient *m_Client; + CClient *m_Client; std::queue> queue; }; diff --git a/reflector/Reflector.cpp b/reflector/Reflector.cpp index bdc2486..d019774 100644 --- a/reflector/Reflector.cpp +++ b/reflector/Reflector.cpp @@ -538,8 +538,11 @@ void CReflector::WriteXmlFile(std::ofstream &xmlFile) ::sprintf(sz, "%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION); xmlFile << "" << sz << "" << std::endl; + CCallsign cs = m_Callsign; + cs.PatchCallsign(0, "XLX", 3); + // linked peers - xmlFile << "<" << m_Callsign << "linked peers>" << std::endl; + xmlFile << "<" << cs << "linked peers>" << std::endl; // lock CPeers *peers = GetPeers(); // iterate on peers @@ -549,10 +552,10 @@ void CReflector::WriteXmlFile(std::ofstream &xmlFile) } // unlock ReleasePeers(); - xmlFile << "" << std::endl; + xmlFile << "" << std::endl; // linked nodes - xmlFile << "<" << m_Callsign << "linked nodes>" << std::endl; + xmlFile << "<" << cs << "linked nodes>" << std::endl; // lock CClients *clients = GetClients(); // iterate on clients @@ -565,10 +568,10 @@ void CReflector::WriteXmlFile(std::ofstream &xmlFile) } // unlock ReleaseClients(); - xmlFile << "" << std::endl; + xmlFile << "" << std::endl; // last heard users - xmlFile << "<" << m_Callsign << "heard users>" << std::endl; + xmlFile << "<" << cs << "heard users>" << std::endl; // lock CUsers *users = GetUsers(); // iterate on users @@ -578,7 +581,7 @@ void CReflector::WriteXmlFile(std::ofstream &xmlFile) } // unlock ReleaseUsers(); - xmlFile << "" << std::endl; + xmlFile << "" << std::endl; }