From 8f54ad083828e7af1102d633937971eac99f2175 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 2 Nov 2006 21:35:47 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=11453 --- checkin_notes | 11 +++++++++++ client/time_stats.C | 7 ++++++- lib/network.C | 6 +++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index d269202ec7..48d8cd74d3 100755 --- a/checkin_notes +++ b/checkin_notes @@ -12034,3 +12034,14 @@ David 2 Nov 2006 lib/ prefs.C,h + +David 2 Nov 2006 + - core client: get rid of attempts to keep track of + network connected fraction, + since we don't have a reliable way of seeing + if there's a physical connection + + client/ + time_stats.C + lib/ + network.C diff --git a/client/time_stats.C b/client/time_stats.C index fee66d81dc..839167f794 100644 --- a/client/time_stats.C +++ b/client/time_stats.C @@ -85,7 +85,12 @@ void TIME_STATS::update(bool is_active) { w1 = 1 - exp(-dt/ALPHA); // weight for recent period w2 = 1 - w1; // weight for everything before that // (close to zero if long gap) + + // the following always returns UNKNOWN, + // but leave it here for now + // int connected_state = get_connected_state(); + if (first) { // the client has just started; this is the first call. // @@ -141,7 +146,7 @@ void TIME_STATS::update_cpu_efficiency(double cpu_wall_time, double cpu_time) { double w = exp(-cpu_wall_time/SECONDS_PER_DAY); double e = cpu_time/cpu_wall_time; if (e<0) { - return; + return; } cpu_efficiency = w*cpu_efficiency + (1-w)*e; if (log_flags.cpu_sched_debug){ diff --git a/lib/network.C b/lib/network.C index 4e89d71863..1bcfb159eb 100644 --- a/lib/network.C +++ b/lib/network.C @@ -182,7 +182,10 @@ int get_socket_error(int fd) { typedef BOOL (WINAPI *GetStateProc)( OUT LPDWORD lpdwFlags, IN DWORD dwReserved); typedef int (*pfnBOINCIsNetworkAlive)(LPDWORD lpdwFlags); -int get_connected_state( ) { +int get_connected_state() { + // The following is commented out because it causes + // hangs in some situations. +#if 0 int online = 0; static bool first=true; static HMODULE lib_wininet_module; @@ -217,6 +220,7 @@ int get_connected_state( ) { return CONNECTED_STATE_NOT_CONNECTED; } } +#endif return CONNECTED_STATE_UNKNOWN; }