ListenThread: Fixed socket-querying, might have crashed some linux versions.
Hopefully this fixes FS #345 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1345 0a769ca7-a7f5-676a-18bf-c427514a06d6master
parent
c1177929df
commit
0e35f2225a
|
@ -215,7 +215,7 @@ void cListenThread::Execute(void)
|
||||||
}
|
}
|
||||||
for (cSockets::iterator itr = m_Sockets.begin(), end = m_Sockets.end(); itr != end; ++itr)
|
for (cSockets::iterator itr = m_Sockets.begin(), end = m_Sockets.end(); itr != end; ++itr)
|
||||||
{
|
{
|
||||||
if (FD_ISSET(itr->GetSocket(), &fdRead))
|
if (itr->IsValid() && FD_ISSET(itr->GetSocket(), &fdRead))
|
||||||
{
|
{
|
||||||
cSocket Client = (m_Family == cSocket::IPv4) ? itr->AcceptIPv4() : itr->AcceptIPv6();
|
cSocket Client = (m_Family == cSocket::IPv4) ? itr->AcceptIPv4() : itr->AcceptIPv6();
|
||||||
m_Callback.OnConnectionAccepted(Client);
|
m_Callback.OnConnectionAccepted(Client);
|
||||||
|
|
Loading…
Reference in New Issue