- API: add result name to APP_INFO_DATA structure (for Volpex)

- scheduler: add max_download_urls_per_file config option
    (to limit the length of workunit.xml_doc,
    which is currently capped at 64KB).
    From Bernd.

svn path=/trunk/boinc/; revision=22082
This commit is contained in:
David Anderson 2010-07-30 21:43:23 +00:00
parent a70b54953d
commit e0cea31781
9 changed files with 68 additions and 21 deletions

View File

@ -5642,3 +5642,18 @@ Rom 30 Jul 2010
client/
net_stats.cpp
sysmon_win.cpp
David 30 Jul 2010
- API: add result name to APP_INFO_DATA structure (for Volpex)
- scheduler: add max_download_urls_per_file config option
(to limit the length of workunit.xml_doc,
which is currently capped at 64KB).
From Bernd.
client/
app_start.cpp
lib/
app_ipc.cpp,h
sched/
sched_timezone.cpp
sched_config.cpp,h

View File

@ -220,6 +220,7 @@ int ACTIVE_TASK::write_app_init_file() {
strcpy(aid.authenticator, wup->project->authenticator);
aid.slot = slot;
strcpy(aid.wu_name, wup->name);
strcpy(aid.result_name, result->name);
aid.user_total_credit = wup->project->user_total_credit;
aid.user_expavg_credit = wup->project->user_expavg_credit;
aid.host_total_credit = wup->project->host_total_credit;

View File

@ -4,7 +4,7 @@ require_once("spoken_languages.php");
require_once("help_db.php");
require_once("../html/inc/translation.inc");
page_head("Live help via Internet phone or email");
page_head("Live help via Skype or email");
echo "
<p>

View File

@ -35,13 +35,22 @@ if (($target == "advanced") && version_compare($version, "5.10.0", ">=")) {
}
} else if (($target == "simple") && version_compare($version, "6.2.0", ">=")) {
if ($controlid == "6024") {
// "Show info about BOINC" item on Mac simple-view menu
//
header('Location: http://boinc.berkeley.edu');
} else if ($controlid == "6025") {
// "Show info about BOINC manager" item on Mac simple-view menu
//
header('Location: http://boinc.berkeley.edu/wiki/Simple_view');
} else if ($controlid == "6035") {
// "Show info about BOINC and BOINC Manager"
// item on Mac simple-view menu ?? do we need this item?
//
header('Location: http://boinc.berkeley.edu/wiki/BOINC_Help');
} else {
header('Location: http://boinc.berkeley.edu/wiki/Simple_view');
// the question-mark button
//
header('Location: http://boinc.berkeley.edu/wiki/BOINC_Help');
}
} else if ($target == "advanced_preferences") {
header('Location: http://boinc.berkeley.edu/wiki/Preferences');

View File

@ -86,6 +86,7 @@ void APP_INIT_DATA::copy(const APP_INIT_DATA& a) {
memcpy(project_dir, a.project_dir, 256);
memcpy(boinc_dir, a.boinc_dir, 256);
memcpy(wu_name, a.wu_name, 256);
memcpy(result_name, a.result_name, 256);
memcpy(authenticator, a.authenticator, 256);
memcpy(&shmem_seg_name, &a.shmem_seg_name, sizeof(SHMEM_SEG_NAME));
@ -169,6 +170,9 @@ int write_init_data_file(FILE* f, APP_INIT_DATA& ai) {
if (strlen(ai.wu_name)) {
fprintf(f, "<wu_name>%s</wu_name>\n", ai.wu_name);
}
if (strlen(ai.result_name)) {
fprintf(f, "<result_name>%s</result_name>\n", ai.result_name);
}
#ifdef _WIN32
if (strlen(ai.shmem_seg_name)) {
fprintf(f, "<comm_obj_name>%s</comm_obj_name>\n", ai.shmem_seg_name);
@ -234,6 +238,7 @@ void APP_INIT_DATA::clear() {
strcpy(project_dir, "");
strcpy(boinc_dir, "");
strcpy(wu_name, "");
strcpy(result_name, "");
strcpy(authenticator, "");
slot = 0;
user_total_credit = 0;
@ -324,6 +329,7 @@ int parse_init_data_file(FILE* f, APP_INIT_DATA& ai) {
if (xp.parse_str(tag, "boinc_dir", ai.boinc_dir, sizeof(ai.boinc_dir))) continue;
if (xp.parse_str(tag, "authenticator", ai.authenticator, sizeof(ai.authenticator))) continue;
if (xp.parse_str(tag, "wu_name", ai.wu_name, sizeof(ai.wu_name))) continue;
if (xp.parse_str(tag, "result_name", ai.result_name, sizeof(ai.result_name))) continue;
#ifdef _WIN32
if (xp.parse_str(tag, "comm_obj_name", ai.shmem_seg_name, sizeof(ai.shmem_seg_name))) continue;
#else

View File

@ -160,6 +160,7 @@ struct APP_INIT_DATA {
char project_dir[256];
char boinc_dir[256];
char wu_name[256];
char result_name[256];
char authenticator[256];
int slot;
double user_total_credit;

View File

@ -248,6 +248,7 @@ int SCHED_CONFIG::parse(FILE* f) {
if (xp.parse_double(tag, "reliable_max_error_rate", reliable_max_error_rate)) continue;
if (xp.parse_double(tag, "reliable_reduced_delay_bound", reliable_reduced_delay_bound)) continue;
if (xp.parse_str(tag, "replace_download_url_by_timezone", replace_download_url_by_timezone, sizeof(replace_download_url_by_timezone))) continue;
if (xp.parse_int(tag, "max_download_urls_per_file", max_download_urls_per_file)) continue;
if (xp.parse_int(tag, "report_max", report_max)) continue;
if (xp.parse_bool(tag, "request_time_stats_log", request_time_stats_log)) continue;
if (xp.parse_bool(tag, "resend_lost_results", resend_lost_results)) continue;

View File

@ -140,6 +140,7 @@ struct SCHED_CONFIG {
double reliable_reduced_delay_bound;
// Reduce the delay bounds for reliable hosts by this percent
char replace_download_url_by_timezone[256];
int max_download_urls_per_file;
int report_max;
bool request_time_stats_log;
bool resend_lost_results;

View File

@ -148,7 +148,7 @@ URLTYPE* read_download_list() {
"File %s contained no valid entries!\n"
"Format of this file is one or more lines containing:\n"
"TIMEZONE_OFFSET_IN_SEC http://some.url.path\n",
download_servers
download_servers
);
free(cached);
return NULL;
@ -172,8 +172,9 @@ URLTYPE* read_download_list() {
// return number of bytes written, or <0 to indicate an error
//
int make_download_list(char *buffer, char *path, int tz) {
char *start=buffer;
int make_download_list(char *buffer, char *path, unsigned int lim, int tz) {
char *start = buffer;
unsigned int l,len = 0;
int i;
// global variable used in the compare() function
@ -185,16 +186,19 @@ int make_download_list(char *buffer, char *path, int tz) {
// print list of servers in sorted order.
// Space is to format them nicely
//
for (i=0; strlen(serverlist[i].name); i++) {
start+=sprintf(start, "%s<url>%s%s</url>", i?"\n ":"", serverlist[i].name, path);
for (i=0;
strlen(serverlist[i].name) && (config.max_download_urls_per_file ?(i < config.max_download_urls_per_file) :true);
i++
) {
l = sprintf(start, "%s<url>%s%s</url>", i?"\n ":"", serverlist[i].name, path);
len += l;
if (len >= lim) {
*start = '\0';
return (start-buffer);
}
start += l;
}
// make a second copy in the same order
//
for (i=0; strlen(serverlist[i].name); i++) {
start+=sprintf(start, "%s<url>%s%s</url>", "\n ", serverlist[i].name, path);
}
return (start-buffer);
}
@ -202,8 +206,9 @@ int make_download_list(char *buffer, char *path, int tz) {
//
int add_download_servers(char *old_xml, char *new_xml, int tz) {
char *p, *q, *r;
p=r=old_xml;
int total_free = BLOB_SIZE - strlen(old_xml);
p = (r = old_xml);
// search for next URL to do surgery on
while ((q=strstr(p, "<url>"))) {
@ -212,7 +217,7 @@ int add_download_servers(char *old_xml, char *new_xml, int tz) {
char *s;
char path[1024];
int len = q-p;
int len = q-p;
// copy everything from p to q to new_xml
//
@ -221,7 +226,7 @@ int add_download_servers(char *old_xml, char *new_xml, int tz) {
// locate next instance of </url>
//
if (!(r=strstr(q, "</url>"))) {
if (!(r = strstr(q, "</url>"))) {
return 1;
}
r += strlen("</url>");
@ -235,19 +240,27 @@ int add_download_servers(char *old_xml, char *new_xml, int tz) {
// check if path contains the string specified in config.xml
//
if (!(s=strstr(path,config.replace_download_url_by_timezone))) {
if (!(s = strstr(path,config.replace_download_url_by_timezone))) {
// if it doesn't, just copy the whole tag as it is
strncpy(new_xml, q, r-q);
new_xml += r-q;
p=r;
} else {
// calculate free space available for URL replaces
int lim = total_free - (len - (p - old_xml));
// find end of the specified replace string,
// i.e. start of the 'path'
s += strlen(config.replace_download_url_by_timezone);
// insert new download list in place of the original single URL
//
len = make_download_list(new_xml, s, tz);
if (len<0) {
len = make_download_list(new_xml, s, lim, tz);
if (len == 0) {
// if the replacement would exceed the maximum XML length,
// just keep the original URL
len = r-q;
strncpy(new_xml, q, len);
} else if (len < 0) {
return 1;
}
new_xml += len;