Ignore:
Timestamp:
12/22/2009 3:47:42 AM (5 years ago)
Author:
lowjoel
Message:

Decide once the length of the boundary since placing the Random call in the loop condition would introduce too much unpredictability in the boundary length.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/BlackBox/Eraser/BlackBoxUploadForm.cs

    r1402 r1403  
    248248            { 
    249249                Random rand = new Random(); 
    250                 for (int i = 0; i < 20 + rand.Next(40); ++i) 
     250                for (int i = 0, j = 20 + rand.Next(40); i < j; ++i) 
    251251                    Boundary += ValidBoundaryChars[rand.Next(ValidBoundaryChars.Length)]; 
    252252            } 
     
    312312        private string FileName; 
    313313 
     314        /// <summary> 
     315        /// Characters valid for use in the multipart boundary. 
     316        /// </summary> 
    314317        private static readonly string ValidBoundaryChars = 
    315318            "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'()+_,-./:=?"; 
Note: See TracChangeset for help on using the changeset viewer.