1
0

Fixed crashes in the SSL HTTP connection.

This commit is contained in:
madmaxoft
2014-05-01 15:08:15 +02:00
parent dc2d2ce53c
commit 60850fe3e8
9 changed files with 36 additions and 23 deletions

View File

@@ -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)