diff --git a/checkin_notes b/checkin_notes index 0719fa489f..d7e929353b 100755 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/html/user/index.php b/html/user/index.php index c0c7e880ed..573f15a391 100644 --- a/html/user/index.php +++ b/html/user/index.php @@ -33,6 +33,7 @@ if (project_is_stopped()) {
  • Getting started
  • Create account
  • Applications +
  • Download debugging files

    Returning participants

    diff --git a/html/user/team_join_form.php b/html/user/team_join_form.php index 87e708c90b..17817b8675 100644 --- a/html/user/team_join_form.php +++ b/html/user/team_join_form.php @@ -18,12 +18,10 @@ $id = $_GET["id"]; $team_id = $team->id; page_head("Join $team_name"); echo "

    Join $team_name

    -

    Please note before joining or switching to a team: +

    Please note:


    diff --git a/html/user/team_quit_form.php b/html/user/team_quit_form.php index d0711bf687..baa191064e 100644 --- a/html/user/team_quit_form.php +++ b/html/user/team_quit_form.php @@ -25,19 +25,11 @@ $id = $_GET["id"]; echo ""; echo "

    Please note before quitting a team:"; echo "

    "; - - if ($team->nusers <= 1) { - echo "

    You are the only member of this team."; - echo "

    "; - } - echo "

    "; echo "
    "; echo ""; diff --git a/sched/handle_request.C b/sched/handle_request.C index 0fc6695325..952533ec6a 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -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= 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; diff --git a/sched/server_types.C b/sched/server_types.C index a812644d8c..f1d9832fa3 100644 --- a/sched/server_types.C +++ b/sched/server_types.C @@ -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, "")) return 0; + if (parse_str(buf, "", app_name, 256)) continue; + if (parse_int(buf, "", 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)) continue; else if (parse_int(buf, "", rpc_seqno)) continue; else if (parse_str(buf, "", platform_name, sizeof(platform_name))) continue; + else if (match_tag(buf, "")) { + while (fgets(buf, 256, fin)) { + if (match_tag(buf, "")) break; + if (match_tag(buf, "")) { + CLIENT_APP_VERSION cav; + cav.parse(fin); + client_app_versions.push_back(cav); + } + } + continue; + } else if (parse_int(buf, "", core_client_major_version)) continue; else if (parse_int(buf, "", core_client_minor_version)) continue; else if (parse_int(buf, "", work_req_seconds)) continue; diff --git a/sched/server_types.h b/sched/server_types.h index 50d216a8b5..6ea106c8ab 100644 --- a/sched/server_types.h +++ b/sched/server_types.h @@ -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_versions; HOST host; vector 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,