*** empty log message ***

svn path=/trunk/boinc/; revision=2927
This commit is contained in:
David Anderson 2004-01-26 19:29:39 +00:00
parent 1f2fc1803b
commit ca54f0c552
7 changed files with 98 additions and 25 deletions

View File

@ -9552,3 +9552,25 @@ David Jan 24 2004
client/win/
boinc_ss.h
boinc_ss.rc
David Jan 26 2004
- server-side support for anonymous platform mechanism
- struct CLIENT_APP_VERSION represents an app version
that an anonymous-platform client says it has
- SCHEDULER_REQUEST has a vector of CLIENT_APP_VERSIONs,
parsed from request message
- in scan_work_array(): if anonymous platform,
instead of checking for an app version in the DB,
check that the client has an app version with an
acceptable version#
NOTE: for this to work you need to add an entry named "anonymous"
to the platform table
html_user/
index.php
team_join_form.php
team_quit_form.php
sched/
handle_request.C
server_types.C,h

View File

@ -33,6 +33,7 @@ if (project_is_stopped()) {
<li><a href=intro.php>Getting started</a>
<li><a href=".URL_BASE."create_account_form.php>Create account</a>
<li><a href=apps.php>Applications</a>
<li><a href=debug.php>Download debugging files</a>
</ul>
<h3>Returning participants</h3>

View File

@ -18,12 +18,10 @@ $id = $_GET["id"];
$team_id = $team->id;
page_head("Join $team_name");
echo "<h2>Join $team_name</h2>
<p><b>Please note before joining or switching to a team:</b>
<p><b>Please note:</b>
<ul>
<li> Your credit will be transferred from your old team (if any)
to the new team.
<li> Joining a team does not affect your account's credit.
<li> Joining a team gives its founder access to your email address.
<li> Joining a team does not affect your account's credit.
</ul>
<hr>
<form method=post action=team_join_action.php>

View File

@ -25,19 +25,11 @@ $id = $_GET["id"];
echo "<tr><td>";
echo "<p><b>Please note before quitting a team:</b>";
echo "<ul>";
echo "<li>By quitting a team you remove your name from the team listing. ";
echo "Your credit contribution to the team is also removed";
echo "<li>Even if you quit a team, you may rejoin later, ";
echo "<li>If you quit a team, you may rejoin later, ";
echo "or join any other team you desire ";
echo "<li>Quitting a team does not affect your personal credit ";
echo "statistics in any way.";
echo "</ul>";
if ($team->nusers <= 1) {
echo "<p><b>You are the only member of this team.</b>";
echo "<ul><li>By quitting the team you will disband it.</li></ul>";
}
echo "</p>";
echo "<hr>";
echo "<form method=post action=team_quit_action.php>";

View File

@ -64,6 +64,22 @@ struct WORK_REQ {
bool no_app_version;
};
bool anonymous(PLATFORM& platform) {
return (!strcmp(platform.name, "anonymous"));
}
bool SCHEDULER_REQUEST::has_version(APP& app) {
unsigned int i;
for (i=0; i<client_app_versions.size(); i++) {
CLIENT_APP_VERSION& cav = client_app_versions[i];
if (!strcmp(cav.app_name, app.name) && cav.version_num >= app.min_version) {
return true;
}
}
return false;
}
// compute the max disk usage we can request of the host
//
double max_allowable_disk(USER& user, SCHEDULER_REQUEST& req) {
@ -252,14 +268,15 @@ int add_wu_to_reply(
// add the app, app_version, and workunit to the reply,
// but only if they aren't already there
//
reply.insert_app_unique(*app);
reply.insert_app_version_unique(*avp);
log_messages.printf(
SchedMessages::DEBUG,
"[HOST#%d] Sending app_version %s %s %d\n",
reply.host.id, app->name, platform.name, avp->version_num
);
if (avp) {
reply.insert_app_unique(*app);
reply.insert_app_version_unique(*avp);
log_messages.printf(
SchedMessages::DEBUG,
"[HOST#%d] Sending app_version %s %s %d\n",
reply.host.id, app->name, platform.name, avp->version_num
);
}
// add time estimate to reply
//
@ -779,10 +796,19 @@ static void scan_work_array(
// Find the app and app_version for the client's platform.
// If none, treat the WU as infeasible
//
found = find_app_version(wreq, wu, platform, ss, app, avp);
if (!found) {
wu_result.infeasible_count++;
continue;
if (anonymous(platform)) {
app = ss.lookup_app(wu.appid);
found = sreq.has_version(*app);
if (!found) {
continue;
}
avp = NULL;
} else {
found = find_app_version(wreq, wu, platform, ss, app, avp);
if (!found) {
wu_result.infeasible_count++;
continue;
}
}
result = wu_result.result;

View File

@ -32,6 +32,17 @@ using namespace std;
#include "server_types.h"
#include "sched_util.h"
int CLIENT_APP_VERSION::parse(FILE* f) {
char buf[256];
while (fgets(buf, 256, f)) {
if (match_tag(buf, "</app_version>")) return 0;
if (parse_str(buf, "<app_name>", app_name, 256)) continue;
if (parse_int(buf, "<version_num>", version_num)) continue;
}
return ERR_XML_PARSE;
}
SCHEDULER_REQUEST::SCHEDULER_REQUEST() {
}
@ -58,6 +69,17 @@ int SCHEDULER_REQUEST::parse(FILE* fin) {
else if (parse_int(buf, "<hostid>", hostid)) continue;
else if (parse_int(buf, "<rpc_seqno>", rpc_seqno)) continue;
else if (parse_str(buf, "<platform_name>", platform_name, sizeof(platform_name))) continue;
else if (match_tag(buf, "<app_versions>")) {
while (fgets(buf, 256, fin)) {
if (match_tag(buf, "</app_versions>")) break;
if (match_tag(buf, "<app_version>")) {
CLIENT_APP_VERSION cav;
cav.parse(fin);
client_app_versions.push_back(cav);
}
}
continue;
}
else if (parse_int(buf, "<core_client_major_version>", core_client_major_version)) continue;
else if (parse_int(buf, "<core_client_minor_version>", core_client_minor_version)) continue;
else if (parse_int(buf, "<work_req_seconds>", work_req_seconds)) continue;

View File

@ -33,6 +33,15 @@ struct TRICKLE_DESC {
int parse(FILE*);
};
// an app version from an anonymous-platform client
//
struct CLIENT_APP_VERSION {
char app_name[256];
int version_num;
int parse(FILE*);
};
struct SCHEDULER_REQUEST {
char authenticator[256];
char platform_name[256];
@ -46,6 +55,8 @@ struct SCHEDULER_REQUEST {
char code_sign_key[MEDIUM_BLOB_SIZE];
double total_disk_usage;
double project_disk_usage;
bool anonymous_platform;
vector<CLIENT_APP_VERSION> client_app_versions;
HOST host;
vector<RESULT> results;
@ -54,6 +65,7 @@ struct SCHEDULER_REQUEST {
SCHEDULER_REQUEST();
~SCHEDULER_REQUEST();
int parse(FILE*);
bool has_version(APP& app);
};
// NOTE: if any field requires initialization,