mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=5182
This commit is contained in:
parent
ea20f063c8
commit
cc63aaf090
|
@ -23096,3 +23096,20 @@ Rom 20 Jan 2005 (boinc)
|
|||
- Tag for 4.60 release, all platforms
|
||||
boinc_core_release_4_60
|
||||
|
||||
David 20 Jan 2005
|
||||
- Add external_ip_addr field to host table.
|
||||
This is the REMOTE_ADDR reported by Apache
|
||||
when the host contacts the scheduler.
|
||||
May be different from the IP address reported by the host
|
||||
(e.g. if the host is behind a NAT)
|
||||
|
||||
NOTE: project must update their databases
|
||||
(html/ops/db_update.php, update_1_20a_2005())
|
||||
to use this code.
|
||||
|
||||
db/
|
||||
boinc_db.C,h
|
||||
html/ops/
|
||||
db_update.php
|
||||
sched/
|
||||
handle_request.C
|
||||
|
|
|
@ -359,7 +359,7 @@ void DB_HOST::db_print(char* buf){
|
|||
"credit_per_cpu_sec=%.15e, "
|
||||
"venue='%s', nresults_today=%d, "
|
||||
"avg_turnaround=%f, "
|
||||
"host_cpid='%s' ",
|
||||
"host_cpid='%s', external_ip_addr='%s' ",
|
||||
create_time, userid,
|
||||
rpc_seqno, rpc_time,
|
||||
total_credit, expavg_credit, expavg_time,
|
||||
|
@ -376,7 +376,7 @@ void DB_HOST::db_print(char* buf){
|
|||
credit_per_cpu_sec,
|
||||
venue, nresults_today,
|
||||
avg_turnaround,
|
||||
host_cpid
|
||||
host_cpid, external_ip_addr
|
||||
);
|
||||
UNESCAPE(domain_name);
|
||||
UNESCAPE(serialnum);
|
||||
|
@ -430,6 +430,7 @@ void DB_HOST::db_parse(MYSQL_ROW &r) {
|
|||
nresults_today = atoi(r[i++]);
|
||||
avg_turnaround = atof(r[i++]);
|
||||
strcpy2(host_cpid, r[i++]);
|
||||
strcpy2(external_ip_addr, r[i++]);
|
||||
}
|
||||
|
||||
void DB_WORKUNIT::db_print(char* buf){
|
||||
|
|
|
@ -214,7 +214,7 @@ struct HOST {
|
|||
int timezone; // hours difference from GMT
|
||||
char domain_name[256];
|
||||
char serialnum[256];
|
||||
char last_ip_addr[256]; // IP address as of last RPC
|
||||
char last_ip_addr[256]; // internal IP address as of last RPC
|
||||
int nsame_ip_addr; // # of RPCs with same IP address
|
||||
|
||||
double on_frac; // Fraction of time (0-1) that BOINC is running
|
||||
|
@ -262,6 +262,7 @@ struct HOST {
|
|||
int nresults_today; // results sent since midnight
|
||||
double avg_turnaround; // recent average result turnaround time
|
||||
char host_cpid[256]; // host cross-project ID
|
||||
char external_ip_addr[256]; // IP address seen by scheduler
|
||||
|
||||
int parse(FILE*);
|
||||
int parse_time_stats(FILE*);
|
||||
|
|
|
@ -168,6 +168,7 @@ create table host (
|
|||
nresults_today integer not null,
|
||||
avg_turnaround double not null,
|
||||
host_cpid varchar(254),
|
||||
external_ip_addr varchar(254),
|
||||
|
||||
primary key (id)
|
||||
) type=InnoDB;
|
||||
|
|
|
@ -237,6 +237,10 @@ function update_1_20_2005() {
|
|||
mysql_query("alter table host add host_cpid varchar(254)");
|
||||
}
|
||||
|
||||
function update_1_20a_2005() {
|
||||
mysql_query("alter table host add external_ip_addr varchar(254)");
|
||||
}
|
||||
|
||||
//update_10_25_2004();
|
||||
|
||||
?>
|
||||
|
|
|
@ -265,6 +265,11 @@ static int update_host_record(HOST& xhost, USER& user) {
|
|||
sprintf(buf, "%s%s", host.host_cpid, user.email_addr);
|
||||
md5_block((const unsigned char*)buf, strlen(buf), host.host_cpid);
|
||||
}
|
||||
|
||||
char* p = getenv("REMOTE_ADDR");
|
||||
if (p) {
|
||||
strlcpy(host.external_ip_addr, p, sizeof(host.external_ip_addr));
|
||||
}
|
||||
retval = host.update();
|
||||
if (retval) {
|
||||
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "host.update() failed: %d\n", retval);
|
||||
|
|
Loading…
Reference in New Issue