*** empty log message ***

svn path=/trunk/boinc/; revision=4146
This commit is contained in:
David Anderson 2004-09-02 23:06:14 +00:00
parent 3b81a23326
commit 2bf3f2ef77
5 changed files with 83 additions and 63 deletions

View File

@ -16911,3 +16911,19 @@ Rom 2 Sep 2004
client/
app.C
app_control.C
David 2 Sept 2004
- PERS_FILE_XFER::poll(): don't check file size if it's not specified in FILE_INFO
==> This fixes download failure of user-supplied files
- PROJECT::parse_preferences_for_user_files(): fill in fip->project
==> This fixes a crashing bug when user supplies files
- User-visible test:
change "preempt" to "pause"
change "quit" to "removed from memory"
change "suspend" to "left in memory"
client/
app_control.C
client_types.C
gui_titles.C
pers_file_xfer.C

View File

@ -170,8 +170,8 @@ int ACTIVE_TASK::preempt(bool quit_task) {
scheduler_state = CPU_SCHED_PREEMPTED;
msg_printf(result->project, MSG_INFO,
"Preempting result %s (%s)",
result->name, (quit_task ? "quit" : "suspend")
"Pausing result %s (%s)",
result->name, (quit_task ? "removed from memory" : "left in memory")
);
return 0;
}

View File

@ -180,6 +180,7 @@ int PROJECT::parse_preferences_for_user_files() {
fip = gstate.lookup_file_info(this, filename.c_str());
if (!fip) {
fip = new FILE_INFO;
fip->project = this;
fip->urls.push_back(url_str);
strcpy(fip->name, filename.c_str());
fip->is_user_file = true;

View File

@ -43,5 +43,5 @@ char g_szMiscItems[MAX_MISC_STR][256] = {
"Download failed",
"Upload failed",
"Suspended",
"Preempted"
"Paused"
};

View File

@ -197,20 +197,25 @@ bool PERS_FILE_XFER::poll(time_t now) {
}
}
if (dtime() - last_time <= 2) {
time_so_far += dtime() - last_time;
// don't count suspended periods in total time
//
double diff = dtime() - last_time;
if (diff <= 2) {
time_so_far += diff;
}
last_time = dtime();
if (fxp->file_xfer_done) {
if (fip->nbytes) {
// check if the file was actually downloaded, if not check if there are more urls to try
// if there are no bytes downloaded, than the was probably a wrong url downloaded
get_pathname(fip, pathname);
file_size(pathname, existing_size);
if (existing_size != fip->nbytes) {
check_giveup("File downloaded was not the correct file or was garbage from bad URL");
check_giveup("File downloaded had wrong size");
}
return false;
} else {
}
scope_messages.printf(
"PERS_FILE_XFER::poll(): file transfer status %d",
fxp->file_xfer_retval
@ -260,10 +265,8 @@ bool PERS_FILE_XFER::poll(time_t now) {
delete fxp;
fxp = NULL;
}
return true;
}
}
return false;
}