Thread: SFV integration
View Single Post
Old 07-25-2003, 07:47 AM  
Csimbi
Junior Member
 
Join Date: Jul 2003
Posts: 3
Lightbulb SFV integration

I have a feature that would be nice to have in future versions.
It is about integration of SFV checks into FlashFXP.
Here are the options that are needed:
[Checkbox1] Check SFV files if exist.
[Checkbox2] Re-download failed files [SpinEdit1] times.

Dynamic behaviour:
Code:
[Checkbox1]::OnChange(...) {
  if ([CheckBox1]->Enabled)
  {
    [Checkbox2]->Enabled=true;
    [SpinEdit1]->Enabled=true;
    //... other code if needed
  }
  else
  {
    [Checkbox2]->Enabled=false;
    [SpinEdit1]->Enabled=false;
    //... other code if needed
  }
}
How it would work when it is turned on:
1. SFV files downloaded first from the server is they exist (each if there are more) in the dir where the files are.
2. When a file is downloaded, its CRC is checked.
3. Let's see what we have to do.
Code:
switch (CRC){
  case good: break; //nothing to do - just remove from queue as usually

  case bad:{
    if ([CheckBox1]->Enabled && ![CheckBox1]->Enabled)
      {
        AddToLog(Source, "SFV CRC check failed.); // Add an entry to log that CRC failed
        MarkFailedInQueue(Source): // Mark the file failed in the queue
        break;
      }
    if ([CheckBox1]->Enabled && [CheckBox1]->Enabled)
      {
        if(Source->CRCRetry<=SpinEdit1->Value)
        {
          DeleteLocalFile("Target"); //Delete bad local file
          MoveFileInQueueToFront(Source); // Move the file to the front of the queue
          Source->CRCRetry++; // Increase re-download counter
        }
        else
        {
          AddToLog(Source, "SFV CRC check failed.); // Add an entry to log that CRC failed
          MarkFailedInQueue(Source): // Mark the file failed in the queue
        }
      }
     break;
}
For otimization You could for example cache the CRCs from the SFV files into the queue, and calculate CRC while downloading (in this case remember to check CRC on resumed files also).

So what do You think?
Would be a nice addition I believe, and would save users with bad connection a lot of time and work.
Csimbi is offline