Changeset 1756


Ignore:
Timestamp:
2/8/2010 3:55:50 AM (4 years ago)
Author:
lowjoel
Message:

Fixed progress calculation -- the old method did not take into account the different erasure methods, assuming a one-pass method. Addresses #322: Eraser 6.0.6.1743 - First Last 16KB threshhold addressed in change 1745 is 28kB rather than 32kB

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.DefaultPlugins/ErasureMethods/FirstLast16KB.cs

    r1725 r1756  
    8585            if (paths == null) 
    8686            { 
    87                 if (targetSize <= dataSize) 
     87                if (targetSize <= DataSize) 
    8888                    amountToWrite = targetSize; 
    8989                else 
    90                     amountToWrite = dataSize * 2; 
     90                    amountToWrite = DataSize * 2; 
    9191            } 
    9292            else 
    93                 amountToWrite = paths.Count * dataSize * 2; 
     93                amountToWrite = paths.Count * DataSize * 2; 
    9494 
    9595            //The final amount has to be multiplied by the number of passes. 
     
    115115            //If the target stream is shorter than or equal to 32kb, just forward it to 
    116116            //the default function. 
    117             if (strm.Length < dataSize * 2) 
     117            if (strm.Length < DataSize * 2) 
    118118            { 
    119119                method.Erase(strm, erasureLength, prng, callback); 
     
    123123            //We need to intercept the callback function as we run the erasure method 
    124124            //twice on two parts of the file. 
     125            long dataSize = method.CalculateEraseDataSize(null, DataSize * 2); 
    125126            ErasureMethodProgressFunction customCallback = 
    126127                delegate(long lastWritten, long totalData, int currentPass) 
    127128                { 
    128                     callback(lastWritten, dataSize * 2, currentPass); 
     129                    callback(lastWritten, dataSize, currentPass); 
    129130                }; 
    130131 
     
    141142        /// The amount of data to be erased from the header and the end of the file. 
    142143        /// </summary> 
    143         private const long dataSize = 16 * 1024; 
     144        private const long DataSize = 16 * 1024; 
    144145 
    145146        private ErasureMethod method; 
Note: See TracChangeset for help on using the changeset viewer.