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].
This commit is contained in:
Brian Warner 2011-08-28 00:41:03 -07:00
parent 4b0078dc49
commit 0f1d674d76

View File

@ -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)