File index overflow fix
[pithos-ms-client] / trunk / Pithos.Core / Agents / Downloader.cs
index ef2c5a9..9ba896e 100644 (file)
@@ -168,13 +168,13 @@ namespace Pithos.Core.Agents
             //Calculate the file's treehash
 
             //TODO: Should pass cancellation token here
-            var treeHash = await Signature.CalculateTreeHashAsync(localPath, serverHash.BlockSize, serverHash.BlockHash, 2);
+            var treeHash = await Signature.CalculateTreeHashAsync(localPath, (int)serverHash.BlockSize, serverHash.BlockHash, 2);
 
             //And compare it with the server's hash
             var upHashes = serverHash.GetHashesAsStrings();
             var localHashes = treeHash.HashDictionary;
             ReportDownloadProgress(Path.GetFileName(localPath), 0, upHashes.Length, cloudFile.Bytes);
-            for (int i = 0; i < upHashes.Length; i++)
+            for (var i = 0; i < upHashes.Length; i++)
             {\r
                 if (await WaitOrAbort(cloudFile, cancellationToken))\r
                     return;