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-c427514a06d6
master
madmaxoft@gmail.com 2013-04-01 13:35:42 +00:00
parent c1177929df
commit 0e35f2225a
1 changed files with 1 additions and 1 deletions

View File

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