Changeset 883

Show
Ignore:
Timestamp:
2008-03-12 23:28:05 (10 months ago)
Author:
MaierMan
Message:

#613: Multiple "slow-down" reports.
trunk version

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/chrome/content/dta/manager/prefs.js

    r876 r883  
    3636 * 
    3737 * ***** END LICENSE BLOCK ***** */ 
    38   
    39  var Prefs = { 
     38 
     39const PREF_CONN = 'network.http.max-persistent-connections-per-server'; 
     40 
     41var Prefs = { 
    4042        tempLocation: null, 
    4143         
     
    138140                        this.tempLocation = null; 
    139141                } 
    140                 var conns = (this.maxInProgress * this.maxChunks) + 2; 
    141                 ['network.http.max-connections', 'network.http.max-connections-per-server'].forEach( 
    142                         function(e) { 
    143                                 if ((!prefName || prefName == e) && conns != Preferences.get(e, conns)) { 
    144                                         Preferences.setDTA(e, Preferences.get(e, conns)); 
    145                                 }                                
    146                                 if (conns > Preferences.get(e, conns)) { 
    147                                         Preferences.set(e, conns); 
    148                                 } 
    149                                 conns = Math.floor(conns / 1.5); 
     142                if (!prefName || prefName == PREF_CONN) { 
     143                        let conns = (this.maxInProgress * this.maxChunks) + 2; 
     144                        let cur = Preferences.get(PREF_CONN, conns); 
     145                                                 
     146                        if (conns != cur) { 
     147                                Preferences.setDTA(PREF_CONN, cur); 
    150148                        } 
    151                 ); 
     149                        if (conns > cur) { 
     150                                Preferences.set(PREF_CONN, conns); 
     151                        } 
     152                } 
    152153        }, 
    153154        shutdown: function() { 
     
    157158        }, 
    158159        _resetConnPrefs: function() { 
    159                 ['network.http.max-connections', 'network.http.max-connections-per-server'].forEach( 
    160                         function(e) { 
    161                                 let conn = Preferences.getDTA(e, 0); 
    162                                 if (conn) { 
    163                                         Preferences.set(e, conn); 
    164                                         Preferences.setDTA(e, 0); 
    165                                 } 
    166                         } 
    167                 ); 
     160                let conn = Preferences.getDTA(PREF_CONN, 0); 
     161                if (conn) { 
     162                        Preferences.set(PREF_CONN, conn); 
     163                        Preferences.setDTA(PREF_CONN, 0); 
     164                } 
    168165        } 
    169 } 
     166}; 
    170167Prefs.init(); 
  • trunk/components/migrationService.js

    r866 r883  
    6868                                return; 
    6969                        } 
    70                         debug.logString("MigrationManager: migration started"); 
     70                        debug("MigrationManager: migration started"); 
    7171                        if (vc.compare(lastVersion, "1.0a1") < 0) { 
    7272                                this._execute(['Prefs', 'DropDowns', 'Filters', 'Remove']); 
    7373                        } 
     74                        if (vc.compare(lastVersion, "1.0.1") < 0) { 
     75                                this._execute(['ResetMaxConnections']); 
     76                        }                        
    7477        var params = Components.classes["@mozilla.org/embedcomp/dialogparam;1"] 
    7578                                .createInstance(Components.interfaces.nsIDialogParamBlock); 
     
    156159        }, 
    157160         
     161        // 1.0.1: #613 Multiple "slow-down" reports 
     162        _migrateResetMaxConnections: function() { 
     163                debug("resetting connection prefs"); 
     164                ['network.http.max-connections', 'network.http.max-connections-per-server', 'network.http.max-persistent-connections-per-server'].forEach( 
     165                        function(e) { 
     166                                DTA_preferences.reset(e); 
     167                        } 
     168                ); 
     169        }, 
     170         
    158171        // pre 1.0: migrate Filters 
    159172        _migrateFilters: function MM_migrateFilters() {