*** empty log message ***

svn path=/trunk/boinc/; revision=3375
This commit is contained in:
David Anderson 2004-05-13 04:48:19 +00:00
parent 265315aa8b
commit 6769f9f1e5
6 changed files with 107 additions and 40 deletions

View File

@ -12215,3 +12215,24 @@ David May 11 2004
sched/
handle_request.C
trickle_handler.C
David May 11 2004
- bug fixes in trickle code.
Trickle-ups work correctly.
handle_trickles works correctly.
trickle-downs are getting sent back OK
- client: if scheduler reply gets parse error, backoff project
(fixed bug where we retry every second)
- sched server: if request message doesn't parse,
send an "incomplete request received" reply
(instead of just returning: uh, ????)
- sched server: if request is not asking for work,
don't check min_sendwork_interval or try to send work
(avoid spurious "last RPC too recent" messages)
client/
scheduler_op.C
sched/
handle_request.C
server_types.C,h
trickle_handler.C

21
html/user/html.php Normal file
View File

@ -0,0 +1,21 @@
<?
require_once("../inc/util.inc");
page_head("Allowed HTML tags");
echo "
The following HTML tags are allowed in profiles, messages,
signatures, etc.:
<ul>
<li> &lt;b> (bold)
<li> &lt;i> (italics)
<li> &lt;a> (hyperlink)
<li> &lt;p> (paragraph)
<li> &lt;br> (break)
<li> &lt;pre> (preformatted)
<li> &lt;img> (image; height cannot exceed 450 pixels)
</ul>
";
page_tail();
?>

View File

