Parcourir la source

more review comments

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/parkinglot@582 e5f2f494-b856-4b98-b285-d166d9295462
Michael Graff il y a 15 ans
Parent
commit
f38058856e
2 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 2 2
      src/bin/msgq/msgq.py
  2. 1 1
      src/lib/cc/python/ISC/CC/Message.py

+ 2 - 2
src/bin/msgq/msgq.py

@@ -39,13 +39,13 @@ class SubscriptionManager:
         """Remove the socket from the one specific subscription."""
         target = ( group, instance )
         if target in self.subscriptions:
-            while socket in self.subscriptions[target]:
+            if socket in self.subscriptions[target]:
                 self.subscriptions[target].remove(socket)
 
     def unsubscribe_all(self, socket):
         """Remove the socket from all subscriptions."""
         for socklist in self.subscriptions.values():
-            while socket in socklist:
+            if socket in socklist:
                 socklist.remove(socket)
 
     def find_sub(self, group, instance):

+ 1 - 1
src/lib/cc/python/ISC/CC/Message.py

@@ -62,7 +62,7 @@ def _encode_length_and_type(data, datatype):
     elif length < 0x00010000:
         return(struct.pack(">B H", datatype | _ITEM_LENGTH_16, length) + data)
     else:
-        return(struct.pack(">B I", datatype, length) + data)
+        return(struct.pack(">B I", datatype | _ITEM_LENGTH_32, length) + data)
 
 def _pack_utf8(item):
     """Pack a string (utf-8) and its type/length prefix."""