[ create a new paste ] login | about

Link: http://codepad.org/VWlyZHug    [ raw code | fork ]

Python, pasted on Oct 28:
diff -rN -u old-1.9.2/src/allmydata/immutable/filenode.py new-1.9.2/src/allmydata/immutable/filenode.py
--- old-1.9.2/src/allmydata/immutable/filenode.py       2012-10-27 21:35:33.403677140 -0600
+++ new-1.9.2/src/allmydata/immutable/filenode.py       2012-10-27 21:35:33.600343041 -0600
@@ -22,6 +22,7 @@
 from allmydata.immutable.downloader.status import DownloadStatus
 
 class CiphertextFileNode:
+    # XXX should we make an ISomething interface for this? Maybe maybe IReadable subclass that ISomething?
     def __init__(self, verifycap, storage_broker, secret_holder,
                  terminator, history):
         assert isinstance(verifycap, uri.CHKFileVerifierURI)
@@ -87,6 +88,8 @@
     def raise_error(self):
         pass
 
+    def is_mutable(self):
+        return False
 
     def check_and_repair(self, monitor, verify=False, add_lease=False):
         verifycap = self._verifycap
diff -rN -u old-1.9.2/src/allmydata/nodemaker.py new-1.9.2/src/allmydata/nodemaker.py
--- old-1.9.2/src/allmydata/nodemaker.py        2012-10-27 21:35:33.427010383 -0600
+++ new-1.9.2/src/allmydata/nodemaker.py        2012-10-27 21:35:33.597009720 -0600
@@ -72,12 +72,12 @@
             cap = uri.from_string(bigcap, deep_immutable=deep_immutable,
                                   name=name)
             node = self._create_from_single_cap(cap)
-            if node:
-                self._node_cache[memokey] = node  # note: WeakValueDictionary
-            else:
+            if node is None:
                 # don't cache UnknownNode
                 node = UnknownNode(writecap, readcap,
                                    deep_immutable=deep_immutable, name=name)
+            elif node.is_mutable():
+                self._node_cache[memokey] = node  # note: WeakValueDictionary
 
         if self.blacklist:
             si = node.get_storage_index()


Create a new paste based on this one


Comments: