diff options
author | Andrew A. de Laix <alain@lindenlab.com> | 2010-12-07 15:41:31 -0800 |
---|---|---|
committer | Andrew A. de Laix <alain@lindenlab.com> | 2010-12-07 15:41:31 -0800 |
commit | 3c3683b884542e5aa85099f4ce0c1b556613795d (patch) | |
tree | ca2fa9b4bf5e50ab4641a64c62eb072c81698a69 /indra/newview/llappviewer.cpp | |
parent | 4d861ef022f6c22837de4c76ee3e7f2b191b8a5e (diff) |
limit dowload bandwidth to 'Maximum bandwidth' setting
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 08e40168c3..38422621ef 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2413,6 +2413,12 @@ namespace { // let others also handle this event by default return false; } + + bool on_bandwidth_throttle(LLUpdaterService * updater, LLSD const & evt) + { + updater->setBandwidthLimit(evt.asInteger() * (1024/8)); + return false; // Let others receive this event. + }; }; void LLAppViewer::initUpdater() @@ -2435,6 +2441,9 @@ void LLAppViewer::initUpdater() channel, version); mUpdater->setCheckPeriod(check_period); + mUpdater->setBandwidthLimit((int)gSavedSettings.getF32("ThrottleBandwidthKBPS") * (1024/8)); + gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()-> + connect(boost::bind(&on_bandwidth_throttle, mUpdater.get(), _2)); if(gSavedSettings.getBOOL("UpdaterServiceActive")) { bool install_if_ready = true; |