Browse Source

impossible things happen sometimes?

David Rose 15 years ago
parent
commit
d0bd8dc046
1 changed files with 7 additions and 5 deletions
  1. 7 5
      direct/src/distributed/ServerRepository.py

+ 7 - 5
direct/src/distributed/ServerRepository.py

@@ -346,16 +346,18 @@ class ServerRepository:
 
         client = self.clientsByConnection.get(datagram.getConnection())
 
+        if not client:
+            # This shouldn't be possible, though it appears to happen
+            # sometimes?
+            self.notify.warning(
+                "Ignoring datagram from unknown connection %s" % (datagram.getConnection()))
+            return
+
         if self.notify.getDebug():
             self.notify.debug(
                 "ServerRepository received datagram from %s:" % (client.doIdBase))
             #datagram.dumpHex(ostream)
 
-        if not client:
-            # This shouldn't be possible.
-            self.notify.error(
-                "Received datagram from unknown connection.")
-
         dgi = DatagramIterator(datagram)
 
         type = dgi.getUint16()