From 38bcfed0c02ca5fa7f74a5602eb001fa7d6e0f96 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Tue, 16 Feb 2010 11:07:32 +0000
Subject: [PATCH] Avoid pushing fake packet more than once per queue for a
 given connection.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1770 71dcc9de-d417-0410-9af5-da40c76e7ee4
---
 neo/dispatcher.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/neo/dispatcher.py b/neo/dispatcher.py
index c560bf2e..f29736af 100644
--- a/neo/dispatcher.py
+++ b/neo/dispatcher.py
@@ -70,9 +70,12 @@ class Dispatcher:
         try:
             message_table = self.message_table.pop(id(conn), EMPTY)
         finally:
-            self.message_table_lock_release()
+        notified_set = set()
         for queue in message_table.itervalues():
-            queue.put((conn, None))
+            queue_id = id(queue)
+            if queue_id not in notified_set:
+                queue.put((conn, None))
+                notified_set.add(queue_id)
 
     def registered(self, conn):
         """Check if a connection is registered into message table."""
-- 
2.30.9