Updated code
This commit is contained in:
1 parent
20d5c99517
commit
43489e5b3a
26 files changed
+33
-27
No files matched your search
+4
-3
@@ -14,15 +14,16 @@ namespace core {
|
||||
data << "|" << ipAddress.getClientAddressAndPort();
|
||||
}
|
||||
|
||||
void TCPSession::protocol(coreutils::ZString data) {
|
||||
void TCPSession::protocol(coreutils::ZString &data) {
|
||||
if(!server.commands.processRequest(data, *this))
|
||||
if(data.getLength() != 0)
|
||||
server.sessionErrorHandler("Invalid data received.", out);
|
||||
}
|
||||
|
||||
void TCPSession::onRegistered() {
|
||||
coreutils::ZString blank("");
|
||||
onConnected();
|
||||
protocol(coreutils::ZString(""));
|
||||
protocol(blank);
|
||||
send();
|
||||
if(term)
|
||||
shutdown("termination requested");
|
||||
@@ -30,7 +31,7 @@ namespace core {
|
||||
|
||||
void TCPSession::onConnected() {}
|
||||
|
||||
void TCPSession::onDataReceived(coreutils::ZString data) {
|
||||
void TCPSession::onDataReceived(coreutils::ZString &data) {
|
||||
if(data.getLength() > 0) {
|
||||
lineBuffer = (char *)realloc(lineBuffer, lineBufferSize + data.getLength());
|
||||
memcpy(lineBuffer + lineBufferSize, data.getData(), data.getLength());
|
||||
|
||||
Reference in new issue
Block a user