mirror of
https://github.com/ValveSoftware/GameNetworkingSockets.git
synced 2026-05-29 16:20:34 +00:00
ICE client: Small cleanup
Delete unused function
Don't dynamically allocate any attributes passed to SendSTUNResponsePacket
(cherry picked from commit ea2b3842c6)
This commit is contained in:
@@ -578,8 +578,6 @@ static bool SendSTUNResponsePacket( IRawUDPSocket* pSocket, int nEncoding, uint3
|
||||
{
|
||||
uint32 messageBuffer[ k_nSTUN_MaxPacketSize_Bytes / 4 ];
|
||||
const int nByteCount = EncodeSTUNPacket( messageBuffer, k_nSTUN_BindingResponse, nEncoding, pTransactionID, toAddr, pubKey, cubKey, pAttrs, nAttrs );
|
||||
for ( int i = 0; i < nAttrs; ++i )
|
||||
delete []( pAttrs[i].m_pData );
|
||||
if ( nByteCount == 0 )
|
||||
return false;
|
||||
|
||||
@@ -1555,10 +1553,8 @@ not_stun:
|
||||
{
|
||||
STUNAttribute attrUsername;
|
||||
attrUsername.m_nType = k_nSTUN_Attr_UserName;
|
||||
int nUsernameLength = (int)m_strIncomingUsername.size();
|
||||
attrUsername.m_nLength = nUsernameLength;
|
||||
attrUsername.m_pData = new uint32[ (nUsernameLength + 3) / 4 ];
|
||||
V_memcpy( (void*)attrUsername.m_pData, m_strIncomingUsername.c_str(), m_strIncomingUsername.size() );
|
||||
attrUsername.m_nLength = (int)m_strIncomingUsername.size();
|
||||
attrUsername.m_pData = reinterpret_cast<const uint32 *>( m_strIncomingUsername.c_str() );
|
||||
outAttrs.AddToTail( attrUsername );
|
||||
}
|
||||
|
||||
|
||||
@@ -405,7 +405,6 @@ namespace SteamNetworkingSocketsLib {
|
||||
|
||||
void GatherInterfaces();
|
||||
void UpdateKeepalive( ICESessionInterface *pIntf );
|
||||
uint32 GetInterfaceLocalPreference( const SteamNetworkingIPAddr& addr );
|
||||
|
||||
void Think_KeepAliveOnCandidates( SteamNetworkingMicroseconds usecNow );
|
||||
void Think_DiscoverServerReflexiveCandidates();
|
||||
|
||||
Reference in New Issue
Block a user