Browse Source

add TODO, fix a bug with a name that vanishes/does not exist

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@346 e5f2f494-b856-4b98-b285-d166d9295462
Michael Graff 15 years ago
parent
commit
f6b55c6092
2 changed files with 16 additions and 1 deletions
  1. 12 0
      src/bin/msgq/TODO
  2. 4 1
      src/bin/msgq/msgq.py

+ 12 - 0
src/bin/msgq/TODO

@@ -0,0 +1,12 @@
+== TODO for MsgQ
+
+* The code could use some refactoring.
+
+* Refactor:  Right now, the MsgQ class manages each connection using several
+lists.  There should be a Client class which holds most of this per-client
+data.  Some will need to remain in the main "driver" MsgQ class (such as the
+list of clients and their lnames) but buffer management, reading from a
+socket, etc. could all go into this client class.
+
+* More tests:  A test to send to strange locations should be added, to test
+that code path (a bug which I am committing with this file...)

+ 4 - 1
src/bin/msgq/msgq.py

@@ -250,7 +250,10 @@ class MsgQ:
         if to == "*":
             sockets = self.subs.find(group, instance)
         else:
-            sockets = [ self.lnames[to] ]
+            if to in self.lnames:
+                sockets = [ self.lnames[to] ]
+            else:
+                return # recipient doesn't exist
 
         msg = self.preparemsg(routing, data)