Revision 368e06fd trunk/Pithos.Core/Agents/NetworkAgent.cs
b/trunk/Pithos.Core/Agents/NetworkAgent.cs | ||
---|---|---|
438 | 438 |
throw new ArgumentNullException("downloadPath"); |
439 | 439 |
Contract.EndContractBlock(); |
440 | 440 |
|
441 |
StatusKeeper.SetFileOverlayStatus(downloadPath, FileOverlayStatus.Conflict);
|
|
441 |
StatusKeeper.SetFileState(downloadPath,FileStatus.Conflict, FileOverlayStatus.Conflict,"File changed at the server");
|
|
442 | 442 |
UpdateStatus(PithosStatus.HasConflicts); |
443 | 443 |
var message = String.Format("Conflict detected for file {0}", downloadPath); |
444 | 444 |
Log.Warn(message); |
... | ... | |
454 | 454 |
Contract.EndContractBlock(); |
455 | 455 |
|
456 | 456 |
DeleteAgent.ProceedEvent.Wait(); |
457 |
/* |
|
458 |
|
|
459 |
//If the action targets a local file, add a treehash calculation |
|
460 |
if (!(cloudAction is CloudDeleteAction) && cloudAction.LocalFile as FileInfo != null) |
|
461 |
{ |
|
462 |
var accountInfo = cloudAction.AccountInfo; |
|
463 |
var localFile = (FileInfo) cloudAction.LocalFile; |
|
464 |
|
|
465 |
if (localFile.Length > accountInfo.BlockSize) |
|
466 |
cloudAction.TopHash = |
|
467 |
new Lazy<string>(() => Signature.CalculateTreeHashAsync(localFile, |
|
468 |
accountInfo.BlockSize, |
|
469 |
accountInfo.BlockHash, Settings.HashingParallelism).Result |
|
470 |
.TopHash.ToHashString()); |
|
471 |
else |
|
472 |
{ |
|
473 |
cloudAction.TopHash = new Lazy<string>(() => cloudAction.LocalHash.Value); |
|
474 |
} |
|
475 |
|
|
476 |
} |
|
477 |
else |
|
478 |
{ |
|
479 |
//The hash for a directory is the empty string |
|
480 |
cloudAction.TopHash = new Lazy<string>(() => String.Empty); |
|
481 |
} |
|
482 |
*/ |
|
483 | 457 |
|
484 | 458 |
if (cloudAction is CloudDeleteAction) |
485 | 459 |
DeleteAgent.Post((CloudDeleteAction)cloudAction); |
Also available in: Unified diff