From eeb63b8901a9c049f1bb594abb9ce9b4a9c47620 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 11 Jan 2021 16:39:43 +0000 Subject: zlib -> libdeflate (#5085) + Use libdeflate + Use std::byte * Fix passing temporary to string_view + Emulate make_unique_for_overwrite --- Tools/ProtoProxy/Connection.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Tools/ProtoProxy/Connection.h') diff --git a/Tools/ProtoProxy/Connection.h b/Tools/ProtoProxy/Connection.h index 6c13efba2..b524561a1 100644 --- a/Tools/ProtoProxy/Connection.h +++ b/Tools/ProtoProxy/Connection.h @@ -13,6 +13,10 @@ #include "mbedTLS++/AesCfb128Decryptor.h" #include "mbedTLS++/AesCfb128Encryptor.h" +#ifndef _WIN32 + typedef int SOCKET; +#endif + @@ -85,7 +89,7 @@ protected: cAesCfb128Decryptor m_ServerDecryptor; cAesCfb128Encryptor m_ServerEncryptor; - AString m_ServerEncryptionBuffer; // Buffer for the data to be sent to the server once encryption is established + ContiguousByteBuffer m_ServerEncryptionBuffer; // Buffer for the data to be sent to the server once encryption is established /** Set to true when PACKET_PING is received from the client; will cause special parsing for server kick */ bool m_HasClientPinged; @@ -119,13 +123,13 @@ protected: double GetRelativeTime(void); /** Sends data to the specified socket. If sending fails, prints a fail message using a_Peer and returns false. */ - bool SendData(SOCKET a_Socket, const char * a_Data, size_t a_Size, const char * a_Peer); + bool SendData(SOCKET a_Socket, ContiguousByteBufferView a_Data, const char * a_Peer); /** Sends data to the specified socket. If sending fails, prints a fail message using a_Peer and returns false. */ bool SendData(SOCKET a_Socket, cByteBuffer & a_Data, const char * a_Peer); /** Sends data to the specfied socket, after encrypting it using a_Encryptor. If sending fails, prints a fail message using a_Peer and returns false */ - bool SendEncryptedData(SOCKET a_Socket, cAesCfb128Encryptor & a_Encryptor, const char * a_Data, size_t a_Size, const char * a_Peer); + bool SendEncryptedData(SOCKET a_Socket, cAesCfb128Encryptor & a_Encryptor, ContiguousByteBufferView a_Data, const char * a_Peer); /** Sends data to the specfied socket, after encrypting it using a_Encryptor. If sending fails, prints a fail message using a_Peer and returns false */ bool SendEncryptedData(SOCKET a_Socket, cAesCfb128Encryptor & a_Encryptor, cByteBuffer & a_Data, const char * a_Peer); -- cgit v1.2.3