mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[6898] Prevent processing incoming packates for closed connection.
This commit is contained in:
parent
ac2748a141
commit
d386a67d27
3 changed files with 15 additions and 18 deletions
|
|
@ -153,20 +153,11 @@ void WorldSession::logUnexpectedOpcode(WorldPacket* packet, const char *reason)
|
|||
/// Update the WorldSession (triggered by World update)
|
||||
bool WorldSession::Update(uint32 /*diff*/)
|
||||
{
|
||||
if (m_Socket && m_Socket->IsClosed ())
|
||||
{
|
||||
m_Socket->RemoveReference ();
|
||||
m_Socket = NULL;
|
||||
}
|
||||
|
||||
WorldPacket *packet;
|
||||
|
||||
///- Retrieve packets from the receive queue and call the appropriate handlers
|
||||
/// \todo Is there a way to consolidate the OpcondeHandlerTable and the g_worldOpcodeNames to only maintain 1 list?
|
||||
/// answer : there is a way, but this is better, because it would use redundant RAM
|
||||
while (!_recvQueue.empty())
|
||||
/// not proccess packets if socket already closed
|
||||
while (!_recvQueue.empty() && m_Socket && !m_Socket->IsClosed ())
|
||||
{
|
||||
packet = _recvQueue.next();
|
||||
WorldPacket *packet = _recvQueue.next();
|
||||
|
||||
/*#if 1
|
||||
sLog.outError( "MOEP: %s (0x%.4X)",
|
||||
|
|
@ -226,6 +217,13 @@ bool WorldSession::Update(uint32 /*diff*/)
|
|||
delete packet;
|
||||
}
|
||||
|
||||
///- Cleanup socket pointer if need
|
||||
if (m_Socket && m_Socket->IsClosed ())
|
||||
{
|
||||
m_Socket->RemoveReference ();
|
||||
m_Socket = NULL;
|
||||
}
|
||||
|
||||
///- If necessary, log the player out
|
||||
time_t currTime = time(NULL);
|
||||
if (!m_Socket || (ShouldLogOut(currTime) && !m_playerLoading))
|
||||
|
|
|
|||
|
|
@ -115,7 +115,6 @@ void WorldSocket::CloseSocket (void)
|
|||
return;
|
||||
|
||||
closing_ = true;
|
||||
|
||||
peer ().close_writer ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "6897"
|
||||
#define REVISION_NR "6898"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue