Rework for TLS.
This commit is contained in:
1 parent
519faa535b
commit
b7deabc5dc
2830 files changed
+4559
-80373
No files matched your search
+5
-35
@@ -3,9 +3,9 @@
|
||||
|
||||
#include "SessionFilter.h"
|
||||
#include "TCPSocket.h"
|
||||
#include <sstream>
|
||||
|
||||
namespace core
|
||||
{
|
||||
namespace core {
|
||||
|
||||
class Command;
|
||||
class TCPServer;
|
||||
@@ -22,8 +22,7 @@ namespace core
|
||||
///
|
||||
///
|
||||
|
||||
class TCPSession : public TCPSocket
|
||||
{
|
||||
class TCPSession : public TCPSocket {
|
||||
|
||||
public:
|
||||
///
|
||||
@@ -98,13 +97,6 @@ namespace core
|
||||
|
||||
virtual void onRegistered() override;
|
||||
|
||||
///
|
||||
/// Override this method to receive data directly from the socket as data is
|
||||
/// received. If you need data split by line termination characters then
|
||||
/// override the onLineReceived method instead.
|
||||
///
|
||||
virtual void onDataReceived(coreutils::ZString &data) override;
|
||||
|
||||
///
|
||||
/// Override the onLineReceived method to receive a string of characters that
|
||||
/// represents a single line of data terminated by a LF or CRLF. If onDataReceived
|
||||
@@ -112,16 +104,7 @@ namespace core
|
||||
/// this method explicitly using the class and member name.
|
||||
///
|
||||
|
||||
virtual void onLineReceived(coreutils::ZString &line);
|
||||
|
||||
///
|
||||
/// Override the onBlockReceived method to receive a string of characters that
|
||||
/// represents a single block of data of length determined by the block length value. If
|
||||
/// onDataReceived was overriden this method will not be called unless the onDataReceived
|
||||
/// calls this method explicitly using the class and member name.
|
||||
///
|
||||
|
||||
virtual void onBlockReceived(coreutils::ZString &block);
|
||||
virtual void onLineReceived(coreutils::ZString &line) override;
|
||||
|
||||
///
|
||||
/// This method is called from within the protocol method when protocol is called
|
||||
@@ -143,22 +126,9 @@ namespace core
|
||||
|
||||
virtual void protocol(coreutils::ZString &data);
|
||||
|
||||
///
|
||||
/// Use setBlockSize to set the amount of data that should be read at once from the
|
||||
/// session data buffer.
|
||||
/// If this value is set to 0 then the data will be retrieved
|
||||
///
|
||||
|
||||
void setBlockSize(int size = 0);
|
||||
|
||||
private:
|
||||
char *lineBuffer = NULL;
|
||||
int lineBufferSize = 0;
|
||||
int lineLength = 0;
|
||||
int blockLength = 0;
|
||||
std::mutex mtx;
|
||||
bool term = false;
|
||||
int blockSize = 0;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user