diff --git a/checkin_notes b/checkin_notes index 31462417ae..0d664cc2f5 100755 --- a/checkin_notes +++ b/checkin_notes @@ -23202,3 +23202,14 @@ David 24 Jan 2005 lib/ proxy_info.C + +Rom 24 Jan 2005 + - When the server requests a delay, make sure we do not overwrite + the min_rpc_time, which has already been set to the proper + delay time. + + client/ + cs_scheduler.C + scheduler_op.C + lib/ + error_numbers.h diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index 3f7dda60aa..b2568a2821 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -515,17 +515,18 @@ int CLIENT_STATE::handle_scheduler_reply( fclose(f); if (retval) return retval; - if (sr.request_delay) { - double x = dtime() + sr.request_delay; - if (x > project->min_rpc_time) project->min_rpc_time = x; - } - if (strlen(sr.message)) { sprintf(buf, "Message from server: %s", sr.message); int prio = (!strcmp(sr.message_priority, "high"))?MSG_ERROR:MSG_INFO; show_message(project, buf, prio); } + if (sr.request_delay) { + double x = dtime() + sr.request_delay; + if (x > project->min_rpc_time) project->min_rpc_time = x; + return ERR_SERVER_REQ_DELAY; + } + // if project is down, return error (so that we back off) // and don't do anything else // diff --git a/client/scheduler_op.C b/client/scheduler_op.C index 498e0301df..dbee907540 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -497,6 +497,12 @@ bool SCHEDULER_OP::poll() { project->min_rpc_time = 0; } break; + case ERR_SERVER_REQ_DELAY: + // The server has requested a backoff of a specified + // amount, so lets honor it by not resetting the + // project->min_rpc_time value. + project->nrpc_failures = 0; + break; case ERR_PROJECT_DOWN: backoff(project, "Project is down"); break; diff --git a/lib/error_numbers.h b/lib/error_numbers.h index 540bfe211f..fb6209afc1 100755 --- a/lib/error_numbers.h +++ b/lib/error_numbers.h @@ -143,3 +143,6 @@ #define ERR_NO_APP_VERSION -195 #define ERR_WU_USER_RULE -196 #define ERR_ABORTED_VIA_GUI -197 +#define ERR_SERVER_REQ_DELAY -198 + // The server has requested a delay, so don't + // modify min_rpc_time diff --git a/lib/proxy_info.C b/lib/proxy_info.C index 1696b1f2d5..6be2a3118a 100644 --- a/lib/proxy_info.C +++ b/lib/proxy_info.C @@ -17,13 +17,13 @@ // or write to the Free Software Foundation, Inc., // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#include -using std::string; - #ifdef _WIN32 #include "boinc_win.h" #endif +#include +using std::string; + #include "parse.h" #include "proxy_info.h"