Changeset 2094


Ignore:
Timestamp:
Nov 15, 2010, 1:59:07 PM (11 years ago)
Author:
nolte
Message:

Versionnumber added. (Not in use yet)
Required whenever the size of the Memory Stream changes.

Location:
trunk/CrypPlugins/KeySearcher
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/KeySearcher/KeySearcher.csproj

    r2086 r2094  
    126126    <Compile Include="P2P\Presentation\StatisticsGenerator.cs" />
    127127    <Compile Include="P2P\Presentation\StatusContainer.cs" />
     128    <Compile Include="P2P\Exceptions\KeySearcherStopException.cs" />
    128129    <Compile Include="P2P\Storage\StatusUpdater.cs" />
    129130    <Compile Include="Presentation\Controls\LocalQuickWatchPresentation.xaml.cs">
  • trunk/CrypPlugins/KeySearcher/P2P/DistributedBruteForceManager.cs

    r2078 r2094  
    105105                    continue;
    106106                }
     107                catch (KeySearcherStopException)  //Fullstopfunction
     108                {
     109                    keySearcher.GuiLogMessage("Keysearcher Fullstop.", NotificationLevel.Error);
     110                    keySearcher.GuiLogMessage("Please Update your Version.", NotificationLevel.Error);
     111                    keySearcher.stop = true;
     112                    return;
     113                }
    107114
    108115                // TODO if reserve returns successfully, start timer to update our reserveration every few minutes
  • trunk/CrypPlugins/KeySearcher/P2P/Storage/StorageHelper.cs

    r2074 r2094  
    1414        private readonly StatusContainer statusContainer;
    1515
     16        //VERSIONNUMBER: Important. Set it +1 manually everytime the length of the MemoryStream Changes
     17        private const int version = 1;
     18
    1619        public StorageHelper(KeySearcher keySearcher, StatisticsGenerator statisticsGenerator, StatusContainer statusContainer)
    1720        {
     
    4346                binaryWriter.Write(valueKey.decryption);
    4447            }
     48           
     49            //TODO: Versionnumber write
     50            //-----------------------------------------------------
     51            //binaryWriter.Write(version);
     52            //-----------------------------------------------------
     53           
     54            //TODO: Hash Table write;
    4555
    4656            return StoreWithStatistic(KeyInDht(nodeToUpdate), memoryStream.ToArray());
     
    103113            }
    104114
     115            //-------------------------------------------------------------------------------------------
     116            //AFTER CHANGING THE FOLLOWING PART INCREASE THE VERSION-NUMBER AT THE TOP OF THIS CLASS!
     117            //-------------------------------------------------------------------------------------------
     118            //TODO: Versionnumber read
     119            /*
     120            try
     121            {
     122                //If you're already at the end of the stream ignore the version
     123                if (binaryReader.BaseStream.Length != binaryReader.BaseStream.Position)
     124                {
     125                    int versionInUse = binaryReader.ReadInt32();
     126                    //Check if a newer Version is in use
     127                    if (versionInUse > version)
     128                    {
     129                        throw new KeySearcherStopException();
     130                    }
     131                    //TODO: Hashtable read
     132                }
     133            }
     134            catch(Exception)
     135            {
     136                throw new KeySearcherStopException();
     137            }
     138
     139            //----------------------------------------------------------------------------------
     140            */
    105141            if (resultCount > 0)
    106142            {
Note: See TracChangeset for help on using the changeset viewer.