mirror of https://github.com/BOINC/boinc.git
- scheduler: increase buffer for global prefs from 8K to 64K
- lay the groundwork for changing it to std::string svn path=/trunk/boinc/; revision=24595
This commit is contained in:
parent
9cf4fc76d0
commit
6e1414a07f
|
@ -8462,3 +8462,12 @@ David 14 Nov 2011
|
|||
|
||||
client/
|
||||
log_flags.cpp
|
||||
|
||||
David 14 Nov 2011
|
||||
- scheduler: increase buffer for global prefs from 8K to 64K
|
||||
- lay the groundwork for changing it to std::string
|
||||
|
||||
sched/
|
||||
sched_types.cpp
|
||||
lib/
|
||||
parse.cpp,h
|
||||
|
|
|
@ -963,6 +963,29 @@ int XML_PARSER::element_contents(const char* end_tag, char* buf, int buflen) {
|
|||
return retval;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int XML_PARSER::element_contents(const char* end_tag, string& buf) {
|
||||
int retval=0;
|
||||
while (1) {
|
||||
int c = f->_getc();
|
||||
if (c == EOF) {
|
||||
retval = ERR_XML_PARSE;
|
||||
break;
|
||||
}
|
||||
buf += c;
|
||||
char* p = strstr(buf.c_str(), end_tag);
|
||||
if (p) {
|
||||
int k = strlen(end_tag);
|
||||
int n = buf.length();
|
||||
buf.erase(n-k, k);
|
||||
break;
|
||||
}
|
||||
}
|
||||
strip_whitespace(buf);
|
||||
return retval;
|
||||
}
|
||||
#endif
|
||||
|
||||
// We got an unexpected tag.
|
||||
// If it's an end tag, do nothing.
|
||||
// Otherwise skip until the end tag, if any
|
||||
|
|
|
@ -60,6 +60,7 @@ public:
|
|||
bool parse_ulonglong(const char*, unsigned long long&);
|
||||
bool parse_bool(const char*, bool&);
|
||||
int element_contents(const char*, char*, int);
|
||||
int element_contents(const char*, std::string&);
|
||||
int copy_element(std::string&);
|
||||
void skip_unexpected(const char*, bool verbose, const char*);
|
||||
void skip_unexpected(bool verbose=false, const char* msg="") {
|
||||
|
|
|
@ -280,7 +280,7 @@ const char* SCHEDULER_REQUEST::parse(XML_PARSER& xp) {
|
|||
if (xp.parse_double("duration_correction_factor", host.duration_correction_factor)) continue;
|
||||
if (xp.match_tag("global_preferences")) {
|
||||
strcpy(global_prefs_xml, "<global_preferences>\n");
|
||||
char buf[8192];
|
||||
char buf[BLOB_SIZE];
|
||||
retval = xp.element_contents(
|
||||
"</global_preferences>", buf, sizeof(buf)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue