OnTransportData: too short error changed to warning. it can happen if an attacker sends random data.

This commit is contained in:
vis2k 2021-09-02 19:30:37 +08:00
parent f67704bbd9
commit 57f9923f78
2 changed files with 4 additions and 2 deletions

View File

@ -380,7 +380,8 @@ internal static void OnTransportData(ArraySegment<byte> data, int channelId)
// otherwise disconnect
else
{
Debug.LogError($"NetworkClient: received Message was too short (messages should start with message id)");
// WARNING, not error. can happen if attacker sends random data.
Debug.LogWarning($"NetworkClient: received Message was too short (messages should start with message id)");
connection.Disconnect();
return;
}

View File

@ -513,7 +513,8 @@ internal static void OnTransportData(int connectionId, ArraySegment<byte> data,
// otherwise disconnect
else
{
Debug.LogError($"NetworkServer: received Message was too short (messages should start with message id). Disconnecting {connectionId}");
// WARNING, not error. can happen if attacker sends random data.
Debug.LogWarning($"NetworkServer: received Message was too short (messages should start with message id). Disconnecting {connectionId}");
connection.Disconnect();
return;
}