Commit ff21a0f1 authored by Oliver Behnke's avatar Oliver Behnke

Merge branch 'master' into drupal-eah-albert

parents c18511fe 4e1617fb
......@@ -97,11 +97,9 @@ List<ImageWrapper> getSlideshowForProject(in String url); // clientStatus.getS
////// app preference ////////////////////////////////////////////
void setAutostart(in boolean isAutoStart); // Monitor.getAppPrefs().setAutostart(boolean);
void setShowNotificationForNotices(in boolean isShow); // Monitor.getAppPrefs().setShowNotificationForNotices(boolean);
void setShowNotificationDuringSuspend(in boolean isShow); // Monitor.getAppPrefs().setShowNotificationDuringSuspend(boolean);
boolean getShowAdvanced(); // Monitor.getAppPrefs().getShowAdvanced();
boolean getAutostart(); // Monitor.getAppPrefs().getAutostart();
boolean getShowNotificationForNotices(); // Monitor.getAppPrefs().getShowNotificationForNotices();
boolean getShowNotificationDuringSuspend(); // Monitor.getAppPrefs().getShowNotificationDuringSuspend();
int getLogLevel(); // Monitor.getAppPrefs().getLogLevel();
void setLogLevel(in int level); // Monitor.getAppPrefs().setLogLevel(int);
void setPowerSourceAc(in boolean src); // Monitor.getAppPrefs().setPowerSourceAc(boolean);
......
......@@ -194,7 +194,6 @@ public class PrefsFragment extends Fragment {
data.add(new PrefsListItemWrapper(getActivity(), R.string.prefs_category_general, true));
data.add(new PrefsListItemWrapperBool(getActivity(), R.string.prefs_autostart_header, R.string.prefs_category_general, BOINCActivity.monitor.getAutostart()));
data.add(new PrefsListItemWrapperBool(getActivity(), R.string.prefs_show_notification_notices_header, R.string.prefs_category_general, BOINCActivity.monitor.getShowNotificationForNotices()));
data.add(new PrefsListItemWrapperBool(getActivity(), R.string.prefs_show_notification_suspended_header, R.string.prefs_category_general, BOINCActivity.monitor.getShowNotificationDuringSuspend()));
data.add(new PrefsListItemWrapperBool(getActivity(), R.string.prefs_show_advanced_header, R.string.prefs_category_general, BOINCActivity.monitor.getShowAdvanced()));
if(!stationaryDeviceMode) {
data.add(new PrefsListItemWrapperBool(getActivity(), R.string.prefs_suspend_when_screen_on, R.string.prefs_category_general, BOINCActivity.monitor.getSuspendWhenScreenOn()));
......@@ -697,11 +696,6 @@ public class PrefsFragment extends Fragment {
updateBoolPreference(ID, isSet);
updateLayout();
break;
case R.string.prefs_show_notification_suspended_header: //app pref
BOINCActivity.monitor.setShowNotificationDuringSuspend(isSet);
updateBoolPreference(ID, isSet);
updateLayout();
break;
case R.string.prefs_show_advanced_header: //app pref
BOINCActivity.monitor.setShowAdvanced(isSet);
// reload complete layout to remove/add advanced elements
......
......@@ -172,7 +172,7 @@ public class ProjectsFragment extends Fragment {
for(int x = 0; x < data.size(); x++) {
if(data.get(x).isMgr) {
mgrIndex = x;
//break; // This function has to be revised. Are we searching the firs or the last account manager? Are there more or only one possible?
break;
}
}
if(mgrIndex < 0) { // no manager present until now
......@@ -204,14 +204,14 @@ public class ProjectsFragment extends Fragment {
//loop through all received Result items to add new projects
for(Project rpcResult : latestRpcProjectsList) {
//check whether this project is new
Integer index = null;
int index = -1;
for(int x = 0; x < data.size(); x++) {
if(rpcResult.master_url.equals(data.get(x).id)) {
index = x;
//break; // Need more further investigation.
break;
}
}
if(index == null) { // Project is new, add
if(index < 0) { // Project is new, add
if(Logging.DEBUG) {
Log.d(Logging.TAG, "New project found, id: " + rpcResult.master_url + ", managed: " +
rpcResult.attached_via_acct_mgr);
......
......@@ -40,6 +40,7 @@ import edu.berkeley.boinc.BOINCActivity;
import edu.berkeley.boinc.R;
import edu.berkeley.boinc.client.IMonitor;
import edu.berkeley.boinc.client.Monitor;
import edu.berkeley.boinc.rpc.AcctMgrInfo;
import edu.berkeley.boinc.rpc.ProjectInfo;
import edu.berkeley.boinc.utils.Logging;
......@@ -284,8 +285,25 @@ public class SelectionListActivity extends FragmentActivity {
if(result == null) {
return;
}
// If AccountManager is already connected, user should not be able to connect more AMs
// Hide 'Add Account Manager' option
boolean statusAcctMgrPresent = false;
try
{
AcctMgrInfo statusAcctMgr = BOINCActivity.monitor.getClientAcctMgrInfo();
statusAcctMgrPresent = statusAcctMgr.present;
}
catch(Exception e) {
// data retrieval failed, continue...
if(Logging.ERROR) {
Log.d(Logging.TAG, "AcctMgrInfo data retrieval failed.");
}
}
SelectionListActivity.this.entries.add(new ProjectListEntry()); // add account manager option to bottom of list
if (!statusAcctMgrPresent) {
SelectionListActivity.this.entries.add(new ProjectListEntry()); // add account manager option to bottom of list
}
SelectionListAdapter listAdapter =
new SelectionListAdapter(SelectionListActivity.this, R.id.listview, entries);
lv.setAdapter(listAdapter);
......
......@@ -32,7 +32,6 @@ public class AppPreferences {
private Boolean autostart;
private Boolean showNotificationForNotices;
private Boolean showNotificationDuringSuspend;
private Boolean showAdvanced;
private Integer logLevel;
private Boolean powerSourceAc;
......@@ -49,8 +48,6 @@ public class AppPreferences {
autostart = prefs.getBoolean("autostart", ctx.getResources().getBoolean(R.bool.prefs_default_autostart));
showNotificationForNotices =
prefs.getBoolean("showNotification", ctx.getResources().getBoolean(R.bool.prefs_default_notification_notices));
showNotificationDuringSuspend =
prefs.getBoolean("showNotificationDuringSuspend", ctx.getResources().getBoolean(R.bool.prefs_default_notification_suspended));
showAdvanced = prefs.getBoolean("showAdvanced", ctx.getResources().getBoolean(R.bool.prefs_default_advanced));
logLevel = prefs.getInt("logLevel", ctx.getResources().getInteger(R.integer.prefs_default_loglevel));
Logging.setLogLevel(logLevel);
......@@ -93,17 +90,6 @@ public class AppPreferences {
return this.showNotificationForNotices;
}
public void setShowNotificationDuringSuspend(Boolean ns) {
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean("showNotificationDuringSuspend", ns);
editor.apply();
this.showNotificationDuringSuspend = ns;
}
public Boolean getShowNotificationDuringSuspend() {
return this.showNotificationDuringSuspend;
}
public void setShowAdvanced(Boolean as) {
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean("showAdvanced", as);
......
......@@ -72,25 +72,9 @@ public class ClientNotification {
return;
}
// stop service foreground, if not active anymore
if(!active && foreground) {
setForegroundState(service, false);
}
// if not active, check preference whether to show notification during suspension
if(!active && !Monitor.getAppPrefs().getShowNotificationDuringSuspend()) {
// cancel notification if necessary
if(notificationShown) {
Log.d(Logging.TAG, "ClientNotification: cancel suspension notification due to preference.");
nm.cancel(notificationId);
notificationShown = false;
}
return;
}
//check if active tasks have changed to force update
Boolean activeTasksChanged = false;
if(updatedStatus.computingStatus == ClientStatus.COMPUTING_STATUS_COMPUTING) {
if(active && updatedStatus.computingStatus == ClientStatus.COMPUTING_STATUS_COMPUTING) {
ArrayList<Result> activeTasks = updatedStatus.getExecutingTasks();
if(activeTasks.size() != mOldActiveTasks.size()) {
activeTasksChanged = true;
......@@ -108,6 +92,10 @@ public class ClientNotification {
mOldActiveTasks = activeTasks;
}
}
else if (!mOldActiveTasks.isEmpty()) {
mOldActiveTasks.clear();
activeTasksChanged = true;
}
// update notification, only
// if it hasn't been shown before, or
......
......@@ -85,7 +85,6 @@ public class Monitor extends Service {
// XML defined variables, populated in onCreate
private String fileNameClient;
private String fileNameCLI;
private String fileNameCABundle;
private String fileNameClientConfig;
private String fileNameGuiAuthentication;
......@@ -120,7 +119,6 @@ public class Monitor extends Service {
// populate attributes with XML resource values
boincWorkingDir = getString(R.string.client_path);
fileNameClient = getString(R.string.client_name);
fileNameCLI = getString(R.string.client_cli);
fileNameCABundle = getString(R.string.client_cabundle);
fileNameClientConfig = getString(R.string.client_config);
fileNameGuiAuthentication = getString(R.string.auth_file_name);
......@@ -688,10 +686,6 @@ public class Monitor extends Service {
if (Logging.ERROR) Log.d(Logging.TAG, "Failed to install: " + fileNameClient);
return false;
}
if (!installFile(fileNameCLI, true, true, "")) {
if (Logging.ERROR) Log.d(Logging.TAG, "Failed to install: " + fileNameCLI);
return false;
}
if (!installFile(fileNameCABundle, true, false, "")) {
if (Logging.ERROR) Log.d(Logging.TAG, "Failed to install: " + fileNameCABundle);
return false;
......@@ -1388,17 +1382,6 @@ public class Monitor extends Service {
NoticeNotification.getInstance(getApplicationContext()).cancelNotification();
}
@Override
public void setShowNotificationDuringSuspend(boolean isShow) throws RemoteException {
Monitor.getAppPrefs().setShowNotificationDuringSuspend(isShow);
}
@Override
public boolean getShowNotificationDuringSuspend() throws RemoteException {
return Monitor.getAppPrefs().getShowNotificationDuringSuspend();
}
@Override
public boolean runBenchmarks() throws RemoteException {
return clientInterface.runBenchmarks();
......
......@@ -20,7 +20,6 @@
<!-- path and file configuration -->
<string name="client_path" translatable="false">/data/data/edu.berkeley.boinc/client/</string>
<string name="client_name" translatable="false">boinc</string>
<string name="client_cli" translatable="false">boinccmd</string>
<string name="client_cabundle" translatable="false">ca-bundle.crt</string>
<string name="client_config" translatable="false">cc_config.xml</string>
<string name="auth_file_name" translatable="false">gui_rpc_auth.cfg</string>
......
<?xml version="1.0" encoding="utf-8"?><!--
This file is part of BOINC.
http://boinc.berkeley.edu
Copyright (C) 2019 University of California
Copyright (C) 2020 University of California
BOINC is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License
......@@ -395,7 +395,7 @@
<string name="about_name">BOINC</string>
<string name="about_version">Version</string>
<string name="about_name_long">Berkeley Open Infrastructure for Network Computing</string>
<string name="about_copyright">\u00A9 2003&#8211;2019 University of California, Berkeley.</string>
<string name="about_copyright">\u00A9 2003&#8211;2020 University of California, Berkeley.</string>
<string name="about_copyright_reserved">All Rights Reserved.</string>
<string name="about_credits">Thanks to the Max Planck Institute for Gravitational Physics, IBM Corporation and HTC
Corporation for their support.
......
......@@ -3,7 +3,7 @@ set -e
# This file is part of BOINC.
# http://boinc.berkeley.edu
# Copyright (C) 2018 University of California
# Copyright (C) 2020 University of California
#
# BOINC is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License
......@@ -19,7 +19,7 @@ set -e
# along with BOINC. If not, see <http://www.gnu.org/licenses/>.
#
export OPENSSL_VERSION=1.0.2q
export OPENSSL_VERSION=1.0.2s
export CURL_VERSION=7.62.0
export NDK_VERSION=18b
......
......@@ -58,7 +58,6 @@ if [ -n "$COMPILEBOINC" ]; then
cd android
mkdir -p "BOINC/app/src/main/assets"
cp "$BOINC/stage/usr/local/bin/boinc" "BOINC/app/src/main/assets/armeabi-v7a/boinc"
cp "$BOINC/stage/usr/local/bin/boinccmd" "BOINC/app/src/main/assets/armeabi-v7a/boinccmd"
cp "$BOINC/win_build/installerv2/redist/all_projects_list.xml" "BOINC/app/src/main/assets/all_projects_list.xml"
cp "$BOINC/curl/ca-bundle.crt" "BOINC/app/src/main/assets/ca-bundle.crt"
......
......@@ -58,7 +58,6 @@ if [ -n "$COMPILEBOINC" ]; then
cd android
mkdir -p "BOINC/app/src/main/assets"
cp "$BOINC/stage/usr/local/bin/boinc" "BOINC/app/src/main/assets/arm64-v8a/boinc"
cp "$BOINC/stage/usr/local/bin/boinccmd" "BOINC/app/src/main/assets/arm64-v8a/boinccmd"
cp "$BOINC/win_build/installerv2/redist/all_projects_list.xml" "BOINC/app/src/main/assets/all_projects_list.xml"
cp "$BOINC/curl/ca-bundle.crt" "BOINC/app/src/main/assets/ca-bundle.crt"
......
......@@ -58,7 +58,6 @@ if [ -n "$COMPILEBOINC" ]; then
cd android
mkdir -p "BOINC/app/src/main/assets"
cp "$BOINC/stage/usr/local/bin/boinc" "BOINC/app/src/main/assets/x86/boinc"
cp "$BOINC/stage/usr/local/bin/boinccmd" "BOINC/app/src/main/assets/x86/boinccmd"
cp "$BOINC/win_build/installerv2/redist/all_projects_list.xml" "BOINC/app/src/main/assets/all_projects_list.xml"
cp "$BOINC/curl/ca-bundle.crt" "BOINC/app/src/main/assets/ca-bundle.crt"
......
......@@ -58,7 +58,6 @@ if [ -n "$COMPILEBOINC" ]; then
cd android
mkdir -p "BOINC/app/src/main/assets"
cp "$BOINC/stage/usr/local/bin/boinc" "BOINC/app/src/main/assets/x86_64/boinc"
cp "$BOINC/stage/usr/local/bin/boinccmd" "BOINC/app/src/main/assets/x86_64/boinccmd"
cp "$BOINC/win_build/installerv2/redist/all_projects_list.xml" "BOINC/app/src/main/assets/all_projects_list.xml"
cp "$BOINC/curl/ca-bundle.crt" "BOINC/app/src/main/assets/ca-bundle.crt"
......
......@@ -5,7 +5,7 @@ matrix:
fast_finish: true
platform:
# - Win32
- Win32
- x64
pull_requests:
......@@ -66,6 +66,7 @@ environment:
depends_path: C:\projects\boinc_depends_win_vs2013
BINTRAY_API_KEY:
secure: kZI9k0Kh2bFSCbXfkz+J16fGNAee1ToRMl10D8QPQsKpC2PqhF/uVMpd6gRC+OSI
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma2 -mx=9 -ms=on"
cache:
- C:\projects\boinc_depends_win_vs2013 -> appveyor.yml, win_build\load_dependencies.bat
......@@ -73,10 +74,10 @@ cache:
before_build:
- call win_build\load_dependencies.bat %depends_git_path% %depends_path% %platform% %configuration%
- if %TOOLCHAIN_VERSION%==12.0 call "%VS120COMNTOOLS%\vsvars32.bat"
- rmdir /S /Q %localappdata%\Microsoft\VisualStudio\%TOOLCHAIN_VERSION%\ComponentModelCache
- if %TOOLCHAIN_VERSION%==12.0 call rmdir /S /Q %localappdata%\Microsoft\VisualStudio\%TOOLCHAIN_VERSION%\ComponentModelCache
build_script:
- devenv %solution_name% /Build "%configuration%|%platform%"
- msbuild %solution_name% /p:Configuration=%configuration%;Platform=%platform%
after_build:
- call deploy\prepare_deployment.bat
......
......@@ -251,6 +251,17 @@ int ACCT_MGR_OP::do_rpc(ACCT_MGR_INFO& _ami, bool _via_gui) {
}
gstate.time_stats.write(mf, true);
gstate.net_stats.write(mf);
#ifndef SIM
// send task descriptions if requested by AM
//
if (ami.send_tasks_all || ami.send_tasks_active) {
mf.printf("<results>\n");
gstate.write_tasks_gui(mf, !ami.send_tasks_all);
mf.printf("</results>\n");
}
#endif
fprintf(f, "</acct_mgr_request>\n");
fclose(f);
snprintf(buf, sizeof(buf), "%srpc.php", ami.master_url);
......@@ -388,6 +399,8 @@ int ACCT_MGR_OP::parse(FILE* f) {
safe_strcpy(ami.opaque, "");
ami.no_project_notices = false;
ami.dynamic = false;
ami.send_tasks_all = false;
ami.send_tasks_active = false;
rss_feeds.clear();
if (!xp.parse_start("acct_mgr_reply")) return ERR_XML_PARSE;
while (!xp.get_tag()) {
......@@ -416,6 +429,8 @@ int ACCT_MGR_OP::parse(FILE* f) {
if (xp.parse_string("error_msg", error_str)) continue;
if (xp.parse_double("repeat_sec", repeat_sec)) continue;
if (xp.parse_bool("dynamic", ami.dynamic)) continue;
if (xp.parse_bool("send_tasks_active", ami.send_tasks_active)) continue;
if (xp.parse_bool("send_tasks_all", ami.send_tasks_all)) continue;
if (xp.parse_string("message", message)) {
msg_printf(NULL, MSG_INFO, "Account manager: %s", message.c_str());
continue;
......@@ -627,6 +642,8 @@ void ACCT_MGR_OP::handle_reply(int http_op_retval) {
safe_strcpy(gstate.acct_mgr_info.authenticator, ami.authenticator);
gstate.acct_mgr_info.no_project_notices = ami.no_project_notices;
gstate.acct_mgr_info.dynamic = ami.dynamic;
gstate.acct_mgr_info.send_tasks_active = ami.send_tasks_active;
gstate.acct_mgr_info.send_tasks_all = ami.send_tasks_all;
// process projects
//
......@@ -724,6 +741,10 @@ void ACCT_MGR_OP::handle_reply(int http_op_retval) {
} else {
// here we don't already have the project.
//
if (acct.detach || (acct.detach_when_done.present && acct.detach_when_done.value)) {
continue;
}
retval = check_string_signature2(
acct.url.c_str(), acct.url_signature, ami.signing_key, verified
);
......@@ -741,32 +762,30 @@ void ACCT_MGR_OP::handle_reply(int http_op_retval) {
continue;
}
// Attach to it, unless the acct mgr is telling us to detach
// Attach to it
//
if (!acct.detach && !(acct.detach_when_done.present && acct.detach_when_done.value)) {
msg_printf(NULL, MSG_INFO,
"Attaching to %s", acct.url.c_str()
);
gstate.add_project(
acct.url.c_str(), acct.authenticator.c_str(), "", true
);
pp = gstate.lookup_project(acct.url.c_str());
if (pp) {
for (int j=0; j<MAX_RSC; j++) {
pp->no_rsc_ams[j] = acct.no_rsc[j];
}
if (acct.dont_request_more_work.present) {
pp->dont_request_more_work = acct.dont_request_more_work.value;
}
if (acct.suspend.present && acct.suspend.value) {
pp->suspend();
}
} else {
msg_printf(NULL, MSG_INTERNAL_ERROR,
"Failed to add project: %s",
acct.url.c_str()
);
msg_printf(NULL, MSG_INFO,
"Attaching to %s", acct.url.c_str()
);
gstate.add_project(
acct.url.c_str(), acct.authenticator.c_str(), "", true
);
pp = gstate.lookup_project(acct.url.c_str());
if (pp) {
for (int j=0; j<MAX_RSC; j++) {
pp->no_rsc_ams[j] = acct.no_rsc[j];
}
if (acct.dont_request_more_work.present) {
pp->dont_request_more_work = acct.dont_request_more_work.value;
}
if (acct.suspend.present && acct.suspend.value) {
pp->suspend();
}
} else {
msg_printf(NULL, MSG_INTERNAL_ERROR,
"Failed to add project: %s",
acct.url.c_str()
);
}
}
}
......@@ -937,6 +956,8 @@ void ACCT_MGR_INFO::clear() {
starved_rpc_backoff = 0;
starved_rpc_min_time = 0;
dynamic = false;
send_tasks_active = false;
send_tasks_all = false;
}
ACCT_MGR_INFO::ACCT_MGR_INFO() {
......
......@@ -31,6 +31,11 @@
// represents an account manager account to which
// we're attached or potentially attached.
// Info stored in acct_mgr_url.xml and acct_mgr_login.xml
//
// If you add stuff here, add code to
// - ACCT_MGR_INFO::clear()
// - ACCT_MGR_OP::parse()
// - ACCT_MGR_OP::handle_reply()
struct ACCT_MGR_INFO : PROJ_AM {
// the following used to be std::string but there
......@@ -61,6 +66,8 @@ struct ACCT_MGR_INFO : PROJ_AM {
// in AM RPCs (used for "farm management")
bool no_project_notices;
// if set, don't show notices from projects
bool send_tasks_all;
bool send_tasks_active;
// TODO: get rid of the following here and in the manager
bool cookie_required;
......
......@@ -843,6 +843,16 @@ int ACTIVE_TASK::start(bool test) {
pid = process_info.dwProcessId;
process_handle = process_info.hProcess;
CloseHandle(process_info.hThread); // thread handle is not used
#ifdef _WIN64
// if host has multiple processor groups (i.e. > 64 processors)
// see which one was used for this job, and show it
//
if (log_flags.task_debug && gstate.host_info.n_processor_groups > 0) {
int i = get_processor_group(process_handle);
msg_printf(wup->project, MSG_INFO, "[task_debug] task is running in processor group %d", i);
}
#endif
#elif defined(__EMX__)
char* argv[100];
......
......@@ -426,7 +426,7 @@ int main(int argc, char** argv) {
}
} else if (!strcmp(cmd, "--set_host_info")) {
HOST_INFO h;
h.clear();
h.clear_host_info();
char* pn = next_arg(argc, argv, i);
safe_strcpy(h.product_name, pn);
retval = rpc.set_host_info(h);
......
......@@ -128,6 +128,7 @@ CLIENT_STATE::CLIENT_STATE()
safe_strcpy(client_brand, "");
exit_after_app_start_secs = 0;
app_started = 0;
cmdline_dir = false;
exit_before_upload = false;
run_test_app = false;
#ifndef _WIN32
......@@ -953,9 +954,6 @@ bool CLIENT_STATE::poll_slow_events() {
static bool tasks_restarted = false;
static bool first=true;
double old_now = now;
#ifdef __APPLE__
double idletime;
#endif
set_now();
......@@ -989,12 +987,8 @@ bool CLIENT_STATE::poll_slow_events() {
#ifdef ANDROID
user_active = device_status.user_active;
#else
user_active = !host_info.users_idle(
check_all_logins, global_prefs.idle_time_to_run
#ifdef __APPLE__
, &idletime
#endif
);
long idle_time = host_info.user_idle_time(check_all_logins);
user_active = idle_time < global_prefs.idle_time_to_run * 60;
#endif
if (user_active != old_user_active) {
......@@ -1021,7 +1015,7 @@ bool CLIENT_STATE::poll_slow_events() {
// If screensaver started client, this code tells client
// to exit when user becomes active, accounting for all these factors.
//
if (started_by_screensaver && (idletime < 30) && (getppid() == 1)) {
if (started_by_screensaver && (idle_time < 30) && (getppid() == 1)) {
// pid is 1 if parent has exited
requested_exit = true;
}
......
......@@ -228,6 +228,8 @@ struct CLIENT_STATE {
// if nonzero, exit this many seconds after starting an app
double app_started;
// when the most recent app was started
bool cmdline_dir;
// data dir was specified on cmdline
// --------------- acct_mgr.cpp:
ACCT_MGR_INFO acct_mgr_info;
......
......@@ -332,8 +332,8 @@ int CLIENT_STATE::parse_account_files() {
if (!f) continue;
project = new PROJECT;
// Assume master_url_fetch_pending, sched_rpc_pending are
// true until we read client_state.xml
// Assume we need to fetch master file and do sched RPC
// unless client_state.xml says otherwise
//
project->master_url_fetch_pending = true;
project->sched_rpc_pending = RPC_REASON_INIT;
......@@ -427,10 +427,10 @@ int CLIENT_STATE::parse_statistics_files() {
DirScanner dir(".");
while (dir.scan(name)) {
PROJECT temp;
if (is_statistics_file(name.c_str())) {
f = boinc_fopen(name.c_str(), "r");
if (!f) continue;
PROJECT temp;
retval = temp.parse_statistics(f);
fclose(f);
if (retval) {
......@@ -542,6 +542,8 @@ int CLIENT_STATE::add_project(
safe_strcpy(project->authenticator, auth);
safe_strcpy(project->project_name, project_name);
project->attached_via_acct_mgr = attached_via_acct_mgr;
project->master_url_fetch_pending = true;
project->sched_rpc_pending = RPC_REASON_INIT;
retval = project->write_account_file();
if (retval) {
......
......@@ -311,7 +311,13 @@ void CLIENT_STATE::check_if_need_benchmarks() {
if (diff < 0) {
run_cpu_benchmarks = true;
} else if (diff > BENCHMARK_PERIOD) {
msg_printf(NULL, MSG_INFO, "Last benchmark was %s ago", timediff_format(diff).c_str());
if (host_info.p_calculated) {
msg_printf(NULL, MSG_INFO,
"Last CPU benchmark was %s ago", timediff_format(diff).c_str()
);
} else {
msg_printf(NULL, MSG_INFO, "No CPU benchmark yet");
}
run_cpu_benchmarks = true;
}
}
......@@ -584,4 +590,5 @@ void CLIENT_STATE::cpu_benchmarks_set_defaults() {
if (!host_info.p_iops) host_info.p_iops = DEFAULT_IOPS;
if (!host_info.p_membw) host_info.p_membw = DEFAULT_MEMBW;
if (!host_info.m_cache) host_info.m_cache = DEFAULT_CACHE;
host_info.p_calculated = now;
}
......@@ -21,9 +21,6 @@
#ifdef _WIN32
#include "boinc_win.h"
#ifdef _MSC_VER
#define chdir _chdir
#endif
#else
#include "config.h"
#include <cstdio>
......@@ -154,6 +151,7 @@ void CLIENT_STATE::parse_cmdline(int argc, char** argv) {
perror("chdir");
exit(1);
}
cmdline_dir = true;
}
} else if (ARG(exit_after_app_start)) {
if (i == argc-1) show_options = true;
......
......@@ -769,7 +769,6 @@ void RSS_FEED::delete_files() {
RSS_FEED_OP::RSS_FEED_OP() {
error_num = BOINC_SUCCESS;
rfp = NULL;
gui_http = &gstate.gui_http;
}
......@@ -785,7 +784,7 @@ bool RSS_FEED_OP::poll() {
if (gstate.now > rf.next_poll_time) {
rf.next_poll_time = gstate.now + rf.poll_interval;
rf.feed_file_name(file_name, sizeof(file_name));
rfp = &rf;
canceled = false;
if (log_flags.notice_debug) {
msg_printf(0, MSG_INFO,
"[notice] start fetch from %s", rf.url
......@@ -806,7 +805,17 @@ void RSS_FEED_OP::handle_reply(int http_op_retval) {
char file_name[256];
int nitems;
if (!rfp) return; // op was canceled
if (canceled) return; // op was canceled
RSS_FEED* rfp = rss_feeds.lookup_url(gui_http->http_op.m_url);
if (!rfp) {
if (log_flags.notice_debug) {
msg_printf(0, MSG_INFO,
"[notice] RSS feed %s not found", rfp->url
);
}
return;
}
if (http_op_retval) {
if (log_flags.notice_debug) {
......@@ -965,11 +974,11 @@ void RSS_FEEDS::update_feed_list() {
} else {
// cancel op if active
//
if (rss_feed_op.rfp == &(*iter)) {
if (!strcmp(rss_feed_op.gui_http->http_op.m_url, rf.url)) {
if (rss_feed_op.gui_http->is_busy()) {
gstate.http_ops->remove(&rss_feed_op.gui_http->http_op);
}
rss_feed_op.rfp = NULL;
rss_feed_op.canceled = true;
}
if (log_flags.notice_debug) {
msg_printf(0, MSG_INFO,
......
......@@ -122,7 +122,7 @@ struct RSS_FEED {