- parse_str(): remove unnecessary checks

- client: allow app_info.xml to have multiple versions

lib/
    parse.C
client/
    client_state.C
    scheduler_op.C

svn path=/trunk/boinc/; revision=12930
This commit is contained in:
David Anderson 2007-06-13 19:54:24 +00:00
parent 05226427dd
commit 53c7492299
5 changed files with 16 additions and 8 deletions

View File

@ -6224,3 +6224,13 @@ David 13 June 2007
handle_request.C
api/
boinc_api.C
David 13 June 2007
- parse_str(): remove unnecessary checks
- client: allow app_info.xml to have multiple versions
lib/
parse.C
client/
client_state.C
scheduler_op.C

View File

@ -618,15 +618,17 @@ WORKUNIT* CLIENT_STATE::lookup_workunit(PROJECT* p, const char* name) {
return 0;
}
APP_VERSION* CLIENT_STATE::lookup_app_version(APP* app, char* platform, int version_num) {
APP_VERSION* CLIENT_STATE::lookup_app_version(
APP* app, char* platform, int version_num
) {
for (unsigned int i=0; i<app_versions.size(); i++) {
APP_VERSION* avp = app_versions[i];
if (avp->app != app) continue;
if (version_num != avp->version_num) continue;
if (app->project->anonymous_platform) {
return avp;
}
if (strcmp(avp->platform, platform)) continue;
if (version_num != avp->version_num) continue;
return avp;
}
return 0;

View File

@ -320,7 +320,6 @@ int SCHEDULER_OP::parse_master_file(PROJECT* p, vector<std::string> &urls) {
//
char* q = buf;
while (q && parse_str(q, "<scheduler>", str)) {
strip_whitespace(str);
push_unique(str, urls);
q = strstr(q, "</scheduler>");
if (q) q += strlen("</scheduler>");
@ -334,6 +333,7 @@ int SCHEDULER_OP::parse_master_file(PROJECT* p, vector<std::string> &urls) {
if (n == 1) {
char* q = strchr(buf2, '\"');
if (q) *q = 0;
strip_whitespace(buf2);
str = string(buf2);
push_unique(str, urls);
}

View File

@ -29,7 +29,7 @@ $biomed = array(
),
array(
"Predictor@home",
"http://predictor.scripps.edu",
"http://predictor.scripps.edu/",
"Scripps Research Institute",
"Biology",
"Protein structure prediction starts from a sequence of amino acids and attempts to predict the folded, functioning, form of the protein. Predicting the structure of an unknown protein is a critical problem in enabling structure-based drug design to treat new and existing diseases.",

View File

@ -84,10 +84,6 @@ bool parse_str(const char* buf, const char* tag, char* dest, int destlen) {
char tempbuf[1024];
int len;
// sanity check on NULL and empty cases.
if (!buf || !tag || !strlen(tag))
return false;
p = strstr(buf, tag);
if (!p) return false;
p = strchr(p, '>');