mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=10704
This commit is contained in:
parent
07ef4f5b0f
commit
4ca4984d88
|
@ -7768,3 +7768,11 @@ David 20 July 2006
|
|||
client/
|
||||
app_control.C
|
||||
log_flags.C,h
|
||||
|
||||
David 20 July 2006
|
||||
- core client: fix crashing if client state file has
|
||||
<project_files> for a project with no account file.
|
||||
Also shuffled logic of state file parsing to reduce indentation
|
||||
|
||||
client/
|
||||
cs_statefile.C
|
||||
|
|
|
@ -117,7 +117,15 @@ int CLIENT_STATE::parse_state_file() {
|
|||
} else if (match_tag(buf, "<app>")) {
|
||||
APP* app = new APP;
|
||||
retval = app->parse(mf);
|
||||
if (project && project->anonymous_platform) {
|
||||
if (!project) {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Application %s outside project in state file",
|
||||
app->name
|
||||
);
|
||||
delete app;
|
||||
continue;
|
||||
}
|
||||
if (project->anonymous_platform) {
|
||||
delete app;
|
||||
continue;
|
||||
}
|
||||
|
@ -126,8 +134,8 @@ int CLIENT_STATE::parse_state_file() {
|
|||
"Can't parse application in state file"
|
||||
);
|
||||
delete app;
|
||||
} else {
|
||||
if (project) {
|
||||
continue;
|
||||
}
|
||||
retval = link_app(project, app);
|
||||
if (retval) {
|
||||
msg_printf(project, MSG_ERROR,
|
||||
|
@ -135,29 +143,29 @@ int CLIENT_STATE::parse_state_file() {
|
|||
app->name
|
||||
);
|
||||
delete app;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
apps.push_back(app);
|
||||
}
|
||||
} else {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Application %s outside project in state file",
|
||||
app->name
|
||||
);
|
||||
delete app;
|
||||
}
|
||||
}
|
||||
} else if (match_tag(buf, "<file_info>")) {
|
||||
FILE_INFO* fip = new FILE_INFO;
|
||||
retval = fip->parse(mf, false);
|
||||
if (!project) {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"File info outside project in state file"
|
||||
);
|
||||
delete fip;
|
||||
continue;
|
||||
}
|
||||
if (retval) {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Can't handle file info in state file"
|
||||
);
|
||||
delete fip;
|
||||
} else {
|
||||
if (project) {
|
||||
continue;
|
||||
}
|
||||
retval = link_file_info(project, fip);
|
||||
if (project->anonymous_platform && retval == ERR_NOT_UNIQUE) {
|
||||
delete fip;
|
||||
continue;
|
||||
}
|
||||
if (retval) {
|
||||
|
@ -166,7 +174,8 @@ int CLIENT_STATE::parse_state_file() {
|
|||
fip->name
|
||||
);
|
||||
delete fip;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
file_infos.push_back(fip);
|
||||
// If the file had a failure before,
|
||||
// don't start another file transfer
|
||||
|
@ -177,7 +186,6 @@ int CLIENT_STATE::parse_state_file() {
|
|||
fip->pers_file_xfer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (fip->pers_file_xfer) {
|
||||
retval = fip->pers_file_xfer->init(fip, fip->upload_when_present);
|
||||
if (retval) {
|
||||
|
@ -194,18 +202,17 @@ int CLIENT_STATE::parse_state_file() {
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"File info outside project in state file"
|
||||
);
|
||||
delete fip;
|
||||
}
|
||||
}
|
||||
} else if (match_tag(buf, "<app_version>")) {
|
||||
APP_VERSION* avp = new APP_VERSION;
|
||||
retval = avp->parse(mf);
|
||||
if (project && project->anonymous_platform) {
|
||||
if (!project) {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Application version outside project in state file"
|
||||
);
|
||||
delete avp;
|
||||
continue;
|
||||
}
|
||||
if (project->anonymous_platform) {
|
||||
delete avp;
|
||||
continue;
|
||||
}
|
||||
|
@ -214,60 +221,61 @@ int CLIENT_STATE::parse_state_file() {
|
|||
"Can't parse appliation version in state file"
|
||||
);
|
||||
delete avp;
|
||||
} else {
|
||||
if (project) {
|
||||
continue;
|
||||
}
|
||||
retval = link_app_version(project, avp);
|
||||
if (retval) {
|
||||
msg_printf(project, MSG_ERROR,
|
||||
"Can't handle application version in state file"
|
||||
);
|
||||
delete avp;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
app_versions.push_back(avp);
|
||||
}
|
||||
} else {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Application version outside project in state file"
|
||||
);
|
||||
delete avp;
|
||||
}
|
||||
}
|
||||
} else if (match_tag(buf, "<workunit>")) {
|
||||
WORKUNIT* wup = new WORKUNIT;
|
||||
retval = wup->parse(mf);
|
||||
if (!project) {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Workunit outside project in state file"
|
||||
);
|
||||
delete wup;
|
||||
continue;
|
||||
}
|
||||
if (retval) {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Can't parse workunit in state file"
|
||||
);
|
||||
delete wup;
|
||||
} else {
|
||||
if (project) {
|
||||
continue;
|
||||
}
|
||||
retval = link_workunit(project, wup);
|
||||
if (retval) {
|
||||
msg_printf(project, MSG_ERROR,
|
||||
"Can't handle workunit in state file"
|
||||
);
|
||||
delete wup;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
workunits.push_back(wup);
|
||||
}
|
||||
} else {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Workunit outside project in state file"
|
||||
);
|
||||
delete wup;
|
||||
}
|
||||
}
|
||||
} else if (match_tag(buf, "<result>")) {
|
||||
RESULT* rp = new RESULT;
|
||||
retval = rp->parse_state(mf);
|
||||
if (!project) {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Task %s outside project in state file",
|
||||
rp->name
|
||||
);
|
||||
delete rp;
|
||||
continue;
|
||||
}
|
||||
if (retval) {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Can't parse task in state file"
|
||||
);
|
||||
delete rp;
|
||||
} else {
|
||||
if (project) {
|
||||
continue;
|
||||
}
|
||||
retval = link_result(project, rp);
|
||||
if (retval) {
|
||||
msg_printf(project, MSG_ERROR,
|
||||
|
@ -275,20 +283,18 @@ int CLIENT_STATE::parse_state_file() {
|
|||
rp->name
|
||||
);
|
||||
delete rp;
|
||||
} else {
|
||||
results.push_back(rp);
|
||||
}
|
||||
} else {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Task %s outside project in state file",
|
||||
rp->name
|
||||
);
|
||||
delete rp;
|
||||
}
|
||||
}
|
||||
} else if (match_tag(buf, "<project_files>")) {
|
||||
project->parse_project_files(f);
|
||||
continue;
|
||||
}
|
||||
results.push_back(rp);
|
||||
} else if (match_tag(buf, "<project_files>")) {
|
||||
if (!project) {
|
||||
msg_printf(NULL, MSG_ERROR,
|
||||
"Project files outside project in state file"
|
||||
);
|
||||
skip_unrecognized(buf, f);
|
||||
continue;
|
||||
}
|
||||
project->parse_project_files(f);
|
||||
} else if (match_tag(buf, "<host_info>")) {
|
||||
retval = host_info.parse(mf);
|
||||
if (retval) {
|
||||
|
|
Loading…
Reference in New Issue