14 m_OutgoingData(a_BufferSize),
15 m_IncomingData(a_BufferSize)
61 return MBEDTLS_ERR_SSL_WANT_READ;
69 return static_cast<int>(NumBytes);
82 return MBEDTLS_ERR_SSL_WANT_WRITE;
88 return static_cast<int>(a_NumBytes);
size_t GetReadableSpace(void) const
Returns the number of bytes that are currently available for reading (may be less than UsedSpace due ...
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.
cBufferedSslContext(size_t a_BufferSize=64000)
Creates a new context with the buffers of specified size for the encrypted / decrypted data...
bool Write(const void *a_Bytes, size_t a_Count)
Writes the bytes specified to the ringbuffer.
virtual int ReceiveEncrypted(unsigned char *a_Buffer, size_t a_NumBytes) override
#define MBEDTLS_ERR_NET_SEND_FAILED
Sending information through the socket failed.
void CommitRead(void)
Removes the bytes that have been read from the ringbuffer.
size_t ReadOutgoing(void *a_Data, size_t a_DataMaxSize)
Retrieves data from the "outgoing" buffer, after being processed by the SSL encryptor.
cByteBuffer m_IncomingData
Buffer for the data that has come in and needs to be decrypted from the SSL stream.
void ResetRead(void)
Restarts next reading operation at the start of the ringbuffer.
size_t GetFreeSpace(void) const
Returns the number of bytes that can be successfully written to the ringbuffer.
bool ReadBuf(void *a_Buffer, size_t a_Count)
Reads a_Count bytes into a_Buffer; returns true if successful.
#define MBEDTLS_ERR_NET_RECV_FAILED
Reading information from the socket failed.
virtual int SendEncrypted(const unsigned char *a_Buffer, size_t a_NumBytes) override
bool CanWriteBytes(size_t a_Count) const
Returns true if the specified amount of bytes are available for writing.
cByteBuffer m_OutgoingData
Buffer for the data that has been encrypted into the SSL stream and should be sent out...