MCPcopy Create free account
hub / github.com/cuberite/cuberite / SendEncryptedData

Method SendEncryptedData

Tools/ProtoProxy/Connection.cpp:474–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472
473
474bool cConnection::SendEncryptedData(SOCKET a_Socket, cAESCFBEncryptor & a_Encryptor, const char * a_Data, size_t a_Size, const char * a_Peer)
475{
476 DataLog(a_Data, a_Size, "Encrypting %d bytes to %s", a_Size, a_Peer);
477 const Byte * Data = (const Byte *)a_Data;
478 while (a_Size > 0)
479 {
480 Byte Buffer[64 KiB];
481 size_t NumBytes = (a_Size > sizeof(Buffer)) ? sizeof(Buffer) : a_Size;
482 a_Encryptor.ProcessData(Buffer, Data, NumBytes);
483 bool res = SendData(a_Socket, (const char *)Buffer, NumBytes, a_Peer);
484 if (!res)
485 {
486 return false;
487 }
488 Data += NumBytes;
489 a_Size -= NumBytes;
490 }
491 return true;
492}
493
494
495

Callers

nothing calls this directly

Calls 4

ProcessDataMethod · 0.80
ReadAllMethod · 0.80
CommitReadMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected