1
0

Do protocol decryption in-place (with CryptoAPI on Windows) (#5145)

This commit is contained in:
Tiger Wang
2021-03-08 16:37:36 +00:00
committed by GitHub
parent 3daf253b7f
commit 01a4e696b3
10 changed files with 206 additions and 174 deletions

View File

@@ -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<const std::byte *>(a_Data), a_Length);
}