From 0e35f2225a319f2fdf471c5fbf3ffda728bae762 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 1 Apr 2013 13:35:42 +0000 Subject: 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 --- source/OSSupport/ListenThread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/OSSupport/ListenThread.cpp b/source/OSSupport/ListenThread.cpp index 706c820b4..bc14aa0ba 100644 --- a/source/OSSupport/ListenThread.cpp +++ b/source/OSSupport/ListenThread.cpp @@ -215,7 +215,7 @@ void cListenThread::Execute(void) } 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(); m_Callback.OnConnectionAccepted(Client); -- cgit v1.2.3