From 0f1d674d76490f71c02116bcfdc0620cd758c975 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 28 Aug 2011 00:41:03 -0700 Subject: [PATCH] MutableFileNode.set_downloader_hints: never depend upon order of dict.values() The old code was calculating the "extension parameters" (a list) from the downloader hints (a dictionary) with hints.values(), which is not stable, and would result in corrupted filecaps (with the 'k' and 'segsize' hints occasionally swapped). The new code always uses [k,segsize]. --- src/allmydata/mutable/filenode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/allmydata/mutable/filenode.py b/src/allmydata/mutable/filenode.py index 59438b87..02f99b64 100644 --- a/src/allmydata/mutable/filenode.py +++ b/src/allmydata/mutable/filenode.py @@ -701,7 +701,7 @@ class MutableFileNode: def set_downloader_hints(self, hints): self._downloader_hints = hints - extensions = hints.values() + extensions = [ hints["k"], hints["segsize"] ] self._uri.set_extension_params(extensions) -- 2.45.2