Changeset 366

Show
Ignore:
Timestamp:
06/24/08 13:47:36 (5 months ago)
Author:
FeepingCreature
Message:
  • Meep
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/tools/downloader.d

    r362 r366  
    102102static this() { New(download_callbacks); } 
    103103 
    104 string download(string param, string *redirect=null) { 
     104string download(string param, string *redirect=null, int maxredir = 16) { 
     105  if (!maxredir) throw new Exception("Maximal redirection level reached for "~param~"! Aborting."); 
    105106  string url=param; 
    106107  if (url=="") throw new Exception("URL empty"); 
     
    238239        download_callbacks.add(loc, dg); 
    239240        scope(exit) download_callbacks.remove(loc, dg); 
    240         res=download(loc); return true; 
     241        res=download(loc, redirect, maxredir-1); return true; 
    241242      } 
    242243    }