mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
websocket support fixed
This commit is contained in:
parent
c9e9f07d91
commit
79a523e8a8
|
@ -364,7 +364,14 @@ void CNetServer::OnTokenCtrlMsg(NETADDR &Addr, int ControlMsg, const CNetPacketC
|
|||
return; // silently ignore
|
||||
|
||||
|
||||
if (ControlMsg == NET_CTRLMSG_CONNECT)
|
||||
if (Addr.type == NETTYPE_WEBSOCKET_IPV4)
|
||||
{
|
||||
// websocket client doesn't send token
|
||||
// direct accept
|
||||
SendControl(Addr, NET_CTRLMSG_CONNECTACCEPT, SECURITY_TOKEN_MAGIC, sizeof(SECURITY_TOKEN_MAGIC), NET_SECURITY_TOKEN_UNSUPPORTED);
|
||||
TryAcceptClient(Addr, NET_SECURITY_TOKEN_UNSUPPORTED);
|
||||
}
|
||||
else if (ControlMsg == NET_CTRLMSG_CONNECT)
|
||||
{
|
||||
bool SupportsToken = Packet.m_DataSize >=
|
||||
(int)(1 + sizeof(SECURITY_TOKEN_MAGIC) + sizeof(SECURITY_TOKEN)) &&
|
||||
|
|
Loading…
Reference in a new issue