15 cHTTPServer & a_HTTPServer,
const std::shared_ptr<const cSslConfig> & a_Config
20 if (a_Config !=
nullptr)
22 m_Ssl.Initialize(a_Config);
26 m_Ssl.Initialize(
false);
46 const char * Data = a_Data;
51 size_t BytesWritten = 0;
61 int NumRead =
m_Ssl.ReadPlain(Buffer,
sizeof(Buffer));
68 else if (NumRead == MBEDTLS_ERR_SSL_WANT_READ)
75 if ((BytesWritten == 0) && (NumRead <= 0))
88 const char * OutgoingData =
static_cast<const char *
>(a_Data);
96 NumWritten =
m_Ssl.WritePlain(OutgoingData + pos, a_Size - pos);
99 pos +=
static_cast<size_t>(NumWritten);
108 m_Link->Send(Buffer, NumBytes);
112 if ((NumWritten <= 0) && (NumBytes == 0))
cTCPLinkPtr m_Link
The network link attached to this connection.
virtual void OnReceivedData(const char *a_Data, size_t a_Size) override
Data is received from the client.
virtual ~cSslHTTPServerConnection() override
cSslHTTPServerConnection(cHTTPServer &a_HTTPServer, const std::shared_ptr< const cSslConfig > &a_Config)
Creates a new connection on the specified server.
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
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.
size_t ReadOutgoing(void *a_Data, size_t a_DataMaxSize)
Retrieves data from the "outgoing" buffer, after being processed by the SSL encryptor.