From b9e2c0e49f4675ac2bc4c764966c38664e75a258 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 31 Mar 2003 23:18:55 +0000 Subject: [PATCH] exit_before_upload flag svn path=/trunk/boinc/; revision=1119 --- checkin_notes | 11 +++++++++++ client/client_state.C | 3 +++ client/client_state.h | 2 ++ client/pers_file_xfer.C | 3 +++ html/user/team_create_action.php | 2 +- 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 04cfc2d2ee..d5ecd50725 100755 --- a/checkin_notes +++ b/checkin_notes @@ -3956,3 +3956,14 @@ David Mar 25 2003 html_user/ create_account* util.inc + +David Mar 31 2003 + - add "-exit_before_upload" cmdline option + + client/ + client_state.C,h + pers_file_xfer.C + html_user/ + team_create_action.php + test/ + test_uc.php diff --git a/client/client_state.C b/client/client_state.C index be71667ea6..23ff7edb9b 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -76,6 +76,7 @@ CLIENT_STATE::CLIENT_STATE() { platform_name = HOST; exit_after_app_start_secs = 0; app_started = 0; + exit_before_upload = false; user_idle = true; use_http_proxy = false; use_socks_proxy = false; @@ -1291,6 +1292,8 @@ void CLIENT_STATE::parse_cmdline(int argc, char** argv) { global_prefs.run_minimized = true; } else if (!strcmp(argv[i], "-saver")) { start_saver = true; + } else if (!strcmp(argv[i], "-exit_before_upload")) { + exit_before_upload = true; // the above options are private (i.e. not shown by -help) diff --git a/client/client_state.h b/client/client_state.h index 61bf59ea3d..db7f0dc1c4 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -104,6 +104,8 @@ public: char socks_user_passwd[256]; char host_venue[256]; // venue, as reported by project that sent us // most recent global prefs + bool exit_before_upload; + // exit when about to upload a file private: bool client_state_dirty; diff --git a/client/pers_file_xfer.C b/client/pers_file_xfer.C index 0905197609..e7f1e80508 100644 --- a/client/pers_file_xfer.C +++ b/client/pers_file_xfer.C @@ -88,6 +88,9 @@ bool PERS_FILE_XFER::start_xfer() { file_xfer->proxy_server_port = gstate.proxy_server_port; } if (is_upload) { + if (gstate.exit_before_upload) { + exit(0); + } retval = file_xfer->init_upload(*fip); } else { retval = file_xfer->init_download(*fip); diff --git a/html/user/team_create_action.php b/html/user/team_create_action.php index c297c5a07d..c0154dc92e 100644 --- a/html/user/team_create_action.php +++ b/html/user/team_create_action.php @@ -29,7 +29,7 @@ $result = mysql_query($query); if ($result) { $teamid = mysql_insert_id(); - Header("Location: team_display.php?teamid=$teamid); + Header("Location: team_display.php?teamid=$teamid"); } else { page_head("Error"); echo "Couldn't create team - please try later.
\n";