From 60850fe3e8da936d5b24460f33a1bf8f4d321ace Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 15:08:15 +0200 Subject: Fixed crashes in the SSL HTTP connection. --- src/RCONServer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/RCONServer.cpp') diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp index d7083ff2b..fd4b26cab 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,7 +202,7 @@ 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) -- cgit v1.2.3 From 30e81156eb6de46d7a374c044e26b35d83af4244 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 1 May 2014 22:02:45 +0200 Subject: Added a missing return statement. --- src/RCONServer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/RCONServer.cpp') diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp index fd4b26cab..cd5292ac3 100644 --- a/src/RCONServer.cpp +++ b/src/RCONServer.cpp @@ -206,6 +206,7 @@ bool cRCONServer::cConnection::DataReceived(const char * a_Data, size_t a_Size) } m_Buffer.erase(0, Length + 4); } // while (m_Buffer.size() >= 14) + return false; } -- cgit v1.2.3 From fb58ef55beddc73500029ae6c0fe08400de550d2 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 8 May 2014 20:16:35 +0200 Subject: Fixed MSVC 64-bit build warnings. --- src/RCONServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/RCONServer.cpp') diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp index d7083ff2b..3fbc9dcbc 100644 --- a/src/RCONServer.cpp +++ b/src/RCONServer.cpp @@ -59,7 +59,7 @@ public: virtual void Finished(void) override { - m_Connection.SendResponse(m_RequestID, RCON_PACKET_RESPONSE, m_Buffer.size(), m_Buffer.c_str()); + m_Connection.SendResponse(m_RequestID, RCON_PACKET_RESPONSE, (int)m_Buffer.size(), m_Buffer.c_str()); delete this; } -- cgit v1.2.3 From 2423fbf2efa39e28cc348acc11b9269e573dcdef Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 17 Jul 2014 22:15:34 +0200 Subject: Normalized comments. This was mostly done automatically and then visually inspected for obvious errors. All //-style comments should have a 2-space separation from the code, and 1 space after the comment sign. --- src/RCONServer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/RCONServer.cpp') diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp index c511968be..28cb1e03b 100644 --- a/src/RCONServer.cpp +++ b/src/RCONServer.cpp @@ -38,7 +38,7 @@ enum -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cRCONCommandOutput: class cRCONCommandOutput : @@ -73,7 +73,7 @@ protected: -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cRCONServer: cRCONServer::cRCONServer(cServer & a_Server) : @@ -154,7 +154,7 @@ void cRCONServer::OnConnectionAccepted(cSocket & a_Socket) -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// // cRCONServer::cConnection: cRCONServer::cConnection::cConnection(cRCONServer & a_RCONServer, cSocket & a_Socket) : -- cgit v1.2.3 From d52a51f7b6530d2a63682798472840d7261ebad4 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 18 Jul 2014 09:18:00 +0200 Subject: Removed duplicate IPvX labels. --- src/RCONServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/RCONServer.cpp') diff --git a/src/RCONServer.cpp b/src/RCONServer.cpp index 28cb1e03b..141c67d1b 100644 --- a/src/RCONServer.cpp +++ b/src/RCONServer.cpp @@ -78,8 +78,8 @@ protected: cRCONServer::cRCONServer(cServer & a_Server) : m_Server(a_Server), - m_ListenThread4(*this, cSocket::IPv4, "RCON IPv4"), - m_ListenThread6(*this, cSocket::IPv6, "RCON IPv6") + m_ListenThread4(*this, cSocket::IPv4, "RCON"), + m_ListenThread6(*this, cSocket::IPv6, "RCON") { } -- cgit v1.2.3