From 9fc8f33c2fae86e3b928580c978a50d3d95deda6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 22 Aug 2002 22:28:51 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=369 --- client/app.C | 16 +++++++++------- client/client_state.C | 2 ++ client/cs_apps.C | 1 + client/cs_files.C | 1 + client/file_xfer.C | 3 +++ client/net_xfer.C | 7 +++++-- client/pers_file_xfer.C | 1 + client/prefs.C | 10 +++++----- client/scheduler_op.C | 8 ++++++-- client/scheduler_op.h | 2 +- 10 files changed, 34 insertions(+), 17 deletions(-) diff --git a/client/app.C b/client/app.C index ac31720699..768431265d 100644 --- a/client/app.C +++ b/client/app.C @@ -380,7 +380,7 @@ int ACTIVE_TASK_SET::insert(ACTIVE_TASK* atp) { // Checks if any child processes have exited and records their final CPU time // bool ACTIVE_TASK_SET::poll() { - ACTIVE_TASK* atp = NULL; + ACTIVE_TASK* atp; char path[256]; int n; @@ -390,10 +390,12 @@ bool ACTIVE_TASK_SET::poll() { FILETIME creation_time, exit_time, kernel_time, user_time; ULARGE_INTEGER tKernel, tUser; LONGLONG totTime; + bool found = false; for (i=0; ipid_handle, &exit_code)) { + found = true; // Get the elapsed CPU time if (GetProcessTimes(atp->pid_handle, &creation_time, &exit_time, &kernel_time, &user_time)) { tKernel.LowPart = kernel_time.dwLowDateTime; @@ -416,14 +418,11 @@ bool ACTIVE_TASK_SET::poll() { atp->exit_status = exit_code; atp->result->exit_status = atp->exit_status; } - } else { - // Not sure what to do here } } - if( atp == NULL ) { - return false; - } + if (log_flags.task_debug && found) printf("ACTIVE_TASK_SET::poll\n"); + return found; #endif #if HAVE_SYS_RESOURCE_H @@ -473,6 +472,7 @@ bool ACTIVE_TASK_SET::poll() { clean_out_dir(atp->dirname); + if (log_flags.task_debug) printf("ACTIVE_TASK_SET::poll\n"); return true; } @@ -639,10 +639,12 @@ bool ACTIVE_TASK_SET::poll_time() { unsigned int i; bool updated = false; - for(i=0; icheck_app_status_files(); } + + if (log_flags.task_debug && updated) printf("ACTIVE_TASK_SET::poll_time\n"); return updated; } diff --git a/client/client_state.C b/client/client_state.C index cbac3800bc..a267698d48 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -700,6 +700,7 @@ bool CLIENT_STATE::garbage_collect() { // TODO: delete obsolete APP_VERSIONs + if (log_flags.state_debug && action) printf("garbage_collect\n"); return action; } @@ -750,6 +751,7 @@ bool CLIENT_STATE::update_results() { } result_iter++; } + if (log_flags.state_debug && action) printf("update_results\n"); return action; } diff --git a/client/cs_apps.C b/client/cs_apps.C index 190383440a..0b3c5af9c9 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -113,6 +113,7 @@ bool CLIENT_STATE::handle_running_apps() { action = true; } } + if (log_flags.task_debug && action) printf("CS::handle_running_apps\n"); return action; } diff --git a/client/cs_files.C b/client/cs_files.C index 87a6afa5c1..0c436857ca 100644 --- a/client/cs_files.C +++ b/client/cs_files.C @@ -127,5 +127,6 @@ bool CLIENT_STATE::handle_pers_file_xfers() { } } + if (log_flags.file_xfer_debug && action) printf("CS::handle_pers_file_xfers\n"); return action; } diff --git a/client/file_xfer.C b/client/file_xfer.C index c79a5ce9de..310045b463 100644 --- a/client/file_xfer.C +++ b/client/file_xfer.C @@ -219,5 +219,8 @@ bool FILE_XFER_SET::poll() { } } } + if (log_flags.file_xfer_debug) { + if (action) printf("FILE_XFER_SET poll true\n"); + } return action; } diff --git a/client/net_xfer.C b/client/net_xfer.C index ab2e8e3c72..8f193207ac 100644 --- a/client/net_xfer.C +++ b/client/net_xfer.C @@ -189,6 +189,9 @@ int NET_XFER_SET::poll(int max_bytes, int& bytes_transferred) { bytes_transferred += n; if (max_bytes < 0) break; } + if (log_flags.net_xfer_debug && bytes_transferred) { + printf("NET_XFER_SET::poll bytes_transferred %d\n", bytes_transferred); + } return 0; } @@ -341,9 +344,9 @@ int NET_XFER::do_xfer(int& nbytes_transferred) { offset = 0; while (nleft) { #ifdef _WIN32 - n = send(socket, buf+offset, nleft, 0); + n = send(socket, buf+offset, nleft, 0); #else - n = write(socket, buf+offset, nleft); + n = write(socket, buf+offset, nleft); #endif if (log_flags.net_xfer_debug) { printf("wrote %d bytes to socket %d\n", n, socket); diff --git a/client/pers_file_xfer.C b/client/pers_file_xfer.C index d7c3f682e9..daf2e77771 100644 --- a/client/pers_file_xfer.C +++ b/client/pers_file_xfer.C @@ -260,6 +260,7 @@ bool PERS_FILE_XFER_SET::poll() { if (action) gstate.set_client_state_dirty("pers_file_xfer_set poll"); + if (log_flags.file_xfer_debug && action) printf("PERS_FILE_XFER_SET::poll\n"); return action; } diff --git a/client/prefs.C b/client/prefs.C index e44246dbfd..743a74a71c 100644 --- a/client/prefs.C +++ b/client/prefs.C @@ -35,11 +35,11 @@ PREFS::PREFS() { dont_run_on_batteries = false; dont_run_if_user_active = false; confirm_before_connecting = false; - high_water_days = false; - low_water_days = false; - disk_max_used_gb = 0; - disk_max_used_pct = 0; - disk_min_free_gb = 0; + high_water_days = 3; + low_water_days = 1; + disk_max_used_gb = 1; + disk_max_used_pct = 0.5; + disk_min_free_gb = 0.1; }; // Parse XML based prefs, usually from prefs.xml diff --git a/client/scheduler_op.C b/client/scheduler_op.C index 47cad896d7..638cf39641 100644 --- a/client/scheduler_op.C +++ b/client/scheduler_op.C @@ -203,16 +203,18 @@ bool SCHEDULER_OP::update_urls(PROJECT& project, vector &urls) { // poll routine. If an operation is in progress, check for completion // -int SCHEDULER_OP::poll() { +bool SCHEDULER_OP::poll() { int retval; vector urls; bool changed, scheduler_op_done; + bool action = false; switch(state) { case SCHEDULER_OP_STATE_GET_MASTER: // here we're fetching the master file for a project // if (http_op.http_op_state == HTTP_STATE_DONE) { + action = true; project->master_url_fetch_pending = false; http_ops->remove(&http_op); if (http_op.http_op_retval == 0) { @@ -263,6 +265,7 @@ int SCHEDULER_OP::poll() { // scheduler_op_done = false; if (http_op.http_op_state == HTTP_STATE_DONE) { + action = true; http_ops->remove(&http_op); if (http_op.http_op_retval) { if (log_flags.sched_op_debug) { @@ -330,7 +333,8 @@ int SCHEDULER_OP::poll() { default: break; } - return 0; + if (log_flags.sched_op_debug && action) printf("SCHEDULER_OP::poll\n); + return action; } SCHEDULER_REPLY::SCHEDULER_REPLY() { diff --git a/client/scheduler_op.h b/client/scheduler_op.h index 5594d29847..7ddde679c2 100644 --- a/client/scheduler_op.h +++ b/client/scheduler_op.h @@ -58,7 +58,7 @@ struct SCHEDULER_OP { unsigned int url_index; // index within project's URL list SCHEDULER_OP(HTTP_OP_SET*); - int poll(); + bool poll(); int init_get_work(); int init_return_results(PROJECT*, double nsecs); int init_op_project(double ns);