[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Fix bug in "mixminion flush"



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv13943/lib/mixminion

Modified Files:
	ClientMain.py 
Log Message:
Fix bug in "mixminion flush"

Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- ClientMain.py	8 Dec 2003 02:22:56 -0000	1.136
+++ ClientMain.py	8 Dec 2003 06:35:26 -0000	1.137
@@ -215,7 +215,8 @@
         self.queue = mixminion.ClientUtils.ClientQueue(os.path.join(userdir, "queue"))
 
     def _sortPackets(self, packets, shuffle=1):
-        """Helper function.  Takes a list of tuples of (packet, routingInfo),
+        """Helper function.  Takes a list of tuples of (packet, 
+           ServerInfo/routigInforoutingInfo),
            groups packets with the same routingInfos, and returns a list of
            tuples of (routingInfo, [packet list]).
 
@@ -224,7 +225,12 @@
         """
         d = {}
         for packet, firstHop in packets:
-            ri = firstHop.getRoutingInfo()
+            if isinstance(firstHop, mixminion.ServerInfo.ServerInfo):
+                ri = firstHop.getRoutingInfo()
+            else:
+                assert isinstance(firstHop, (mixminion.Packet.MMTPHostInfo,
+                                             mixminion.Packet.IPV4Info))
+                ri = firstHop
             d.setdefault(ri,[]).append(packet)
         result = d.items()
         if shuffle: