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/ClientHandle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ClientHandle.cpp') diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 683a243fe..6a6ea951f 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -3299,7 +3299,7 @@ bool cClientHandle::SetState(eState a_NewState) void cClientHandle::ProcessProtocolIn(void) { // Process received network data: - AString IncomingData; + decltype(m_IncomingData) IncomingData; { cCSLock Lock(m_CSIncomingData); std::swap(IncomingData, m_IncomingData); @@ -3312,7 +3312,7 @@ void cClientHandle::ProcessProtocolIn(void) try { - m_Protocol.HandleIncomingData(*this, IncomingData); + m_Protocol.HandleIncomingData(*this, std::move(IncomingData)); } catch (const std::exception & Oops) { @@ -3340,7 +3340,7 @@ void cClientHandle::OnReceivedData(const char * a_Data, size_t a_Length) // Queue the incoming data to be processed in the tick thread: cCSLock Lock(m_CSIncomingData); - m_IncomingData.append(a_Data, a_Length); + m_IncomingData.append(reinterpret_cast(a_Data), a_Length); } -- cgit v1.2.3