summaryrefslogtreecommitdiffstats
path: root/src/RCONServer.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-05-18 23:10:23 +0200
committermadmaxoft <github@xoft.cz>2014-05-18 23:10:23 +0200
commite69a11012fb7543d47230663a01af2a7ec20960c (patch)
tree2c4a5b6759f76059736bdf5b30ea17f2a6ee8570 /src/RCONServer.cpp
parentUpdated SandVillage prefabs to latest Gallery content. (diff)
parentThere's no "round" function in MSVC2008. (diff)
downloadcuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar
cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar.gz
cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar.bz2
cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar.lz
cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar.xz
cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.tar.zst
cuberite-e69a11012fb7543d47230663a01af2a7ec20960c.zip
Diffstat (limited to 'src/RCONServer.cpp')
-rw-r--r--src/RCONServer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp
index 3fbc9dcbc..c511968be 100644
--- a/src/RCONServer.cpp
+++ b/src/RCONServer.cpp
@@ -169,7 +169,7 @@ cRCONServer::cConnection::cConnection(cRCONServer & a_RCONServer, cSocket & a_So
-void cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size)
+bool cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size)
{
// Append data to the buffer:
m_Buffer.append(a_Data, a_Size);
@@ -187,12 +187,12 @@ void cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size)
m_RCONServer.m_SocketThreads.RemoveClient(this);
m_Socket.CloseSocket();
delete this;
- return;
+ return false;
}
if (Length > (int)(m_Buffer.size() + 4))
{
// Incomplete packet yet, wait for more data to come
- return;
+ return false;
}
int RequestID = IntFromBuffer(m_Buffer.data() + 4);
@@ -202,10 +202,11 @@ void cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size)
m_RCONServer.m_SocketThreads.RemoveClient(this);
m_Socket.CloseSocket();
delete this;
- return;
+ return false;
}
m_Buffer.erase(0, Length + 4);
} // while (m_Buffer.size() >= 14)
+ return false;
}