Fixed a possible race condition in cClientHandle's packet sending code; prepared for moving cSocket out of cClientHandle's ownership.
git-svn-id: http://mc-server.googlecode.com/svn/trunk@832 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -1546,8 +1546,11 @@ void cClientHandle::DataReceived(const char * a_Data, int a_Size)
|
||||
void cClientHandle::GetOutgoingData(AString & a_Data)
|
||||
{
|
||||
// Data can be sent to client
|
||||
m_OutgoingData.ReadAll(a_Data);
|
||||
m_OutgoingData.CommitRead();
|
||||
{
|
||||
cCSLock Lock(m_CSOutgoingData);
|
||||
m_OutgoingData.ReadAll(a_Data);
|
||||
m_OutgoingData.CommitRead();
|
||||
}
|
||||
|
||||
// Disconnect player after all packets have been sent
|
||||
if (m_bKicking && a_Data.empty())
|
||||
|
||||
Reference in New Issue
Block a user