diff --git a/checkin_notes b/checkin_notes index c4f38edad1..aabf8f5e46 100755 --- a/checkin_notes +++ b/checkin_notes @@ -2863,3 +2863,11 @@ Walt 27 Mar 2007 clientgui/ Makefile.am + +David 27 Mar 2007 + - scheduler: fix bug that cause parse error + for Linux hosts with long strings + (from Andre Kerstens) + + sched/ + server_types.C diff --git a/doc/boinc_dev.php b/doc/boinc_dev.php index e7b7f427e0..b474f30955 100644 --- a/doc/boinc_dev.php +++ b/doc/boinc_dev.php @@ -191,6 +191,13 @@ Investigate.
  • Change the ops/ web pages to require login by a user with admin privileges. +
  • Add 'referral' mechanism: + new user creates account, enters email of 'referrer' + (or goes to URL that has it embedded). + Add referrerid to DB. + Give referrer a fraction of credit + (or a 1-time bonus). + List referrals on user page (show only those still active). diff --git a/sched/server_types.C b/sched/server_types.C index 0145910204..28262a23b7 100644 --- a/sched/server_types.C +++ b/sched/server_types.C @@ -51,7 +51,7 @@ void remove_quotes(char* p) { int CLIENT_APP_VERSION::parse(FILE* f) { char buf[256]; - while (fgets(buf, 256, f)) { + while (fgets(buf, sizeof(buf), f)) { if (match_tag(buf, "")) return 0; if (parse_str(buf, "", app_name, 256)) continue; if (parse_int(buf, "", version_num)) continue; @@ -63,7 +63,7 @@ int FILE_INFO::parse(FILE* f) { char buf[256]; memset(this, 0, sizeof(FILE_INFO)); - while (fgets(buf, 256, f)) { + while (fgets(buf, sizeof(buf), f)) { if (match_tag(buf, "")) { if (!strlen(name)) return ERR_XML_PARSE; return 0; @@ -77,7 +77,7 @@ int OTHER_RESULT::parse(FILE* f) { char buf[256]; name = ""; - while (fgets(buf, 256, f)) { + while (fgets(buf, sizeof(buf), f)) { if (match_tag(buf, "")) { if (name=="") return ERR_XML_PARSE; return 0; @@ -92,7 +92,7 @@ int IP_RESULT::parse(FILE* f) { report_deadline = 0; cpu_time_remaining = 0; - while (fgets(buf, 256, f)) { + while (fgets(buf, sizeof(buf), f)) { if (match_tag(buf, "")) { return 0; } @@ -135,9 +135,9 @@ int SCHEDULER_REQUEST::parse(FILE* fin) { have_other_results_list = false; have_ip_results_list = false; - fgets(buf, 256, fin); + fgets(buf, sizeof(buf), fin); if (!match_tag(buf, "")) return ERR_XML_PARSE; - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) return 0; else if (parse_str(buf, "", authenticator, sizeof(authenticator))) { remove_quotes(authenticator); @@ -148,7 +148,7 @@ int SCHEDULER_REQUEST::parse(FILE* fin) { else if (parse_int(buf, "", rpc_seqno)) continue; else if (parse_str(buf, "", platform_name, sizeof(platform_name))) continue; else if (match_tag(buf, "")) { - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) break; if (match_tag(buf, "")) { CLIENT_APP_VERSION cav; @@ -170,14 +170,14 @@ int SCHEDULER_REQUEST::parse(FILE* fin) { else if (match_tag(buf, "")) { strcpy(global_prefs_xml, "\n"); - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (strstr(buf, "")) break; safe_strcat(global_prefs_xml, buf); } safe_strcat(global_prefs_xml, "\n"); } else if (match_tag(buf, "")) { - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (strstr(buf, "")) break; safe_strcat(working_global_prefs_xml, buf); } @@ -224,7 +224,7 @@ int SCHEDULER_REQUEST::parse(FILE* fin) { continue; } else if (match_tag(buf, "")) { have_other_results_list = true; - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) break; if (match_tag(buf, "")) { OTHER_RESULT o_r; @@ -237,7 +237,7 @@ int SCHEDULER_REQUEST::parse(FILE* fin) { continue; } else if (match_tag(buf, "")) { have_ip_results_list = true; - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) break; if (match_tag(buf, "")) { IP_RESULT ir; @@ -383,7 +383,7 @@ int MSG_FROM_HOST_DESC::parse(FILE* fin) { char buf[256]; msg_text = ""; - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) return 0; if (parse_str(buf, "", variety, sizeof(variety))) continue; msg_text += buf; @@ -721,7 +721,7 @@ int RESULT::parse_from_client(FILE* fin) { // should be non-zero if exit_status is not found exit_status = ERR_NO_EXIT_STATUS; memset(this, 0, sizeof(RESULT)); - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) return 0; else if (parse_str(buf, "", name, sizeof(name))) continue; else if (parse_int(buf, "", client_state)) continue; @@ -734,13 +734,13 @@ int RESULT::parse_from_client(FILE* fin) { else if (parse_double(buf, "", intops_cumulative)) continue; else if (match_tag(buf, "")) { safe_strcat(xml_doc_out, buf); - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { safe_strcat(xml_doc_out, buf); if (match_tag(buf, "")) break; } continue; } else if (match_tag(buf, "" )) { - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) break; safe_strcat(stderr_out, buf); } @@ -760,7 +760,7 @@ int HOST::parse(FILE* fin) { char buf[1024]; p_ncpus = 1; - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) return 0; else if (parse_int(buf, "", timezone)) continue; else if (parse_str(buf, "", domain_name, sizeof(domain_name))) continue; @@ -817,7 +817,7 @@ int HOST::parse(FILE* fin) { int HOST::parse_time_stats(FILE* fin) { char buf[256]; - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) return 0; else if (parse_double(buf, "", on_frac)) continue; else if (parse_double(buf, "", connected_frac)) continue; @@ -839,7 +839,7 @@ int HOST::parse_time_stats(FILE* fin) { int HOST::parse_net_stats(FILE* fin) { char buf[256]; - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) return 0; else if (parse_double(buf, "", n_bwup)) continue; else if (parse_double(buf, "", n_bwdown)) continue; @@ -857,7 +857,7 @@ int HOST::parse_net_stats(FILE* fin) { int HOST::parse_disk_usage(FILE* fin) { char buf[256]; - while (fgets(buf, 256, fin)) { + while (fgets(buf, sizeof(buf), fin)) { if (match_tag(buf, "")) return 0; else if (parse_double(buf, "", d_boinc_used_total)) continue; else if (parse_double(buf, "", d_boinc_used_project)) continue;