client: Restore RUN_MODE_ALWAYS functionality in network suspension logic

svn path=/trunk/boinc/; revision=21341
This commit is contained in:
Charlie Fenton 2010-05-01 01:19:32 +00:00
parent 858661669d
commit cf8490e2cd
2 changed files with 16 additions and 6 deletions

View File

@ -3289,3 +3289,9 @@ David 29 Apr 2010
client/
cs_scheduler.cpp
Charlie 30 Apr 2010
- client: Restore RUN_MODE_ALWAYS functionality in network suspension
logic which as lost in code cleanup of 26 Apr 2010.
cs_prefs.pp

View File

@ -242,6 +242,7 @@ void CLIENT_STATE::check_suspend_network() {
network_suspended = true;
file_xfers_suspended = true;
network_suspend_reason = SUSPEND_REASON_USER_REQ;
return;
}
// was there a recent GUI RPC that needs network?
@ -250,6 +251,15 @@ void CLIENT_STATE::check_suspend_network() {
ALLOW_NETWORK_IF_RECENT_RPC_PERIOD
);
switch(network_mode.get_current()) {
case RUN_MODE_ALWAYS:
return;
case RUN_MODE_NEVER:
file_xfers_suspended = true;
if (!recent_rpc) network_suspended = true;
network_suspend_reason = SUSPEND_REASON_USER_REQ;
}
if (global_prefs.daily_xfer_limit_mb) {
double up, down;
daily_xfer_history.totals(
@ -262,12 +272,6 @@ void CLIENT_STATE::check_suspend_network() {
}
}
if (network_mode.get_current() == RUN_MODE_NEVER) {
file_xfers_suspended = true;
if (!recent_rpc) network_suspended = true;
network_suspend_reason = SUSPEND_REASON_USER_REQ;
}
if (!global_prefs.run_if_user_active && user_active) {
file_xfers_suspended = true;
if (!recent_rpc) network_suspended = true;