summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2008-09-09 04:39:28 +0200
committerMatthias Schiffer <matthias@gamezock.de>2008-09-09 04:39:28 +0200
commitd8dda96481a9614b5d7550643f794a9831c6b474 (patch)
tree95eda609182d89068aea0b5a02b6ced4fe09da36 /src
parentf50844eb7f9772f865ce9f272eadb15943319885 (diff)
downloadmad-d8dda96481a9614b5d7550643f794a9831c6b474.tar
mad-d8dda96481a9614b5d7550643f794a9831c6b474.zip
Rufe sendReceive() nur auf, wenn poll() f?r eine Verbindung erfolgreich war
Diffstat (limited to 'src')
-rw-r--r--src/Core/ConnectionManager.cpp4
-rw-r--r--src/Net/Listener.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp
index 2b7c8d1..c7a2f42 100644
--- a/src/Core/ConnectionManager.cpp
+++ b/src/Core/ConnectionManager.cpp
@@ -92,10 +92,8 @@ void ConnectionManager::handleConnections(std::list<Net::ServerConnection*>& con
if((*con)->isConnected()) {
std::map<int,const short*>::iterator events = pollfdMap.find((*con)->getSocket());
- if(events != pollfdMap.end())
+ if(events != pollfdMap.end() && *events->second)
(*con)->sendReceive(*events->second);
- else
- (*con)->sendReceive();
++con;
}
diff --git a/src/Net/Listener.cpp b/src/Net/Listener.cpp
index 892d057..892ec9d 100644
--- a/src/Net/Listener.cpp
+++ b/src/Net/Listener.cpp
@@ -107,8 +107,10 @@ ServerConnection* Listener::getConnection(const std::map<int,const short*> &poll
for(std::list<ServerConnection*>::iterator con = connections.begin(); con != connections.end(); ++con) {
std::map<int,const short*>::const_iterator events = pollfdMap.find((*con)->getSocket());
- if(events != pollfdMap.end())
- (*con)->sendReceive(*events->second);
+ if(events != pollfdMap.end()) {
+ if(*events->second)
+ (*con)->sendReceive(*events->second);
+ }
else
(*con)->sendReceive();
}