Changeset 2501


Ignore:
Timestamp:
Jan 27, 2011, 1:53:00 PM (11 years ago)
Author:
Sven Rech
Message:

catched exception in p2peditor which can happen when p2p operation failed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/P2PEditor/Distributed/JobListManager.cs

    r2081 r2501  
    9595        public void RetrieveDownloadCount(DistributedJob distributedJob)
    9696        {
    97             var result = P2PManager.Retrieve(GenerateDownloadCounterKey(distributedJob));
    98            
    99             if (result.Status == RequestResultType.KeyNotFound)
     97            try
    10098            {
    101                 distributedJob.Downloads = 0;
    102                 return;
     99                var result = P2PManager.Retrieve(GenerateDownloadCounterKey(distributedJob));
     100
     101                if (result.Status == RequestResultType.KeyNotFound)
     102                {
     103                    distributedJob.Downloads = 0;
     104                    return;
     105                }
     106
     107                if (result.Data != null)
     108                {
     109                    var binaryReader = new BinaryReader(new MemoryStream(result.Data));
     110                    distributedJob.Downloads = binaryReader.ReadInt32();
     111                    distributedJob.LastDownload = DateTime.FromBinary(binaryReader.ReadInt64());
     112                }
    103113            }
    104 
    105             if (result.Data != null)
     114            catch (Exception)
    106115            {
    107                 var binaryReader = new BinaryReader(new MemoryStream(result.Data));
    108                 distributedJob.Downloads = binaryReader.ReadInt32();
    109                 distributedJob.LastDownload = DateTime.FromBinary(binaryReader.ReadInt64());
    110116            }
    111117        }
Note: See TracChangeset for help on using the changeset viewer.