Skip to content

Commit

Permalink
master URL
Browse files Browse the repository at this point in the history
svn path=/trunk/boinc/; revision=127
  • Loading branch information
davidpanderson committed Jun 21, 2002
1 parent 155adaf commit 25eaeae
Show file tree
Hide file tree
Showing 41 changed files with 877 additions and 413 deletions.
52 changes: 52 additions & 0 deletions checkin_notes
Original file line number Diff line number Diff line change
Expand Up @@ -522,3 +522,55 @@ Eric H June 20, 2002
win_main.cpp (changed from win_main.C)
windows_cpp.h

David A June 20 2002
- Replaced the "accounts.xml" file with the user preferences ("prefs.xml").
All non-host-specific project info is stored in this file;
all host-specific project info is in client_state.xml.
The PROJECT class is a union of the two.
The logic for dealing with inconsistencies between
prefs.xml and client_state.xml, and with updating in-memory
and on-disk project lists in response to an update from a server,
are a little tricky and are described in the code.
- The prefs file can be overwritten by <preferences> in a scheduling
server reply. To prevent buggy servers from zeroing out
users' project lists, the client makes sure there's at least
one project, and backs up the old prefs.xml into a timestamped file.
- The command-line client, if prefs.xml is absent,
prompts the user for a project URL and authenticator,
and creates an initial prefs.xml.
- Each project now has a "master URL", with is its home page
and also contains <scheduler> elements giving the URLs of
its scheduling servers.
- Added a class SCHEDULER_OP which encapsulates fetching and
parsing a project's master page (if necessary),
then making an RPC to one of its scheduling servers.
TODO: add retry and failure logic.
- A project can have more than one scheduling server.
TODO: use all of them.
- Project directories are stored in URL-encoded form.
This allows project master URLs to have slashes, which is a necessity.

client/
Makefile.in
accounts.C,h (deleted)
app.C,h
client_state.C,h
client_types.C,h
cs_apps.C
cs_scheduler.C
file_names.C,h
main.C
prefs.C,h
scheduler_op.C,h (new)
scheduler_reply.C,h (deleted)
doc/
project.html
lib/
parse.C,h
sched/
server_types.C
test/
account1.xml, account2.xml (deleted)
init.inc
prefs1.xml, prefs2.xml (new)
test_*.php
3 changes: 1 addition & 2 deletions client/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ PROGS = $(CLIENT_PROG) test_net_xfer test_http test_file_xfer
all: $(PROGS)

OBJS = \
accounts.o \
app.o \
client_state.o \
client_types.o \
Expand All @@ -36,7 +35,7 @@ OBJS = \
net_stats.o \
net_xfer.o \
prefs.o \
scheduler_reply.o \
scheduler_op.o \
speed_stats.o \
time_stats.o \
util.o \
Expand Down
57 changes: 0 additions & 57 deletions client/accounts.C

This file was deleted.

35 changes: 0 additions & 35 deletions client/accounts.h

This file was deleted.

16 changes: 8 additions & 8 deletions client/app.C
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void parse_command_line(char* p, char** argv) {
static void print_argv(char** argv) {
int i;
for (i=0; argv[i]; i++) {
printf("argv[%d]: %s\n", i, argv[i]);
fprintf(stderr, "argv[%d]: %s\n", i, argv[i]);
}
}

Expand Down Expand Up @@ -495,13 +495,13 @@ int ACTIVE_TASK_SET::restart_tasks() {
int ACTIVE_TASK::write(FILE* fout) {
fprintf(fout,
"<active_task>\n"
" <project_domain>%s</project_domain>\n"
" <project_master_url>%s</project_master_url>\n"
" <result_name>%s</result_name>\n"
" <app_version_num>%d</app_version_num>\n"
" <slot>%d</slot>\n"
" <cpu_time>%f</cpu_time>\n"
"</active_task>\n",
result->project->domain,
result->project->master_url,
result->name,
app_version->version_num,
slot,
Expand All @@ -511,20 +511,20 @@ int ACTIVE_TASK::write(FILE* fout) {
}

int ACTIVE_TASK::parse(FILE* fin, CLIENT_STATE* cs) {
char buf[256], result_name[256], project_domain[256];
char buf[256], result_name[256], project_master_url[256];
int app_version_num=0;
PROJECT* project;

strcpy(result_name, "");
strcpy(project_domain, "");
strcpy(project_master_url, "");
cpu_time = 0;
while (fgets(buf, 256, fin)) {
if (match_tag(buf, "</active_task>")) {
project = cs->lookup_project(project_domain);
project = cs->lookup_project(project_master_url);
if (!project) {
fprintf(stderr,
"ACTIVE_TASK::parse(): project not found: %s\n",
project_domain
project_master_url
);
return -1;
}
Expand All @@ -544,7 +544,7 @@ int ACTIVE_TASK::parse(FILE* fin, CLIENT_STATE* cs) {
return 0;
}
else if (parse_str(buf, "<result_name>", result_name)) continue;
else if (parse_str(buf, "<project_domain>", project_domain)) continue;
else if (parse_str(buf, "<project_master_url>", project_master_url)) continue;
else if (parse_int(buf, "<app_version_num>", app_version_num)) continue;
else if (parse_int(buf, "<slot>", slot)) continue;
else if (parse_double(buf, "<cpu_time>", cpu_time)) continue;
Expand Down
2 changes: 2 additions & 0 deletions client/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include <stdio.h>
#include <vector>

#include "client_types.h"

class CLIENT_STATE;

// The following classes provide an interface for task execution
Expand Down
Loading

0 comments on commit 25eaeae

Please sign in to comment.