From 47d48d202adc26f9676b11eb45ff6ddbdf72d8fd Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 20 Mar 2003 02:05:25 +0000 Subject: [PATCH] new prefs svn path=/trunk/boinc/; revision=1082 --- checkin_notes | 34 ++++++++++++ client/app.C | 2 +- client/client_state.C | 3 +- client/client_state.h | 2 +- client/cs_apps.C | 2 +- client/prefs.C | 8 +++ client/prefs.h | 2 + db/db.h | 6 ++- db/db_mysql.C | 18 ++++--- db/schema.sql | 4 +- doc/index.html | 5 ++ html/user/edit_user_info_action.php | 10 ++-- html/user/edit_user_info_form.php | 5 +- html/user/host.inc | 23 +++++--- html/user/prefs.inc | 84 ++++++++++++++++------------- html/user/prefs_edit_action.php | 11 ++-- html/user/prefs_edit_form.php | 2 +- html/user/show_host_detail.php | 21 ++++---- html/user/show_host_public.php | 25 --------- html/user/user.inc | 10 +++- html/user/util.inc | 1 + sched/db_dump.C | 17 ++++-- test/test.inc | 2 +- todo | 13 ++--- tools/add.C | 53 ++++++------------ 25 files changed, 204 insertions(+), 159 deletions(-) delete mode 100644 html/user/show_host_public.php diff --git a/checkin_notes b/checkin_notes index d0fa8501cf..1d9cbb07a6 100755 --- a/checkin_notes +++ b/checkin_notes @@ -3877,3 +3877,37 @@ David Mar 19 2003 * show_hosts.php (removed) +David Mar 19 2003 + - added global pref for max CPUs + - added global pref for min interval between disk writes + (applies to checkpoint writes only) + - added URL field to user table + - moved "send_email" field from XML to DB + - added "show_hosts" field to user table + + show_host_public.php (removed) + client/ + app.C + client_state.C,h + cs_apps.C + prefs.C,h + db/ + db.h + db_mysql.C + schema.sql + doc/ + index.html + html_user/ + edit_user_info* + host.inc + prefs.inc + prefs_edit_* + show_host_detail.php + user.inc + util.inc + sched/ + db_dump.C + test/ + test.inc + tools/ + add.C diff --git a/client/app.C b/client/app.C index d36bf15abe..72d5c2f410 100644 --- a/client/app.C +++ b/client/app.C @@ -151,7 +151,7 @@ int ACTIVE_TASK::start(bool first_time) { aid.user_expavg_credit = wup->project->user_expavg_credit; aid.host_total_credit = wup->project->host_total_credit; aid.host_expavg_credit = wup->project->host_expavg_credit; - aid.checkpoint_period = DEFAULT_CHECKPOINT_PERIOD; + aid.checkpoint_period = gstate.global_prefs.disk_interval; aid.fraction_done_update_period = DEFAULT_FRACTION_DONE_UPDATE_PERIOD; aid.shm_key = 0; aid.wu_cpu_time = checkpoint_cpu_time; diff --git a/client/client_state.C b/client/client_state.C index 4fc46c326e..8143b84db7 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -224,13 +224,14 @@ int CLIENT_STATE::init() { #endif } - // Set nslots to actual # of CPUs (or less, depending on prefs?) + // Set nslots to actual # of CPUs (or less, depending on prefs) // if (gstate.host_info.p_ncpus > 0) { nslots = gstate.host_info.p_ncpus; } else { nslots = 1; } + if (nslots > global_prefs.max_cpus) nslots = global_prefs.max_cpus; // set up the project and slot directories // diff --git a/client/client_state.h b/client/client_state.h index dedfb4dbb0..f5da32b7d9 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -110,7 +110,7 @@ private: int core_client_major_version; int core_client_minor_version; char* platform_name; - unsigned int nslots; + int nslots; bool run_time_test; bool activities_suspended; int exit_after_app_start_secs; diff --git a/client/cs_apps.C b/client/cs_apps.C index c0ece36876..18e31e0279 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -34,7 +34,7 @@ // in the client state // int CLIENT_STATE::make_slot_dirs() { - unsigned int i; + int i; int retval; for (i=0; i", work_buf_min_days)) { continue; + } else if (parse_int(buf, "", max_cpus)) { + if (max_cpus < 1) max_cpus = 1; + continue; + } else if (parse_double(buf, "", disk_interval)) { + if (disk_interval<0) disk_interval = 0; + continue; } else if (parse_double(buf, "", disk_max_used_gb)) { continue; } else if (parse_double(buf, "", disk_max_used_pct)) { diff --git a/client/prefs.h b/client/prefs.h index 4e114ab6b1..8d1de0bd7a 100644 --- a/client/prefs.h +++ b/client/prefs.h @@ -42,6 +42,8 @@ struct GLOBAL_PREFS { bool hangup_if_dialed; double work_buf_max_days; double work_buf_min_days; + int max_cpus; + double disk_interval; double disk_max_used_gb; double disk_max_used_pct; double disk_min_free_gb; diff --git a/db/db.h b/db/db.h index 6c8d8bd9bf..1d50784b59 100644 --- a/db/db.h +++ b/db/db.h @@ -107,7 +107,6 @@ struct USER { unsigned int create_time; char email_addr[256]; char name[256]; - char web_password[256]; // optional char authenticator[256]; char country[256]; char postal_code[256]; @@ -118,8 +117,11 @@ struct USER { // global preferences, within tag char project_prefs[MAX_BLOB_SIZE]; // project preferences, within tag - int teamid; // if user is part of a team + int teamid; // team ID if any char venue[256]; // home/work/school (default) + char url[256]; // user's web page if any + bool send_email; + bool show_hosts; }; #define TEAM_TYPE_CLUB 1 diff --git a/db/db_mysql.C b/db/db_mysql.C index 477cd5423f..8494578277 100644 --- a/db/db_mysql.C +++ b/db/db_mysql.C @@ -149,23 +149,22 @@ void BOINC_MYSQL_DB::struct_to_str(void* vp, char* q, int type) { up = (USER*)vp; escape_single_quotes(up->email_addr); escape_single_quotes(up->name); - escape_single_quotes(up->web_password); escape_single_quotes(up->country); escape_single_quotes(up->postal_code); escape_single_quotes(up->global_prefs); escape_single_quotes(up->project_prefs); + escape_single_quotes(up->url); sprintf(q, "id=%d, create_time=%d, email_addr='%s', name='%s', " - "web_password='%s', authenticator='%s', " + "authenticator='%s', " "country='%s', postal_code='%s', " "total_credit=%.12e, expavg_credit=%.12e, expavg_time=%f, " "global_prefs='%s', project_prefs='%s', " - "teamid=%d, venue='%s'", + "teamid=%d, venue='%s', url='%s', send_email=%d, show_hosts=%d", up->id, up->create_time, up->email_addr, up->name, - up->web_password, up->authenticator, up->country, up->postal_code, @@ -175,15 +174,18 @@ void BOINC_MYSQL_DB::struct_to_str(void* vp, char* q, int type) { up->global_prefs, up->project_prefs, up->teamid, - up->venue + up->venue, + up->url, + up->send_email, + up->show_hosts ); unescape_single_quotes(up->email_addr); unescape_single_quotes(up->name); - unescape_single_quotes(up->web_password); unescape_single_quotes(up->country); unescape_single_quotes(up->postal_code); unescape_single_quotes(up->global_prefs); unescape_single_quotes(up->project_prefs); + unescape_single_quotes(up->url); break; case TYPE_TEAM: tp = (TEAM*)vp; @@ -387,7 +389,6 @@ void BOINC_MYSQL_DB::row_to_struct(MYSQL_ROW& r, void* vp, int type) { up->create_time = atoi(r[i++]); strcpy2(up->email_addr, r[i++]); strcpy2(up->name, r[i++]); - strcpy2(up->web_password, r[i++]); strcpy2(up->authenticator, r[i++]); strcpy2(up->country, r[i++]); strcpy2(up->postal_code, r[i++]); @@ -398,6 +399,9 @@ void BOINC_MYSQL_DB::row_to_struct(MYSQL_ROW& r, void* vp, int type) { strcpy2(up->project_prefs, r[i++]); up->teamid = atoi(r[i++]); strcpy2(up->venue, r[i++]); + strcpy2(up->url, r[i++]); + up->send_email = atoi(r[i++]); + up->show_hosts = atoi(r[i++]); break; case TYPE_TEAM: tp = (TEAM*)vp; diff --git a/db/schema.sql b/db/schema.sql index cd5f6232c1..7b018c8a8a 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -42,7 +42,6 @@ create table user ( create_time integer not null, email_addr varchar(254) not null, name varchar(254), - web_password varchar(254), authenticator varchar(254), country varchar(254), postal_code varchar(254), @@ -53,6 +52,9 @@ create table user ( project_prefs blob, teamid integer not null, venue varchar(254) not null, + url varchar(254), + send_email smallint not null, + show_hosts smallint not null, primary key (id) ); diff --git a/doc/index.html b/doc/index.html index bdee9e4d82..d72a73db22 100644 --- a/doc/index.html +++ b/doc/index.html @@ -73,6 +73,11 @@ width="210" height="62" border="0" alt="SourceForge Logo">

Status and news

+March 19, 2003 +

+New account parameters and preferences: URL, limit number of processors, +frequency of writes to disk, whether to show your computers on the web. +
March 5, 2003
Version 0.15 of BOINC is available on SourceForge.net. diff --git a/html/user/edit_user_info_action.php b/html/user/edit_user_info_action.php index 0ab358947f..ba3fb6ff4c 100644 --- a/html/user/edit_user_info_action.php +++ b/html/user/edit_user_info_action.php @@ -6,18 +6,18 @@ db_init(); $user = get_logged_in_user(); - page_head("User info update"); $name = $HTTP_POST_VARS["user_name"]; + $url = $HTTP_POST_VARS["url"]; $country = $HTTP_POST_VARS["country"]; $postal_code = $HTTP_POST_VARS["postal_code"]; - $result = mysql_query("update user set name='$name', country='$country', postal_code='$postal_code' where id=$user->id"); + $result = mysql_query("update user set name='$name', url='$url', country='$country', postal_code='$postal_code' where id=$user->id"); if ($result) { - echo "User info updated successfully."; + Header("Location: home.php"); } else { + page_head("User info update"); echo "Couldn't update user info."; + page_tail(); } - page_tail(); - ?> diff --git a/html/user/edit_user_info_form.php b/html/user/edit_user_info_form.php index c5c52cc49b..5942e59736 100644 --- a/html/user/edit_user_info_form.php +++ b/html/user/edit_user_info_form.php @@ -10,9 +10,12 @@ page_head("Edit user information", $user); echo "
"; start_table(); row1("Edit account info"); -row2("User name", +row2("Name", "" ); +row2("URL", + "http://" +); row2_init("Country", "max_cpus> processors"); + row2("Write to disk at most every", "disk_interval> seconds"); + row1("Limit the disk space used by BOINC:"); row2("Use no more than", @@ -433,22 +437,22 @@ function prefs_form_global($user, $prefs) { ); } -function prefs_form_email($prefs) { +function prefs_form_privacy($user) { $y = "Yes send_email?"checked":"") + .($user->send_email?"checked":"") ."> No send_email?"":"checked") + .($user->send_email?"":"checked") ."> "; row2("Should ".PROJECT." send you email newsletters?", $y); - $y = "Yes show_email?"checked":"") - ."> No show_email?"":"checked") + $y = "Yes show_hosts?"checked":"") + ."> No show_hosts?"":"checked") ."> "; - row2("Should ".PROJECT." show your email address on its web site?", $y); + row2("Should ".PROJECT." show your computers on its web site?", $y); } function prefs_form_resource($prefs) { @@ -509,6 +513,8 @@ function prefs_global_parse_form(&$prefs) { $hangup_if_dialed = $_GET["hangup_if_dialed"]; $work_buf_min_days = $_GET["work_buf_min_days"]; $work_buf_max_days = $_GET["work_buf_max_days"]; + $max_cpus = $_GET["max_cpus"]; + $disk_interval = $_GET["disk_interval"]; $disk_max_used_gb = $_GET["disk_max_used_gb"]; $disk_max_used_pct = $_GET["disk_max_used_pct"]; $disk_min_free_gb = $_GET["disk_min_free_gb"]; @@ -523,8 +529,12 @@ function prefs_global_parse_form(&$prefs) { if ($work_buf_min_days<0) $work_buf_min_days = 0; if ($work_buf_max_days<0) $work_buf_max_days = 0; if ($work_buf_min_days > $work_buf_max_days) $work_buf_min_days = $work_buf_max_days; + if ($max_cpus<1) $max_cpus = 1; + if ($disk_interval<0) $disk_interval = 0; $prefs->work_buf_min_days = $work_buf_min_days; $prefs->work_buf_max_days = $work_buf_max_days; + $prefs->max_cpus = $max_cpus; + $prefs->disk_interval = $disk_interval; if ($disk_max_used_gb<0) $disk_max_used_gb = 0; if ($disk_max_used_pct<0) $disk_max_used_pct = 0; @@ -541,9 +551,9 @@ function prefs_resource_parse_form(&$prefs) { $prefs->resource_share = $_GET['resource_share']; } -function prefs_email_parse_form(&$prefs) { - $prefs->send_email = ($_GET['send_email'] == "yes"); - $prefs->show_email = ($_GET['show_email'] == "yes"); +function prefs_privacy_parse_form(&$user) { + $user->send_email = ($_GET['send_email'] == "yes")?1:0; + $user->show_hosts = ($_GET['show_hosts'] == "yes")?1:0; } function prefs_project_parse_form(&$prefs) { @@ -575,7 +585,9 @@ function global_prefs_make_xml($prefs, $primary=true) { } $xml = $xml ."$prefs->work_buf_min_days\n" - ."$prefs->work_buf_max_days\n"; + ."$prefs->work_buf_max_days\n" + ."$prefs->max_cpus\n" + ."$prefs->disk_interval\n"; $xml = $xml ."$prefs->disk_max_used_gb\n" ."$prefs->disk_max_used_pct\n" @@ -601,12 +613,6 @@ function project_prefs_make_xml($prefs, $primary=true) { $xml = ""; if ($primary) { $xml = "\n"; - if ($prefs->show_email == 1) { - $xml = $xml."\n"; - } - if ($prefs->send_email == 1) { - $xml = $xml."\n"; - } } if ($prefs->resource_share) { $xml = $xml @@ -638,14 +644,20 @@ function project_prefs_make_xml($prefs, $primary=true) { // function global_prefs_update(&$user, $prefs) { $prefs_xml = global_prefs_make_xml($prefs); - $retval = mysql_query("update user set global_prefs='$prefs_xml' where id=$user->id"); + $query = "update user set global_prefs='$prefs_xml' where id=$user->id"; + $retval = mysql_query($query); + if (!$retval) { + echo "Update failed: ".htmlspecialchars($query)."\n"; + echo mysql_error(); + exit(); + } $user->global_prefs = $prefs_xml; return $retval; } function project_prefs_update(&$user, $prefs) { $prefs_xml = project_prefs_make_xml($prefs); - $retval = mysql_query("update user set project_prefs='$prefs_xml' where id=$user->id"); + $retval = mysql_query("update user set project_prefs='$prefs_xml', send_email=$user->send_email, show_hosts=$user->show_hosts where id=$user->id"); $user->project_prefs = $prefs_xml; return $retval; } diff --git a/html/user/prefs_edit_action.php b/html/user/prefs_edit_action.php index bd56b3ebe0..9761d615fe 100644 --- a/html/user/prefs_edit_action.php +++ b/html/user/prefs_edit_action.php @@ -27,12 +27,13 @@ if ($subset == "global") { prefs_project_parse_form($prefs); prefs_resource_parse_form($prefs); - if ($venue) $main_prefs->$venue = $prefs; - else $main_prefs = $prefs; - - if (!$venue) { - prefs_email_parse_form($main_prefs); + if ($venue) { + $main_prefs->$venue = $prefs; + } else { + $main_prefs = $prefs; + prefs_privacy_parse_form($user); } + project_prefs_update($user, $main_prefs); if (!$venue) { diff --git a/html/user/prefs_edit_form.php b/html/user/prefs_edit_form.php index 236b4d626f..164c09f226 100644 --- a/html/user/prefs_edit_form.php +++ b/html/user/prefs_edit_form.php @@ -51,7 +51,7 @@ if ($subset == "global") { prefs_form_resource($prefs); prefs_form_project($prefs->project_specific); if (!$venue) { - prefs_form_email($prefs); + prefs_form_privacy($user); venue_form($user); } } diff --git a/html/user/show_host_detail.php b/html/user/show_host_detail.php index a41c70c9a8..0f56fa9b23 100644 --- a/html/user/show_host_detail.php +++ b/html/user/show_host_detail.php @@ -7,20 +7,19 @@ db_init(); $user = get_logged_in_user(); $hostid = $HTTP_GET_VARS["hostid"]; - page_head("Computer stats"); - $result = mysql_query("select * from host where id = $hostid"); $host = mysql_fetch_object($result); mysql_free_result($result); - - if ($host) { - if ($host->userid != $user->id) { - echo "Not your computer\n"; - } else { - show_host($host, true); - } - } else { - echo "Couldn't find host or user.

"; + if (!$host) { + echo "Couldn't find computer"; + exit(); } + + $private = false; + if ($user && $user->id == $host->userid) { + $private = true; + } + page_head("Computer summary", $user); + show_host($host, $private); page_tail(); ?> diff --git a/html/user/show_host_public.php b/html/user/show_host_public.php deleted file mode 100644 index 1bca980f06..0000000000 --- a/html/user/show_host_public.php +++ /dev/null @@ -1,25 +0,0 @@ -"; - } - } else { - echo "Couldn't find host.

"; - } - page_tail(); -?> diff --git a/html/user/user.inc b/html/user/user.inc index b411813d9b..1df6e12502 100644 --- a/html/user/user.inc +++ b/html/user/user.inc @@ -18,10 +18,17 @@ function show_user_stats($user, $private) { row2("Team", "None"); } row2("Country", $user->country); + if (strlen($user->url)) { + row2("URL", "url>http://$user->url"); + } if ($private) { row2("Computers", "View"); } else { - row2("Computers", "id>View"); + if ($user->show_hosts) { + row2("Computers", "id>View"); + } else { + row2("Computers", "hidden"); + } } } @@ -37,6 +44,7 @@ function show_user_profile_private($user) { $email_text ); row2("Name", $user->name); + row2("URL", "http://$user->url"); row2("Country", $user->country); row2("Postal code", $user->postal_code); row2("", "Edit account info"); diff --git a/html/user/util.inc b/html/user/util.inc index d3ed08eef7..7110a8600c 100644 --- a/html/user/util.inc +++ b/html/user/util.inc @@ -106,6 +106,7 @@ function row1($x, $ncols=2) { function row2($x, $y) { if ($x=="") $x="
"; + if ($y=="") $y="
"; echo "$x$y\n"; } function row2_init($x, $y) { diff --git a/sched/db_dump.C b/sched/db_dump.C index f200f0da6f..5c9507aaec 100644 --- a/sched/db_dump.C +++ b/sched/db_dump.C @@ -81,10 +81,14 @@ void write_host(HOST& host, FILE* f, bool detail, bool show_user) { host.id ); if (show_user) { - fprintf(f, - " %d\n", - host.userid - ); + USER user; + db_user(host.userid, user); + if (user.show_hosts) { + fprintf(f, + " %d\n", + host.userid + ); + } } fprintf(f, " %f\n" @@ -141,10 +145,12 @@ void write_user(USER& user, FILE* f, bool detail, bool show_team) { "\n" " %d\n" " %s\n" + " %s\n" " %f\n" " %f\n", user.id, user.name, + user.url, user.total_credit, user.expavg_credit ); @@ -154,7 +160,7 @@ void write_user(USER& user, FILE* f, bool detail, bool show_team) { user.teamid ); } - if (detail) { + if (detail && user.show_hosts) { host.userid = user.id; while (!db_host_enum_userid(host)) { write_host(host, f, false, false); @@ -423,6 +429,7 @@ void host_total_credit() { if (zip_files) system(cmd_line); } } + void host_expavg_credit() { HOST host; FILE* f = NULL; diff --git a/test/test.inc b/test/test.inc index b5adf7fe57..fb4ddda1ca 100644 --- a/test/test.inc +++ b/test/test.inc @@ -247,7 +247,7 @@ class Project { if ($user->global_prefs) { $gp = "\n$user->global_prefs\n"; } - db_query("insert into user values (0, $now, '$user->email_addr', '$user->name', 'foobar', '$user->authenticator', 'Peru', '12345', 0, 0, 0, '$gp', '$pp', 0, 'home')"); + db_query("insert into user values (0, $now, '$user->email_addr', '$user->name', '$user->authenticator', 'Peru', '12345', 0, 0, 0, '$gp', '$pp', 0, 'home', '', 0, 1)"); } echo "adding apps\n"; diff --git a/todo b/todo index 09faf214d1..71248e0706 100755 --- a/todo +++ b/todo @@ -28,18 +28,13 @@ THINGS TO TEST (preferably with test scripts) - credit is granted even if result arrives very late - multiple preference sets - shared memory and CPU time measurement, with and without the BOINC API +- HD write frequency +- timezone on all platforms + ----------------------- MEDIUM-PRIORITY (should do before public release) ----------------------- -add to user table: - URL field (in XML) - "show hosts to others" flag (in XML) - move "send email" flag from XML to DB - remove "show email" flag - -add user control for HD write frequency - decide what to do with invalid result files in upload directory make get_local_ip_addr() work in all cases @@ -55,8 +50,6 @@ Devise system for porting applications Add 2-D waterfall display to Astropulse -get timezone working on all platforms - Deadline mechanism for results - use in result dispatching - use in file uploading (decide what to upload next) diff --git a/tools/add.C b/tools/add.C index 9e1f9bf5aa..1f453a9e55 100644 --- a/tools/add.C +++ b/tools/add.C @@ -35,7 +35,7 @@ // [ -signed_exec_files file1 sign1 file2 sign2 ... ] // create DB record // copy exec to data directory -// add user -email_addr x -name y -web_password z -authenticator a +// add user -email_addr x -name y -authenticator a // [ -global_prefs_file y ] #include @@ -61,7 +61,7 @@ char *db_name=0, *db_passwd=0, *app_name=0, *platform_name=0; char *project_short_name=0, *project_long_name=0; char* user_friendly_name=0; char* exec_dir=0, *exec_files[10], *signature_files[10]; -char *email_addr=0, *user_name=0, *web_password=0, *authenticator=0; +char *email_addr=0, *user_name=0, *authenticator=0; char *global_prefs_file=0, *download_dir, *download_url; char* code_sign_keyfile=0; char *message=0, *message_priority=0; @@ -245,7 +245,6 @@ void add_user() { user.create_time = time(0); strcpy(user.email_addr, email_addr); strcpy(user.name, user_name); - strcpy(user.web_password, web_password); strcpy(user.authenticator, authenticator); strcpy(user.country, "United States"); strcpy(user.postal_code, "94703"); @@ -272,21 +271,17 @@ int main(int argc, char** argv) { } else if (!strcmp(argv[i], "-db_passwd")) { db_passwd = argv[++i]; } else if (!strcmp(argv[i], "-project_long_name")) { - i++; - project_long_name = argv[i]; + project_long_name = argv[++i]; } else if (!strcmp(argv[i], "-project_short_name")) { - i++; - project_short_name = argv[i]; + project_short_name = argv[++i]; } else if (!strcmp(argv[i], "-app_name")) { - i++; - app_name = argv[i]; + app_name = argv[++i]; } else if (!strcmp(argv[i], "-platform_name")) { platform_name = argv[++i]; } else if (!strcmp(argv[i], "-user_friendly_name")) { user_friendly_name = argv[++i]; } else if (!strcmp(argv[i], "-exec_dir")) { - i++; - exec_dir = argv[i]; + exec_dir = argv[++i]; } else if (!strcmp(argv[i], "-exec_files")) { signed_exec_files = false; i++; @@ -306,41 +301,27 @@ int main(int argc, char** argv) { } break; } else if (!strcmp(argv[i], "-exec_dir")) { - i++; - exec_dir = argv[i]; + exec_dir = argv[++i]; } else if (!strcmp(argv[i], "-email_addr")) { - i++; - email_addr = argv[i]; + email_addr = argv[++i]; } else if (!strcmp(argv[i], "-user_name")) { - i++; - user_name = argv[i]; - } else if (!strcmp(argv[i], "-web_password")) { - i++; - web_password = argv[i]; + user_name = argv[++i]; } else if (!strcmp(argv[i], "-authenticator")) { - i++; - authenticator = argv[i]; + authenticator = argv[++i]; } else if (!strcmp(argv[i], "-global_prefs_file")) { - i++; - global_prefs_file = argv[i]; + global_prefs_file = argv[++i]; } else if (!strcmp(argv[i], "-download_url")) { - i++; - download_url = argv[i]; + download_url = argv[++i]; } else if (!strcmp(argv[i], "-download_dir")) { - i++; - download_dir = argv[i]; + download_dir = argv[++i]; } else if (!strcmp(argv[i], "-version")) { - i++; - version = atoi(argv[i]); + version = atoi(argv[++i]); } else if (!strcmp(argv[i], "-message")) { - i++; - message = argv[i]; + message = argv[++i]; } else if (!strcmp(argv[i], "-message_priority")) { - i++; - message_priority = argv[i]; + message_priority = argv[++i]; } else if (!strcmp(argv[i], "-code_sign_keyfile")) { - i++; - code_sign_keyfile = argv[i]; + code_sign_keyfile = argv[++i]; } } retval = boinc_db_open(db_name, db_passwd);