@ -547,33 +547,40 @@ void handle_trickle_ups(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
TRICKLE_UP_DESC& td = sreq.trickles[i];
sprintf(buf, "where name='%s'", td.result_name);
retval = result.lookup(buf);
if (retval) continue;
if (reply.user.id != result.userid) {
if (retval) {
log_messages.printf(SCHED_MSG_LOG::NORMAL,
"[HOST#%d] trickle up: wrong user ID %d, %d\n",
sreq.host.id, reply.user.id, result.userid
"[HOST#%d] trickle up: no result %s\n",
reply.host.id, td.result_name
);
continue;
}
if (sreq.host.id != result.hostid) {
if (reply.user.id != result.userid) {
log_messages.printf(SCHED_MSG_LOG::NORMAL,
"[HOST#%d] trickle up: wrong user ID %d, %d\n",
reply.host.id, reply.user.id, result.userid
);
continue;
}
if (reply.host.id != result.hostid) {
log_messages.printf(SCHED_MSG_LOG::NORMAL,
"[HOST#%d] trickle up: wrong host ID %d\n",
sreq.host.id, result.hostid
reply.host.id, result.hostid
);
continue;
}
tup.clear();
tup.create_time = time(0);
tup.send_time = td.send_time;
tup.resultid = result.id;
tup.appid = result.appid;
tup.hostid = sreq.hostid;
tup.hostid = reply.host.id;
tup.handled = false;
safe_strcpy(tup.xml, td.trickle_text.c_str());
retval = tup.insert();
if (retval) {
log_messages.printf(SCHED_MSG_LOG::CRITICAL,
"[HOST#%d] trickle insert failed: %d\n",
sreq.host.id, retval
reply.host.id, retval
);
}
}
@ -583,7 +590,7 @@ void handle_trickle_downs(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) {
DB_TRICKLE_DOWN td;
char buf[256];
sprintf(buf, "where hostid = %d", sreq.host.id);
sprintf(buf, "where hostid = %d", reply.host.id);
while (!td.enumerate(buf)) {
reply.trickle_downs.push_back(td);
td.handled = true;
@ -657,23 +664,25 @@ void process_request(
// if last RPC was within config.min_sendwork_interval, don't send work
//
if (config.min_sendwork_interval) {
double diff = dtime() - last_rpc_time;
if (diff < config.min_sendwork_interval) {
ok_to_send = false;
log_messages.printf(
SCHED_MSG_LOG::NORMAL,
"Not sending work - last RPC too recent: %f\n", diff
);
sprintf(reply.message,
"Not sending work - last RPC too recent: %d sec", (int)diff
);
strcpy(reply.message_priority, "low");
reply.request_delay = config.min_sendwork_interval;
if (sreq.work_req_seconds > 0) {
if (config.min_sendwork_interval) {
double diff = dtime() - last_rpc_time;
if (diff < config.min_sendwork_interval) {
ok_to_send = false;
log_messages.printf(
SCHED_MSG_LOG::NORMAL,
"Not sending work - last RPC too recent: %f\n", diff
);
sprintf(reply.message,
"Not sending work - last RPC too recent: %d sec", (int)diff
);
strcpy(reply.message_priority, "low");
reply.request_delay = config.min_sendwork_interval;
}
}
if (ok_to_send) {
send_work(sreq, reply, *platform, ss);
}
}
if (ok_to_send) {
send_work(sreq, reply, *platform, ss);
}
send_code_sign_key(sreq, reply, code_sign_key);
@ -701,13 +710,14 @@ void handle_request(
process_request(sreq, sreply, ss, code_sign_key);
} else {
log_messages.printf(
SCHED_MSG_LOG::NORMAL, "Incomplete request received from IP %s, auth %s, platform %s, version %d.%d\n",
get_remote_addr(), sreq.authenticator, sreq.platform_name,
sreq.core_client_major_version, sreq.core_client_minor_version
SCHED_MSG_LOG::NORMAL,
"Incomplete request received from IP %s, auth %s, platform %s, version %d.%d\n",
get_remote_addr(), sreq.authenticator, sreq.platform_name,
sreq.core_client_major_version, sreq.core_client_minor_version
);
strcpy(sreply.message, "Incomplete request received.");
strcpy(sreply.message_priority, "low");
return;
sreply.nucleus_only = true;
}
sreply.write(fout);

View File

@ -128,7 +128,7 @@ int SCHEDULER_REQUEST::parse(FILE* fin) {
else if (match_tag(buf, "<code_sign_key>")) {
copy_element_contents(fin, "</code_sign_key>", code_sign_key, sizeof(code_sign_key));
}
else if (match_tag(buf, "<trickle>")) {
else if (match_tag(buf, "<trickle_up>")) {
TRICKLE_UP_DESC td;
retval = td.parse(fin);
if (!retval) {
@ -146,13 +146,16 @@ int TRICKLE_UP_DESC::parse(FILE* fin) {
trickle_text = "";
while (fgets(buf, 256, fin)) {
if (match_tag(buf, "</trickle>")) return 0;
if (match_tag(buf, "</trickle_up>")) return 0;
if (parse_int(buf, "<time>", send_time)) continue;
if (parse_str(buf, "<result_name>", result_name, sizeof(result_name))) continue;
if (match_tag(buf, "<text>")) {
while (fgets(buf, 256, fin)) {
if (match_tag(buf, "</text>")) break;
trickle_text += buf;
}
} else {
log_messages.printf(SCHED_MSG_LOG::NORMAL, "TRICKLE_UP_DESC::parse(): unrecognized: %s\n", buf);
}
}
return ERR_XML_PARSE;
@ -215,20 +218,31 @@ int SCHEDULER_REPLY::write(FILE* fout) {
"<user_create_time>%d</user_create_time>\n"
"<host_total_credit>%f</host_total_credit>\n"
"<host_expavg_credit>%f</host_expavg_credit>\n"
"<host_venue>%s</host_venue>\n"
"<email_hash>%s</email_hash>\n"
"<cross_project_id>%s</cross_project_id>\n",
"<host_venue>%s</host_venue>\n",
u2.c_str(),
user.total_credit,
user.expavg_credit,
user.create_time,
host.total_credit,
host.expavg_credit,
host.venue,
email_hash,
user.cross_project_id
host.venue
);
// be paranoid about the following to avoid sending null
//
if (strlen(email_hash)) {
fprintf(fout,
"<email_hash>%s</email_hash>\n",
email_hash
);
}
if (strlen(user.cross_project_id)) {
fprintf(fout,
"<cross_project_id>%s</cross_project_id>\n",
user.cross_project_id
);
}
// might want to send team credit too.
//
if (team.id) {

View File

@ -72,7 +72,8 @@ struct SCHEDULER_REQUEST {
GLOBAL_PREFS global_prefs;
char global_prefs_source_email_hash[MD5_LEN];
HOST host;
HOST host; // request message is parsed into here.
// does NOT contain the full host record.
vector<RESULT> results;
vector<TRICKLE_UP_DESC> trickles;
@ -96,7 +97,7 @@ struct SCHEDULER_REPLY {
bool probable_user_browser;
USER user;
char email_hash[MD5_LEN];
HOST host;
HOST host; // after validation, contains full host rec
TEAM team;
vector<APP> apps;
vector<APP_VERSION> app_versions;

View File

@ -76,7 +76,7 @@ bool do_trickle_scan(APP& app) {
bool found=false;
int retval;
sprintf(buf, "where appid=%d and handled == 0", app.id);
sprintf(buf, "where appid=%d and handled=0", app.id);
while (!tup.enumerate(buf)) {
retval = handle_trickle(tup);
if (!retval) {