[Neo-report] r2195 gregory - /trunk/neo/storage/handlers/identification.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Aug 4 10:53:32 CEST 2010


Author: gregory
Date: Wed Aug  4 10:53:32 2010
New Revision: 2195

Log:
Handle multiple incoming connections from client with crashing.

If a client connect to a storage more than one time, cut the old connection
and replace it by the new one. This is required if the client reconnect to
fast and the storage handle in single poll loop the new connection *then*
the lost of the previous connection.

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

Modified: trunk/neo/storage/handlers/identification.py
==============================================================================
--- trunk/neo/storage/handlers/identification.py [iso-8859-1] (original)
+++ trunk/neo/storage/handlers/identification.py [iso-8859-1] Wed Aug  4 10:53:32 2010
@@ -45,6 +45,10 @@ class IdentificationHandler(EventHandler
             handler = ClientOperationHandler
             if node is None:
                 node = app.nm.createClient()
+            elif node.isConnected():
+                # cut previous connection
+                node.getConnection().close()
+                node.onConnectionClosed()
             node.setRunning()
         elif node_type == NodeTypes.STORAGE:
             from neo.storage.handlers.storage import StorageOperationHandler





More information about the Neo-report mailing list