diff --git a/checkin_notes b/checkin_notes index a85a72a839..f5f570f23f 100755 --- a/checkin_notes +++ b/checkin_notes @@ -22910,3 +22910,15 @@ David 18 Jan 2005 sched/ start + +David 18 Jan 2005 + - added element to SCHED_CONFIG. + Lets the scheduler turn away clients below a certain version + without doing a lot of work + (especially important for locality scheduling) + + doc/ + configuration.php + sched/ + sched_config.C,h + handle_request.C diff --git a/sched/handle_request.C b/sched/handle_request.C index bc6a4e42af..aa03cefe70 100644 --- a/sched/handle_request.C +++ b/sched/handle_request.C @@ -599,12 +599,13 @@ void send_code_sign_key( } } -bool wrong_major_version(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) { - // char buf[256]; +bool wrong_core_client_version( + SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply +) { + bool wrong_version = false; if (sreq.core_client_major_version != BOINC_MAJOR_VERSION) { - //reply.nucleus_only = true; // TODO: check for user-agent not empty and not BOINC - reply.probable_user_browser = true; + wrong_version = true; sprintf(reply.message, "To participate in this project, " "you must use major version %d of the BOINC core client. " @@ -612,13 +613,35 @@ bool wrong_major_version(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) { BOINC_MAJOR_VERSION, sreq.core_client_major_version ); - strcpy(reply.message_priority, "low"); log_messages.printf( SCHED_MSG_LOG::NORMAL, "[HOST#%d] [auth %s] Wrong major version from user: wanted %d, got %d\n", sreq.hostid, sreq.authenticator, BOINC_MAJOR_VERSION, sreq.core_client_major_version ); + } else if (config.min_core_client_version) { + int major = config.min_core_client_version/100; + int minor = config.min_core_client_version % 100; + if (sreq.core_client_minor_version < minor) { + wrong_version = true; + sprintf(reply.message, + "To participate in this project, " + "you must use version %d.02%d or higher of the BOINC core client. " + "Your core client is version %d.02%d.", + major, minor, + sreq.core_client_major_version, sreq.core_client_minor_version + ); + log_messages.printf( + SCHED_MSG_LOG::NORMAL, + "[HOST#%d] [auth %s] Wrong minor version from user: wanted %d, got %d\n", + sreq.hostid, sreq.authenticator, + minor, sreq.core_client_minor_version + ); + } + } + if (wrong_version) { + reply.probable_user_browser = true; + strcpy(reply.message_priority, "low"); reply.request_delay = 3600*24; return true; } @@ -708,7 +731,7 @@ void process_request( // if different major version of BOINC, just send a message // - if (wrong_major_version(sreq, reply)) { + if (wrong_core_client_version(sreq, reply)) { ok_to_send_work = false; // if no results, return without accessing DB diff --git a/sched/sched_config.C b/sched/sched_config.C index 8a30c43450..b4a33e2973 100644 --- a/sched/sched_config.C +++ b/sched/sched_config.C @@ -89,6 +89,7 @@ int SCHED_CONFIG::parse(char* buf) { parse_int(buf, "", uldl_dir_fanout); parse_int(buf, "", locality_scheduling_wait_period); parse_int(buf, "", locality_scheduling_send_timeout); + parse_int(buf, "", min_core_client_version); if (match_tag(buf, "")) { char hostname[256]; gethostname(hostname, 256); diff --git a/sched/sched_config.h b/sched/sched_config.h index f66bf3e76d..02b8ca867f 100644 --- a/sched/sched_config.h +++ b/sched/sched_config.h @@ -58,6 +58,7 @@ public: int uldl_dir_fanout; // fanout of ul/dl dirs; 0 if none int locality_scheduling_wait_period; int locality_scheduling_send_timeout; + int min_core_client_version; int parse(char*); int parse_file(char* dir=".");