fake the xml file for now...

unstable
Tom Early 4 years ago
parent cf448cd496
commit d26f732edd

@ -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"

@ -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<CPacket> pop() { auto pack = std::move(queue.front()); queue.pop(); return std::move(pack); }
bool empty() const { return queue.empty(); }
void push(std::unique_ptr<CPacket> &packet) { queue.push(std::move(packet)); }
std::unique_ptr<CPacket> pop()
{
auto pack = std::move(queue.front());
queue.pop();
return std::move(pack);
}
bool empty() const
{
return queue.empty();
}
void push(std::unique_ptr<CPacket> &packet)
{
queue.push(std::move(packet));
}
protected:
// status

@ -538,8 +538,11 @@ void CReflector::WriteXmlFile(std::ofstream &xmlFile)
::sprintf(sz, "%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION);
xmlFile << "<Version>" << sz << "</Version>" << 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 << "</" << m_Callsign << "linked peers>" << std::endl;
xmlFile << "</" << cs << "linked peers>" << 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 << "</" << m_Callsign << "linked nodes>" << std::endl;
xmlFile << "</" << cs << "linked nodes>" << 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 << "</" << m_Callsign << "heard users>" << std::endl;
xmlFile << "</" << cs << "heard users>" << std::endl;
}

Loading…
Cancel
Save

Powered by TurnKey Linux.