Merge branch 'master' of https://github.com/jg1uaa/xlxd into master

pull/162/head
ham 5 years ago
commit 6ddbe1f818

@ -72,6 +72,7 @@ bool CG3Protocol::Init(void)
std::cout << "Error opening socket on port UDP" << G3_CONFIG_PORT << " on ip " << g_Reflector.GetListenIp() << std::endl; std::cout << "Error opening socket on port UDP" << G3_CONFIG_PORT << " on ip " << g_Reflector.GetListenIp() << std::endl;
} }
#ifndef DEBUG_NO_G3_ICMP_SOCKET
ok &= m_IcmpRawSocket.Open(IPPROTO_ICMP); ok &= m_IcmpRawSocket.Open(IPPROTO_ICMP);
if ( !ok ) if ( !ok )
{ {
@ -85,7 +86,8 @@ bool CG3Protocol::Init(void)
m_pPresenceThread = new std::thread(ConfigThread, this); m_pPresenceThread = new std::thread(ConfigThread, this);
m_pPresenceThread = new std::thread(IcmpThread, this); m_pPresenceThread = new std::thread(IcmpThread, this);
} }
#endif
// update time // update time
m_LastKeepaliveTime.Now(); m_LastKeepaliveTime.Now();

@ -140,7 +140,7 @@ void CProtocol::OnDvFramePacketIn(CDvFramePacket *Frame, const CIp *Ip)
CPacketStream *stream = GetStream(Frame->GetStreamId(), Ip); CPacketStream *stream = GetStream(Frame->GetStreamId(), Ip);
if ( stream == NULL ) if ( stream == NULL )
{ {
std::cout << "Deleting oprhaned Frame Packet with StreamId " << Frame->GetStreamId() << " from " << *Ip << std::endl; // std::cout << "Deleting oprhaned Last Frame Packet with StreamId " << Frame->GetStreamId() << " from " << *Ip << std::endl;
delete Frame; delete Frame;
} }
else else
@ -159,7 +159,7 @@ void CProtocol::OnDvLastFramePacketIn(CDvLastFramePacket *Frame, const CIp *Ip)
CPacketStream *stream = GetStream(Frame->GetStreamId(), Ip); CPacketStream *stream = GetStream(Frame->GetStreamId(), Ip);
if ( stream == NULL ) if ( stream == NULL )
{ {
std::cout << "Deleting oprhaned Last Frame Packet with StreamId " << Frame->GetStreamId() << " from " << *Ip << std::endl; // std::cout << "Deleting oprhaned Last Frame Packet with StreamId " << Frame->GetStreamId() << " from " << *Ip << std::endl;
delete Frame; delete Frame;
} }
else else
@ -168,9 +168,12 @@ void CProtocol::OnDvLastFramePacketIn(CDvLastFramePacket *Frame, const CIp *Ip)
stream->Lock(); stream->Lock();
stream->Push(Frame); stream->Push(Frame);
stream->Unlock(); stream->Unlock();
// and close the stream // and don't close the stream yet but rely on CheckStreamsTimeout
g_Reflector.CloseStream(stream); // mechanism, so the stream will be closed after the queues have
// been sinked out. This avoid last packets to be send back
// to transmitting client (master)
// g_Reflector.CloseStream(stream);
} }
} }
@ -266,3 +269,4 @@ uint32 CProtocol::ModuleToDmrDestId(char m) const
{ {
return (uint32)(m - 'A')+1; return (uint32)(m - 'A')+1;
} }

@ -52,7 +52,7 @@
#define VERSION_MAJOR 2 #define VERSION_MAJOR 2
#define VERSION_MINOR 4 #define VERSION_MINOR 4
#define VERSION_REVISION 0 #define VERSION_REVISION 1
// global ------------------------------------------------------ // global ------------------------------------------------------
@ -63,6 +63,7 @@
//#define DEBUG_NO_ERROR_ON_XML_OPEN_FAIL //#define DEBUG_NO_ERROR_ON_XML_OPEN_FAIL
//#define DEBUG_DUMPFILE //#define DEBUG_DUMPFILE
//#define DEBUG_NO_G3_ICMP_SOCKET
// reflector --------------------------------------------------- // reflector ---------------------------------------------------

Loading…
Cancel
Save

Powered by TurnKey Linux.