- client: create and destroy PERS_FILE_XFERs even if network suspended.

This will show pending uploads in the Transfers tab.
- file_upload_handler: fix message to client when can't acquire lock
- client: parse <alt_platform> in state file correctly


svn path=/trunk/boinc/; revision=24391
This commit is contained in:
David Anderson 2011-10-13 19:05:18 +00:00
parent 7c471bf1b3
commit 921b5c50df
6 changed files with 25 additions and 6 deletions

View File

@ -7182,3 +7182,17 @@ David 13 Oct 2011
client/
cs_prefs.cpp
David 13 Oct 2011
- client: create and destroy PERS_FILE_XFERs even if network suspended.
This will show pending uploads in the Transfers tab.
- file_upload_handler: fix message to client when can't acquire lock
- client: parse <alt_platform> in state file correctly
client/
client_stte.cpp
sim.cpp
cs_statefile.cpp
cs_files.cpp
sched/
file_upload_handler.cpp

View File

@ -857,6 +857,7 @@ bool CLIENT_STATE::poll_slow_events() {
POLL_ACTION(gui_http , gui_http.poll );
POLL_ACTION(gui_rpc_http , gui_rpcs.poll );
POLL_ACTION(trickle_up_ops, trickle_up_poll);
POLL_ACTION(handle_pers_file_xfers , handle_pers_file_xfers );
if (!network_suspended && suspend_reason != SUSPEND_REASON_BENCHMARKS) {
// don't initiate network activity if we're doing CPU benchmarks
net_status.poll();
@ -864,7 +865,6 @@ bool CLIENT_STATE::poll_slow_events() {
POLL_ACTION(acct_mgr , acct_mgr_info.poll );
POLL_ACTION(file_xfers , file_xfers->poll );
POLL_ACTION(pers_file_xfers , pers_file_xfers->poll );
POLL_ACTION(handle_pers_file_xfers , handle_pers_file_xfers );
if (!config.no_info_fetch) {
POLL_ACTION(rss_feed_op , rss_feed_op.poll );
}

View File

@ -233,8 +233,9 @@ int FILE_INFO::verify_file(bool strict, bool show_errors) {
}
#ifndef SIM
// scan all FILE_INFOs and PERS_FILE_XFERs.
// start and finish downloads and uploads as needed.
// scan FILE_INFOs and create PERS_FILE_XFERs as needed.
// NOTE: this doesn't start the file transfers
// scan PERS_FILE_XFERs and delete finished ones.
//
bool CLIENT_STATE::handle_pers_file_xfers() {
unsigned int i;

View File

@ -114,6 +114,7 @@ int CLIENT_STATE::parse_state_file_aux(const char* fname) {
int retval=0;
int failnum;
bool btemp;
string stemp;
FILE* f = fopen(fname, "r");
if (!f) return ERR_FOPEN;
@ -438,7 +439,7 @@ int CLIENT_STATE::parse_state_file_aux(const char* fname) {
if (xp.parse_string("platform_name", statefile_platform_name)) {
continue;
}
if (xp.match_tag("alt_platform")) {
if (xp.parse_string("alt_platform", stemp)) {
continue;
}
if (xp.parse_int("user_run_request", retval)) {

View File

@ -1281,7 +1281,6 @@ void do_client_simulation() {
sprintf(buf, "%s%s", config_prefix, CONFIG_FILE);
config.defaults();
read_config_file(true, buf);
config.show();
gstate.add_platform("client simulator");
sprintf(buf, "%s%s", infile_prefix, STATE_FILE_NAME);

View File

@ -131,12 +131,16 @@ int copy_socket_to_file(FILE* in, char* path, double offset, double nbytes) {
// This will prevent OTHER instances of file_upload_handler
// from being able to write to the file.
//
if ((pid=mylockf(fd))) {
pid = mylockf(fd);
if (pid>0) {
close(fd);
return return_error(ERR_TRANSIENT,
"can't lock file %s: %s locked by PID=%d\n",
path, strerror(errno), pid
);
} else if (pid < 0) {
close(fd);
return return_error(ERR_TRANSIENT, "can't lock file %s\n", path);
}
// check that file length corresponds to offset