diff --git a/checkin_notes b/checkin_notes index 94c5214bba..af111eaf8e 100644 --- a/checkin_notes +++ b/checkin_notes @@ -818,3 +818,16 @@ David 16 Feb 2011 html/user/ pm.php + +David 16 Feb 2011 + - client: fix work-fetch bug. + The change in [21877] caused tasks in "download stalled" state + to be skipped in RR simulation, + and therefore to not be counted in the work buffer. + However, "download stalled" was not being evaluated correctly; + it was considering only per-file backoff, not project-wide backoff. + - client: another work-fetch bug: + don't fetch work from a project in project-wide download backoff. + + client/ + client_types.cpp diff --git a/client/client_types.cpp b/client/client_types.cpp index 650c21d56c..6e2915162e 100644 --- a/client/client_types.cpp +++ b/client/client_types.cpp @@ -1969,6 +1969,9 @@ void RESULT::clear_uploaded_flags() { bool PROJECT::some_download_stalled() { #ifndef SIM unsigned int i; + + if (!download_backoff.ok_to_transfer()) return true; + for (i=0; ipers_file_xfers.size(); i++) { PERS_FILE_XFER* pfx = gstate.pers_file_xfers->pers_file_xfers[i]; if (pfx->fip->project != this) continue; @@ -1987,9 +1990,11 @@ bool RESULT::some_download_stalled() { unsigned int i; FILE_INFO* fip; PERS_FILE_XFER* pfx; + bool some_file_missing = false; for (i=0; iinput_files.size(); i++) { fip = wup->input_files[i].file_info; + if (fip->status != FILE_PRESENT) some_file_missing = true; pfx = fip->pers_file_xfer; if (pfx && pfx->next_request_time > gstate.now) { return true; @@ -1997,11 +2002,16 @@ bool RESULT::some_download_stalled() { } for (i=0; iapp_files.size(); i++) { fip = avp->app_files[i].file_info; + if (fip->status != FILE_PRESENT) some_file_missing = true; pfx = fip->pers_file_xfer; if (pfx && pfx->next_request_time > gstate.now) { return true; } } + + if (some_file_missing && !project->download_backoff.ok_to_transfer()) { + return true; + } #endif return false; }