From 00196e975a3cd4156b1d675d192c875535d7e5f0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 28 Jul 2013 18:15:19 +0200 Subject: ProtoProxy now properly waits for both sides to establish encryption No more "End of stream" kicks in the client. Data sent while one connection is encrypted and the other is not is buffered and sent when the other link establishes encryption. --- 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 7f3a6f8bb..dafc1b36b 100644 --- a/Tools/ProtoProxy/Connection.h +++ b/Tools/ProtoProxy/Connection.h @@ -39,9 +39,10 @@ class cConnection enum eConnectionState { - csUnencrypted, // The connection is not encrypted. Packets must be decoded in order to be able to start decryption. - csEncryptedUnderstood, // The communication is encrypted and so far all packets have been understood, so they can be still decoded - csEncryptedUnknown, // The communication is encrypted, but an unknown packet has been received, so packets cannot be decoded anymore + csUnencrypted, // The connection is not encrypted. Packets must be decoded in order to be able to start decryption. + csEncryptedUnderstood, // The communication is encrypted and so far all packets have been understood, so they can be still decoded + csEncryptedUnknown, // The communication is encrypted, but an unknown packet has been received, so packets cannot be decoded anymore + csWaitingForEncryption, // The communication is waiting for the other line to establish encryption }; eConnectionState m_ClientState; @@ -72,6 +73,9 @@ protected: Decryptor m_ClientDecryptor; Encryptor m_ClientEncryptor; + AString m_ClientEncryptionBuffer; // Buffer for the data to be sent to the client once encryption is established + AString 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; -- cgit v1.2.3