mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fuzzing options
This commit is contained in:
parent
8275f2d811
commit
366f0281ed
|
@ -121,12 +121,14 @@ void CNetBase::SendPacket(NETSOCKET Socket, NETADDR *pAddr, CNetPacketConstruct
|
|||
CompressedSize = ms_Huffman.Compress(pPacket->m_aChunkData, pPacket->m_DataSize, &aBuffer[3], NET_MAX_PACKETSIZE-4);
|
||||
|
||||
// check if the compression was enabled, successful and good enough
|
||||
#ifndef FUZZING
|
||||
if(CompressedSize > 0 && CompressedSize < pPacket->m_DataSize)
|
||||
{
|
||||
FinalSize = CompressedSize;
|
||||
pPacket->m_Flags |= NET_PACKETFLAG_COMPRESSION;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// use uncompressed data
|
||||
FinalSize = pPacket->m_DataSize;
|
||||
|
|
|
@ -249,8 +249,10 @@ int CNetConnection::Feed(CNetPacketConstruct *pPacket, NETADDR *pAddr)
|
|||
mem_copy(&nAddr, pAddr, sizeof(nAddr));
|
||||
nAddr.port = 0;
|
||||
m_PeerAddr.port = 0;
|
||||
#ifndef FUZZING
|
||||
if(net_addr_comp(&m_PeerAddr, &nAddr) == 0 && time_get() - m_LastUpdateTime < time_freq() * 3)
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
// send response and init connection
|
||||
Reset();
|
||||
|
|
Loading…
Reference in a new issue