1
0
mirror of https://github.com/ShaYmez/xlxd.git synced 2026-07-25 11:34:11 -04:00

Prevent sending stream close frames back to the sender

The OnDvLastFramePacketIn() function closed the current stream before
HandleQueue() was called, so the stream's client lost it's stream master status
and HandleQueue() sent the client's last (stream closing) frame back to the
sender.

Applying this commit closes the stream only after HandleQueue() has been
called so no unnecessary call end frame reflection happens to the transmitting
client.
This commit is contained in:
Nonoo
2019-02-19 12:39:48 +01:00
parent b3360b66e2
commit 6b281b9fdb
9 changed files with 57 additions and 47 deletions
+8 -3
View File
@@ -69,7 +69,7 @@ void CDextraProtocol::Task(void)
int ProtRev;
CDvHeaderPacket *Header;
CDvFramePacket *Frame;
CDvLastFramePacket *LastFrame;
CDvLastFramePacket *LastFrame = NULL;
// any incoming packet ?
if ( m_Socket.Receive(&Buffer, &Ip, 20) != -1 )
@@ -101,9 +101,9 @@ void CDextraProtocol::Task(void)
else if ( (LastFrame = IsValidDvLastFramePacket(Buffer)) != NULL )
{
//std::cout << "DExtra DV last frame" << std::endl;
// handle it
OnDvLastFramePacketIn(LastFrame, &Ip);
OnDvFramePacketIn(LastFrame, &Ip);
}
else if ( IsValidConnectPacket(Buffer, &Callsign, &ToLinkModule, &ProtRev) )
{
@@ -193,6 +193,11 @@ void CDextraProtocol::Task(void)
// handle queue from reflector
HandleQueue();
if ( LastFrame != NULL )
{
CloseStreamForDvLastFramePacket(LastFrame, &Ip);
}
// keep client alive
if ( m_LastKeepaliveTime.DurationSinceNow() > DEXTRA_KEEPALIVE_PERIOD )
{