*** empty log message ***

svn path=/trunk/boinc/; revision=5911
This commit is contained in:
David Anderson 2005-04-21 05:48:00 +00:00
parent 615982f0b4
commit 709ef2675c
7 changed files with 10 additions and 148 deletions

View File

@ -27480,3 +27480,13 @@ David 20 April 2005
update_forum_activities.php
user/
forum_rate.php
David 20 April 2005
- removed residual CORE_VERSION stuff
db/
boinc_db.C,h
sched/
db_dump.C
handle_request.C
sched_shmem.C,h

View File

@ -47,7 +47,6 @@ static struct random_init {
#define UNESCAPE(x) unescape_string(x, sizeof(x))
void PLATFORM::clear() {memset(this, 0, sizeof(*this));}
void CORE_VERSION::clear() {memset(this, 0, sizeof(*this));}
void APP::clear() {memset(this, 0, sizeof(*this));}
void APP_VERSION::clear() {memset(this, 0, sizeof(*this));}
void USER::clear() {memset(this, 0, sizeof(*this));}
@ -63,8 +62,6 @@ void SCHED_RESULT_ITEM::clear() {memset(this, 0, sizeof(*this));}
DB_PLATFORM::DB_PLATFORM(DB_CONN* dc) :
DB_BASE("platform", dc?dc:&boinc_db){}
DB_CORE_VERSION::DB_CORE_VERSION(DB_CONN* dc) :
DB_BASE("core_version", dc?dc:&boinc_db){}
DB_APP::DB_APP(DB_CONN* dc) :
DB_BASE("app", dc?dc:&boinc_db){}
DB_APP_VERSION::DB_APP_VERSION(DB_CONN* dc) :
@ -93,7 +90,6 @@ DB_SCHED_RESULT_ITEM_SET::DB_SCHED_RESULT_ITEM_SET(DB_CONN* dc) :
DB_BASE_SPECIAL(dc?dc:&boinc_db){}
int DB_PLATFORM::get_id() {return id;}
int DB_CORE_VERSION::get_id() {return id;}
int DB_APP::get_id() {return id;}
int DB_APP_VERSION::get_id() {return id;}
int DB_USER::get_id() {return id;}
@ -123,27 +119,6 @@ void DB_PLATFORM::db_parse(MYSQL_ROW &r) {
deprecated=atol(r[i++]);
}
void DB_CORE_VERSION::db_print(char* buf) {
sprintf(buf,
"create_time=%d, version_num=%d, platformid=%d, "
"xml_doc='%s', message='%s', deprecated=%d",
create_time, version_num, platformid,
xml_doc, message, deprecated?1:0
);
}
void DB_CORE_VERSION::db_parse(MYSQL_ROW &r) {
int i=0;
clear();
id=atol(r[i++]);
create_time = atoi(r[i++]);
version_num = atoi(r[i++]);
platformid = atoi(r[i++]);
strcpy2(xml_doc, r[i++]);
strcpy2(message, r[i++]);
deprecated = atoi(r[i++]);
}
void DB_APP::db_print(char* buf){
sprintf(buf,
"create_time=%d, name='%s', min_version=%d, "

View File

@ -56,22 +56,6 @@ struct PLATFORM {
void clear();
};
// A version of the core client
//
struct CORE_VERSION {
int id;
int create_time;
int version_num;
int platformid;
char xml_doc[LARGE_BLOB_SIZE]; // a <file_info> for the download file
char message[256]; // if we get a request from this version,
// send this message
bool deprecated; // if we get a request from this version,
// don't send it any work.
void clear();
};
// An application.
//
struct APP {
@ -504,14 +488,6 @@ public:
void db_parse(MYSQL_ROW &row);
};
class DB_CORE_VERSION : public DB_BASE, public CORE_VERSION {
public:
DB_CORE_VERSION(DB_CONN* p=0);
int get_id();
void db_print(char*);
void db_parse(MYSQL_ROW &row);
};
class DB_APP : public DB_BASE, public APP {
public:
DB_APP(DB_CONN* p=0);

View File

@ -523,43 +523,7 @@ void write_team(TEAM& team, FILE* f, bool detail) {
);
}
void core_versions(char* dir) {
char buf[256];
sprintf(buf, "%s/core_versions.xml", dir);
ZFILE f("core_versions", false);
f.open(buf);
DB_PLATFORM platform;
while (!platform.enumerate("order by name")) {
DB_CORE_VERSION core_version;
char query_buf[256];
sprintf(query_buf, "where platformid=%d order by version_num desc", platform.id);
if (!core_version.enumerate(query_buf)) {
char url[256] = "";
parse_str(core_version.xml_doc, "<url>", url, sizeof(url));
fprintf(f.f,
" <core_version>\n"
" <id>%d</id>\n"
" <platform id=\"%d\" name=\"%s\">%s</platform>\n"
" <version>%d</version>\n"
" <create_time>%d</create_time>\n"
" <url>%s</url>\n"
" </core_version>\n",
core_version.id,
platform.id, platform.name, platform.user_friendly_name,
core_version.version_num,
core_version.create_time,
url
);
}
}
f.close();
}
int print_app(FILE* f, APP& app) {
fprintf(f, " <application>\n");
fprintf(f, " <name>%s</name>\n", app.user_friendly_name);
@ -827,7 +791,6 @@ int main(int argc, char** argv) {
}
tables_file(spec.output_dir);
core_versions(spec.output_dir);
sprintf(buf, "cp %s %s/db_dump.xml", spec_filename, spec.output_dir);
system(buf);

View File

@ -857,30 +857,6 @@ void handle_msgs_to_host(SCHEDULER_REPLY& reply) {
}
}
#if 0
void notify_if_newer_core_version(
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply,
PLATFORM& platform, SCHED_SHMEM& ss
) {
CORE_VERSION* cvp;
int req_version;
if (sreq.core_client_major_version != BOINC_MAJOR_VERSION) {
return;
}
req_version = sreq.core_client_major_version*100 + sreq.core_client_minor_version;
cvp = ss.lookup_core_version(platform.id);
if (cvp && cvp->version_num > req_version) {
sprintf(reply.message,
"A new version (%d.%02d) of the BOINC core client is available from this project's web site.",
cvp->version_num/100,
cvp->version_num%100
);
strcpy(reply.message_priority, "low");
}
}
#endif
void process_request(
SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply, SCHED_SHMEM& ss,
char* code_sign_key

View File

@ -42,12 +42,10 @@ void SCHED_SHMEM::init() {
platform_size = sizeof(PLATFORM);
app_size = sizeof(APP);
app_version_size = sizeof(APP_VERSION);
core_version_size = sizeof(CORE_VERSION);
wu_result_size = sizeof(WU_RESULT);
max_platforms = MAX_PLATFORMS;
max_apps = MAX_APPS;
max_app_versions = MAX_APP_VERSIONS;
max_core_versions = MAX_CORE_VERSIONS;
max_wu_results = MAX_WU_RESULTS;
nwu_results = MAX_WU_RESULTS;
}
@ -57,12 +55,10 @@ int SCHED_SHMEM::verify() {
if (platform_size != sizeof(PLATFORM)) return ERR_SCHED_SHMEM;
if (app_size != sizeof(APP)) return ERR_SCHED_SHMEM;
if (app_version_size != sizeof(APP_VERSION)) return ERR_SCHED_SHMEM;
if (core_version_size != sizeof(CORE_VERSION)) return ERR_SCHED_SHMEM;
if (wu_result_size != sizeof(WU_RESULT)) return ERR_SCHED_SHMEM;
if (max_platforms != MAX_PLATFORMS) return ERR_SCHED_SHMEM;
if (max_apps != MAX_APPS) return ERR_SCHED_SHMEM;
if (max_app_versions != MAX_APP_VERSIONS) return ERR_SCHED_SHMEM;
if (max_core_versions != MAX_CORE_VERSIONS) return ERR_SCHED_SHMEM;
if (max_wu_results != MAX_WU_RESULTS) return ERR_SCHED_SHMEM;
return 0;
}
@ -92,7 +88,6 @@ int SCHED_SHMEM::scan_tables() {
DB_PLATFORM platform;
DB_APP app;
DB_APP_VERSION app_version;
DB_CORE_VERSION core_version;
int n;
n = 0;
@ -127,16 +122,6 @@ int SCHED_SHMEM::scan_tables() {
}
napp_versions = n;
n = 0;
while (!core_version.enumerate()) {
if (core_version.version_num/100 != BOINC_MAJOR_VERSION) continue;
if (core_version.deprecated) continue;
core_versions[n++] = core_version;
if (n == MAX_CORE_VERSIONS) {
overflow("core_versions", "MAX_CORE_VERSIONS");
}
}
ncore_versions = n;
return 0;
}
@ -183,23 +168,6 @@ APP_VERSION* SCHED_SHMEM::lookup_app_version(
return best_avp;
}
#if 0
// find the latest core version for a given platform
//
CORE_VERSION* SCHED_SHMEM::lookup_core_version(int platformid) {
CORE_VERSION* cvp, *best=0;
int i;
for (i=0; i<ncore_versions; i++) {
cvp = &core_versions[i];
if (!best || cvp->version_num > best->version_num) {
best = cvp;
}
}
return best;
}
#endif
bool SCHED_SHMEM::no_work(int pid) {
int i;

View File

@ -32,7 +32,6 @@
#define MAX_PLATFORMS 50
#define MAX_APPS 10
#define MAX_APP_VERSIONS 50
#define MAX_CORE_VERSIONS 50
// If you increase this above 100,
// you may exceed the max shared-memory segment size
@ -64,7 +63,6 @@ struct SCHED_SHMEM {
int platform_size; // sizeof(PLATFORM)
int app_size; // sizeof(APP)
int app_version_size; // sizeof(APP_VERSION)
int core_version_size; // sizeof(CORE_VERSION)
int wu_result_size; // sizeof(WU_RESULT)
int nplatforms;
int napps;
@ -79,7 +77,6 @@ struct SCHED_SHMEM {
PLATFORM platforms[MAX_PLATFORMS];
APP apps[MAX_APPS];
APP_VERSION app_versions[MAX_APP_VERSIONS];
CORE_VERSION core_versions[MAX_CORE_VERSIONS];
WU_RESULT wu_results[MAX_WU_RESULTS];
void init();
@ -91,9 +88,6 @@ struct SCHED_SHMEM {
APP* lookup_app(int);
APP_VERSION* lookup_app_version(int appid, int platform, int version);
#if 0
CORE_VERSION* lookup_core_version(int platform);
#endif
PLATFORM* lookup_platform(char*);
};