CBuffer.Set(uint8_t) sets a trailing null

unstable
Tom Early 4 years ago
parent f9889ae6e4
commit 88a19fa7ec

@ -88,8 +88,7 @@ void CM17Protocol::Task(void)
if ( g_Reflector.IsValidModule(ToLinkModule) ) if ( g_Reflector.IsValidModule(ToLinkModule) )
{ {
// acknowledge the request // acknowledge the request
Buffer.Set("ACKN"); Send("ACKN", Ip);
Send(Buffer, Ip);
// create the client and append // create the client and append
g_Reflector.GetClients()->AddClient(std::make_shared<CM17Client>(Callsign, Ip, ToLinkModule)); g_Reflector.GetClients()->AddClient(std::make_shared<CM17Client>(Callsign, Ip, ToLinkModule));
@ -100,15 +99,13 @@ void CM17Protocol::Task(void)
std::cout << "M17 node " << Callsign << " connect attempt on non-existing module" << std::endl; std::cout << "M17 node " << Callsign << " connect attempt on non-existing module" << std::endl;
// deny the request // deny the request
Buffer.Set("NACK"); Send("NACK", Ip);
Send(Buffer, Ip);
} }
} }
else else
{ {
// deny the request // deny the request
Buffer.Set("NACK"); Send("NACK", Ip);
Send(Buffer, Ip);
} }
} }
@ -124,8 +121,7 @@ void CM17Protocol::Task(void)
// remove it // remove it
clients->RemoveClient(client); clients->RemoveClient(client);
// and acknowledge the disconnect // and acknowledge the disconnect
Buffer.Set("DISC"); Send("DISC", Ip);
Send(Buffer, Ip);
} }
g_Reflector.ReleaseClients(); g_Reflector.ReleaseClients();
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.