*** empty log message ***

svn path=/trunk/boinc/; revision=10624
This commit is contained in:
David Anderson 2006-07-11 22:52:17 +00:00
parent cc5c1189c0
commit 5f6d665ee3
6 changed files with 50 additions and 7 deletions

View File

@ -7448,3 +7448,18 @@ David 11 July 2006
server_types.h
show_shmem.C
validator.C
David 11 July 2006
- core client: fix bug where the first log flag in the
list was getting skipped over.
This was due to a design flaw in the new XML parsing code.
To work around this, I changed the format of
the cc_config.xml file so that options are
enclosed in <options> ... </options>
client/
app.C
cs_statefile.C
log_flags.C,h
lib/
parse.C

View File

@ -452,6 +452,7 @@ int ACTIVE_TASK::parse(MIOFILE& fin) {
else if (parse_double(buf, "<rss_bytes>", x)) continue;
else if (match_tag(buf, "<supports_graphics/>")) continue;
else if (parse_int(buf, "<graphics_mode_acked>", n)) continue;
else if (parse_int(buf, "<scheduler_state>", n)) continue;
else {
if (log_flags.unparsed_xml) {
msg_printf(0, MSG_ERROR,

View File

@ -96,6 +96,8 @@ int CLIENT_STATE::parse_state_file() {
while (fgets(buf, 256, f)) {
if (match_tag(buf, "</client_state>")) {
break;
} else if (match_tag(buf, "<client_state>")) {
continue;
} else if (match_tag(buf, "<project>")) {
PROJECT temp_project;
retval = temp_project.parse_state(mf);

View File

@ -94,6 +94,26 @@ CONFIG::CONFIG() {
save_stats_days = 30;
}
int CONFIG::parse_options(FILE* f) {
char tag[256], contents[1024];
while (get_tag(f, tag, contents)) {
if (!strcmp(tag, "/options")) {
return 0;
} else if (!strcmp(tag, "save_stats_days")) {
save_stats_days = get_int(contents);
} else if (!strcmp(tag, "dont_check_file_sizes")) {
dont_check_file_sizes = get_bool(contents);
} else if (!strcmp(tag, "ncpus")) {
ncpus = get_int(contents);
} else {
msg_printf(NULL, MSG_ERROR, "Unparsed tag in %s: %s\n",
CONFIG_FILE, tag
);
}
}
return ERR_XML_PARSE;
}
int CONFIG::parse(FILE* f) {
char tag[256], contents[1024];
@ -103,17 +123,13 @@ int CONFIG::parse(FILE* f) {
if (strstr(tag, "?xml")) get_tag(f, tag);
if (strcmp(tag, "cc_config")) return ERR_XML_PARSE;
while (get_tag(f, tag, contents)) {
while (get_tag(f, tag)) {
if (!strcmp(tag, "/cc_config")) return 0;
if (!strcmp(tag, "log_flags")) {
log_flags.parse(f);
continue;
} else if (!strcmp(tag, "save_stats_days")) {
save_stats_days = get_int(contents);
} else if (!strcmp(tag, "dont_check_file_sizes")) {
dont_check_file_sizes = get_bool(contents);
} else if (!strcmp(tag, "ncpus")) {
ncpus = get_int(contents);
} else if (!strcmp(tag, "options")) {
parse_options(f);
} else {
msg_printf(NULL, MSG_ERROR, "Unparsed tag in %s: %s\n",
CONFIG_FILE, tag

View File

@ -73,6 +73,7 @@ struct CONFIG {
int ncpus;
CONFIG();
int parse(FILE*);
int parse_options(FILE*);
};
extern LOG_FLAGS log_flags;

View File

@ -408,6 +408,14 @@ int skip_unrecognized(char* buf, FILE* in) {
}
// Get next XML element or tag.
//
// NOTE: this can't be used for XML docs that have
// nested elements and data elements at the same level, i.e.
// <foo>
// <bar>1</bar>
// </foo>
// <blah>asdf</blah>
//
// If it's a close tag, or the contents pointer is NULL, just return the tag.
// Otherwise return the contents also.
//