18 if (a_Config !=
nullptr)
20 m_Ssl.Initialize(a_Config);
24 m_Ssl.Initialize(
false);
44 const char * Data = a_Data;
49 size_t BytesWritten = 0;
59 int NumRead =
m_Ssl.ReadPlain(Buffer,
sizeof(Buffer));
66 else if (NumRead == MBEDTLS_ERR_SSL_WANT_READ)
73 if ((BytesWritten == 0) && (NumRead <= 0))
86 const char * OutgoingData =
static_cast<const char *
>(a_Data);
94 NumWritten =
m_Ssl.WritePlain(OutgoingData + pos, a_Size - pos);
97 pos +=
static_cast<size_t>(NumWritten);
106 m_Link->Send(Buffer, NumBytes);
110 if ((NumWritten <= 0) && (NumBytes == 0))
virtual ~cSslHTTPServerConnection() override
size_t WriteIncoming(const void *a_Data, size_t a_NumBytes)
Stores the specified data in the "incoming" buffer, to be process by the SSL decryptor.
virtual void OnReceivedData(const char *a_Data, size_t a_Size) override
Data is received from the client.
cSslHTTPServerConnection(cHTTPServer &a_HTTPServer, std::shared_ptr< const cSslConfig > a_Config)
Creates a new connection on the specified server.
cTCPLinkPtr m_Link
The network link attached to this connection.
size_t ReadOutgoing(void *a_Data, size_t a_DataMaxSize)
Retrieves data from the "outgoing" buffer, after being processed by the SSL encryptor.
virtual void OnReceivedData(const char *a_Data, size_t a_Size) override
Data is received from the client.
virtual void SendData(const void *a_Data, size_t a_Size) override
Called to send raw data over the link.
cBufferedSslContext m_Ssl