From c00f27a5a57e34c683998761c594ac4f727c335e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 26 Apr 2013 12:19:43 -0700 Subject: [PATCH] client: message tweak (show "don't need" in work request msg) --- client/cs_scheduler.cpp | 11 ++--------- client/work_fetch.cpp | 16 +++++++++++++--- client/work_fetch.h | 1 + 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index de2772fed5..484f675674 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -508,13 +508,6 @@ bool CLIENT_STATE::scheduler_rpc_poll() { return false; } -static inline bool requested_work() { - for (int i=0; ilast_rpc_time = now; - if (requested_work()) { + if (work_fetch.requested_work()) { had_or_requested_work = true; } @@ -545,7 +538,7 @@ int CLIENT_STATE::handle_scheduler_reply( if (retval) return retval; if (log_flags.sched_ops) { - if (requested_work()) { + if (work_fetch.requested_work()) { sprintf(buf, ": got %d new tasks", (int)sr.results.size()); } else { strcpy(buf, ""); diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index ebf3d3cd6e..8364da608b 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -452,6 +452,13 @@ void WORK_FETCH::clear_request() { } } +bool WORK_FETCH::requested_work() { + for (int i=0; ipwf.cant_fetch_work_reason = CANT_FETCH_WORK_DONT_NEED; + } } // see if there's a fetchable non-CPU-intensive project without work @@ -858,10 +868,10 @@ void WORK_FETCH::handle_reply( PROJECT* p, SCHEDULER_REPLY*, vector new_results ) { bool got_work[MAX_RSC]; - bool requested_work[MAX_RSC]; + bool requested_work_rsc[MAX_RSC]; for (int i=0; i 0); + requested_work_rsc[i] = (rsc_work_fetch[i].req_secs > 0); } for (unsigned int i=0; irsc_pwf[i].backoff_time < gstate.now) { switch (p->sched_rpc_pending) { case RPC_REASON_RESULTS_DUE: diff --git a/client/work_fetch.h b/client/work_fetch.h index e3249fb097..45438e5dc5 100644 --- a/client/work_fetch.h +++ b/client/work_fetch.h @@ -317,6 +317,7 @@ struct WORK_FETCH { void compute_shares(); void clear_backoffs(APP_VERSION&); void request_string(char*); + bool requested_work(); }; extern RSC_WORK_FETCH rsc_work_fetch[MAX_RSC];