void cTCPLinkImpl::cLinkTlsContext::StoreReceivedData(const char * a_Data, size_t a_NumBytes) { // Hold self alive for the duration of this function cLinkTlsContextPtr Self(m_Self); m_EncryptedData.append(a_Data, a_NumBytes); // Try to finish a pending handshake: TryFinishHandshaking(); // Flush any cleartext data that can be "received": FlushBuffers(); }
void cTCPLinkImpl::cLinkTlsContext::Send(const void * a_Data, size_t a_Length) { // Hold self alive for the duration of this function cLinkTlsContextPtr Self(m_Self); // If the handshake hasn't completed yet, queue the data: if (!HasHandshaken()) { m_CleartextData.append(reinterpret_cast<const char *>(a_Data), a_Length); TryFinishHandshaking(); return; } // The connection is all set up, write the cleartext data into the SSL context: WritePlain(a_Data, a_Length); FlushBuffers(); }
void cLuaTCPLink::cLinkSslContext::Send(const AString & a_Data) { // Hold self alive for the duration of this function cLinkSslContextPtr Self(m_Self); // If the handshake hasn't completed yet, queue the data: if (!HasHandshaken()) { m_CleartextData.append(a_Data); TryFinishHandshaking(); return; } // The connection is all set up, write the cleartext data into the SSL context: WritePlain(a_Data.data(), a_Data.size()); FlushBuffers(); }