From 01a4e696b3d2c973cdd1fb4345d747bd10e93ad9 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 8 Mar 2021 16:37:36 +0000 Subject: Do protocol decryption in-place (with CryptoAPI on Windows) (#5145) --- src/Protocol/Protocol.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Protocol/Protocol.h') diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h index 41c461e76..743a73aba 100644 --- a/src/Protocol/Protocol.h +++ b/src/Protocol/Protocol.h @@ -48,6 +48,7 @@ typedef unsigned char Byte; class cProtocol { public: + cProtocol(cClientHandle * a_Client) : m_Client(a_Client), m_OutPacketBuffer(64 KiB), @@ -354,8 +355,9 @@ public: Game = 3, }; - /** Called when client sends some data */ - virtual void DataReceived(cByteBuffer & a_Buffer, const char * a_Data, size_t a_Size) = 0; + /** Called to process them, when client sends some data. + The protocol uses the provided buffers for storage and processing, and must have exclusive access to them. */ + virtual void DataReceived(cByteBuffer & a_Buffer, ContiguousByteBuffer && a_Data) = 0; // Sending stuff to clients (alphabetically sorted): virtual void SendAttachEntity (const cEntity & a_Entity, const cEntity & a_Vehicle) = 0; -- cgit v1.2.3