Ignore:
Timestamp:
Feb 13, 2010, 7:56:47 PM (12 years ago)
Author:
arnold
Message:

P2PManager/P2PJobAdmin: Finetuning of leaving and re-joining the network.
Miscellaneous null-Checks implemented, so some p2p-sided errors where catched.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher_IControl/KeySearcher_IControl.cs

    r1139 r1144  
    116116        void keySearcher_OnBruteforcingEnded(LinkedList<KeySearcher.KeySearcher.ValueKey> top10List)
    117117        {
    118             this.dtEndProcessing = DateTime.Now;
    119             // Create a new JobResult
    120             TimeSpan processingTime = this.dtEndProcessing.Subtract(this.dtStartProcessing);
    121             KeyPatternJobResult jobResult =
    122                 new KeyPatternJobResult(this.JobId, top10List, processingTime);
    123 
    124             GuiLogging("Ended bruteforcing JobId '" + this.JobId.ToString() + "' in "
    125                 + processingTime.TotalMinutes.ToString() + " minutes",NotificationLevel.Info);
    126 
    127             // if registered, sending the serialized Job Result
    128             if (OnProcessingSuccessfullyEnded != null)
    129             {
    130                 OnProcessingSuccessfullyEnded(this.JobId, jobResult.Serialize());
     118            if (this.JobId != null || top10List != null)
     119            {
     120                this.dtEndProcessing = DateTime.Now;
     121                // Create a new JobResult
     122                TimeSpan processingTime = this.dtEndProcessing.Subtract(this.dtStartProcessing);
     123                KeyPatternJobResult jobResult =
     124                    new KeyPatternJobResult(this.JobId, top10List, processingTime);
     125
     126                GuiLogging("Ended bruteforcing JobId '" + this.JobId.ToString() + "' in "
     127                    + processingTime.TotalMinutes.ToString() + " minutes", NotificationLevel.Info);
     128
     129                // if registered, sending the serialized Job Result
     130                if (OnProcessingSuccessfullyEnded != null)
     131                {
     132                    OnProcessingSuccessfullyEnded(this.JobId, jobResult.Serialize());
     133                }
     134            }
     135            else
     136            {
     137                GuiLogging("Bruteforcing was canceled, because jobId and/or jobResult are null.", NotificationLevel.Info);
     138                if (OnProcessingCanceled != null)
     139                    OnProcessingCanceled(null);
    131140            }
    132141        }
Note: See TracChangeset for help on using the changeset viewer.