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

[minion-cvs] Fix nasty bug: actually remove packets flushed from que...



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

Modified Files:
	ClientMain.py 
Log Message:
Fix nasty bug: actually remove packets flushed from queue.

Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -d -r1.141 -r1.142
--- ClientMain.py	18 Dec 2003 23:03:01 -0000	1.141
+++ ClientMain.py	19 Dec 2003 17:09:36 -0000	1.142
@@ -498,7 +498,12 @@
                     for h in handles:
                         if self.queue.packetExists(h):
                             self.queue.removePacket(h)
-                    if handles:
+                    removed = 0
+                    for p in pktList:
+                        if hasattr(p, 'remove'):
+                            p.remove()
+                            removed = 1
+                    if handles or removed:
                         self.queue.cleanQueue()
                 finally:
                     clientUnlock()
@@ -519,6 +524,8 @@
                 return self.queue.getPacket(self.h)[0]
             def __cmp__(self,other):
                 return cmp(id(self),id(other))
+            def remove(self):
+                self.queue.removePacket(self.h)
 
         LOG.info("Flushing packet queue")
         clientLock()