From 8dfb0cd633a2bf0c2f692b0717845325b97ff867 Mon Sep 17 00:00:00 2001 From: Dan Werthimer Date: Fri, 9 May 2003 22:44:35 +0000 Subject: [PATCH] no message svn path=/trunk/boinc/; revision=1178 --- client/client_state.h | 1 + client/cs_files.C | 15 +++++++++++++++ client/file_names.h | 3 +++ client/win/wingui_mainwindow.cpp | 2 ++ todo | 9 +-------- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/client/client_state.h b/client/client_state.h index 4ef716c268..c0f1c18436 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -86,6 +86,7 @@ public: #endif unsigned int cpu_benchmarks_start; int check_cpu_benchmarks(); + void trunc_stderr_stdout(); int project_disk_usage(PROJECT*, double&); int current_disk_usage(double&); // returns the total disk usage of BOINC on this host diff --git a/client/cs_files.C b/client/cs_files.C index 1cb09cbfbf..ab6e48025b 100644 --- a/client/cs_files.C +++ b/client/cs_files.C @@ -37,6 +37,7 @@ #include "client_types.h" #include "log_flags.h" #include "client_state.h" +#include "filesys.h" #include "error_numbers.h" // Decide whether to consider starting a new file transfer @@ -46,6 +47,20 @@ bool CLIENT_STATE::start_new_file_xfer() { return true; } +void CLIENT_STATE::trunc_stderr_stdout() { + double f_size; + + // If the stderr.txt or stdout.txt files are too big, reset them + // TODO: should we tell the user we're resetting these? + file_size(STDERR_FILE_NAME, f_size); + if (f_size > MAX_STDERR_FILE_SIZE) { + freopen(STDERR_FILE_NAME, "w", stderr); + } + file_size(STDOUT_FILE_NAME, f_size); + if (f_size > MAX_STDOUT_FILE_SIZE) { + freopen(STDOUT_FILE_NAME, "w", stderr); + } +} // Make a directory for each of the projects in the client state // diff --git a/client/file_names.h b/client/file_names.h index da7890f6a4..eee9ec08ed 100644 --- a/client/file_names.h +++ b/client/file_names.h @@ -39,6 +39,9 @@ extern void get_account_filename(char* master_url, char* path); extern bool is_account_file(char*); extern void escape_project_url(char *in, char* out); +#define MAX_STDERR_FILE_SIZE 1024*1024 +#define MAX_STDOUT_FILE_SIZE 1024*1024 + #define PROJECTS_DIR "projects" #define SLOTS_DIR "slots" #define STATE_FILE_TEMP "state_file_temp.xml" diff --git a/client/win/wingui_mainwindow.cpp b/client/win/wingui_mainwindow.cpp index 82ff0a5a01..011ec70ea4 100755 --- a/client/win/wingui_mainwindow.cpp +++ b/client/win/wingui_mainwindow.cpp @@ -1643,6 +1643,8 @@ void CMainWindow::OnTimer(UINT uEventID) UpdateGUI(&gstate); } + gstate.trunc_stderr_stdout(); + // Start the timer again m_nGuiTimerID = SetTimer(GUI_TIMER, GUI_WAIT, (TIMERPROC) NULL); } diff --git a/todo b/todo index 3ca6e01de1..cdb9bc16a1 100755 --- a/todo +++ b/todo @@ -8,12 +8,10 @@ BUGS (arranged from high to low priority) - Result status should say "downloading files", "uploading files", etc. - message window should reposition to bottom when new message - show_message should expect \n, discard it if GUI -- show "---" for CPU time, %done of results not started yet - Win GUI: line between menus and tabs - "show graphics" should not use right-click - win GUI: reduce flicker? -- on major version change, - should discard any pending WUs +- on major version change, should discard any pending WUs - labels on disk graph are not clear - document and add to global prefs? start_saver @@ -91,11 +89,6 @@ implement a "fetch prefs" command (regular RPC w/o work request) all RPCs should return a "user-specific project URL" to be used in GUI (might refer to user page) -screensaver should say (in text below logo) if - - core client isn't running - - core client running, but in no-work period - - in work period, but no app w/ graphics to run - when you create a team you should join that team in GUI, project name should hyperlink to a project-specified URL