[Neo-report] r1992 gregory - /trunk/neo/master/handlers/identification.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Apr 1 16:10:23 CEST 2010


Author: gregory
Date: Thu Apr  1 16:10:22 2010
New Revision: 1992

Log:
The primary master refuse more than one connection from a node.

Modified:
    trunk/neo/master/handlers/identification.py

Modified: trunk/neo/master/handlers/identification.py
==============================================================================
--- trunk/neo/master/handlers/identification.py [iso-8859-1] (original)
+++ trunk/neo/master/handlers/identification.py [iso-8859-1] Thu Apr  1 16:10:22 2010
@@ -38,21 +38,22 @@
         node = node_by_uuid or node_by_addr
         if node_by_uuid is not None:
             if node.getAddress() == address:
+                # the node is still alive
                 if node.isBroken():
                     raise protocol.BrokenNodeDisallowedError
-                # the node is still alive
-                node.setRunning()
             if node.getAddress() != address:
+                # this node has changed its address
                 if node.isRunning():
                    # still running, reject this new node
                     raise protocol.ProtocolError('invalid server address')
-                # this node has changed its address
-                node.setAddress(address)
-                node.setRunning()
         if node_by_uuid is None and node_by_addr is not None:
             if node.isRunning():
                 # still running, reject this new node
                 raise protocol.ProtocolError('invalid server address')
+        if node is not None:
+            if node.isConnected():
+                # more than one connection from this node
+                raise protocol.ProtocolError('already connected')
             node.setAddress(address)
             node.setRunning()
 





More information about the Neo-report mailing list