[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] Last tweak to client keystore



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

Modified Files:
	ClientMain.py 
Log Message:
Last tweak to client keystore

Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- ClientMain.py	6 Jan 2003 03:29:45 -0000	1.28
+++ ClientMain.py	6 Jan 2003 04:58:14 -0000	1.29
@@ -217,9 +217,6 @@
 
     def __load(self):
         """Helper method. Read the cached parsed descriptors from disk."""
-        #self.lastModified = self.lastDownload = -1
-        #self.serverList = []
-        #self.digestMap = {}
         try:
             f = open(os.path.join(self.dir, "cache"), 'rb')
             cached = cPickle.load(f)
@@ -408,10 +405,16 @@
         newServers = []
         for info, where in self.serverList:
             others = [ s for s, _ in self.byNickname[info.getNickname()] ]
+            inDirectory = [ s.getDigest()
+                            for s, w in self.byNickname[info.getNickname()]
+                            if w == 'D' ]
             if (where != 'D'
                 and (info.isExpiredAt(cutoff)
-                     or info.isSupersededBy(others))):
-                # Otherwise, remove it.
+                     or info.isSupersededBy(others)
+                     or info.getDigest() in inDirectory)):
+                # If the descriptor is not in the directory, and it is
+                # expired, is superseded, or is duplicated by a descriptor
+                # from the directory, remove it.
                 try:
                     os.unlink(os.path.join(self.dir, "imported", where[2:]))
                 except OSError, e:
@@ -779,10 +782,6 @@
 
 [Security]
 PathLength: 4
-
-## Not yet implemented:
-# SURBAddress: mbox:quux
-# SURBPathLength: 8
 
 """)
     f.close()