diff --git a/checkin_notes b/checkin_notes index 8af60d0dda..62d9494649 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7877,3 +7877,17 @@ Charlie 23 Dec 2012 BOINCInternetFSHandler.cpp,.h NoticeListCtrl.cpp sg_DlgMessages.cpp,.h + +David 24 Dec 2012 + - file upload handler: in FCGI version, check for trigger file + each time through loop (from Bernd). + - validator: fix bug that zeroed result.random + + db/ + boinc_db.cpp + boinc_db_type.h + sched/ + file_upload_handler.cpp + sched_array.cpp + tools/ + backend_lib.cpp diff --git a/db/boinc_db.cpp b/db/boinc_db.cpp index 84326dfd1a..48aecfa9f2 100644 --- a/db/boinc_db.cpp +++ b/db/boinc_db.cpp @@ -1690,14 +1690,13 @@ int DB_VALIDATOR_ITEM_SET::update_result(RESULT& res) { sprintf(query, "update result set validate_state=%d, granted_credit=%.15e, " - "server_state=%d, outcome=%d, opaque=%lf, random=%d, runtime_outlier=%d " + "server_state=%d, outcome=%d, opaque=%lf, runtime_outlier=%d " "where id=%u", res.validate_state, res.granted_credit, res.server_state, res.outcome, res.opaque, - res.random, res.runtime_outlier?1:0, res.id ); diff --git a/db/boinc_db_types.h b/db/boinc_db_types.h index 8f0a3f5e85..cb1b5ed0e5 100644 --- a/db/boinc_db_types.h +++ b/db/boinc_db_types.h @@ -550,7 +550,7 @@ struct RESULT { double granted_credit; // == canonical credit of WU double opaque; // project-specific; usually external ID int random; // determines send order - int app_version_num; // version# of app (not core client) + int app_version_num; // version# of app // DEPRECATED - THIS DOESN'T DETERMINE VERSION ANY MORE int appid; // copy of WU's appid int exit_status; // application exit status, if any diff --git a/sched/file_upload_handler.cpp b/sched/file_upload_handler.cpp index f900809cca..259afaae7d 100644 --- a/sched/file_upload_handler.cpp +++ b/sched/file_upload_handler.cpp @@ -50,6 +50,8 @@ #include "sched_msgs.h" +using std::string; + #define LOCK_FILES // comment this out to not lock files // this may avoid filesystem hangs @@ -121,7 +123,6 @@ int copy_socket_to_file(FILE* in, char* path, double offset, double nbytes) { bytes_left = nbytes - offset; while (bytes_left > 0) { - int n, m, to_write; m = bytes_left<(double)BLOCK_SIZE ? (int)bytes_left : BLOCK_SIZE; @@ -324,12 +325,8 @@ int handle_file_upload(FILE* in, R_RSA_PUBLIC_KEY& key) { signed_xml, xml_signature, retval, is_valid ); - log_messages.printf(MSG_NORMAL, - "signed xml: %s\n", signed_xml - ); - log_messages.printf(MSG_NORMAL, - "signature: %s\n", xml_signature - ); + log_messages.printf(MSG_NORMAL, "signed xml: %s\n", signed_xml); + log_messages.printf(MSG_NORMAL, "signature: %s\n", xml_signature); return return_error(ERR_PERMANENT, "invalid signature"); } } @@ -463,7 +460,7 @@ int handle_get_file_size(char* file_name) { return return_error(ERR_TRANSIENT, "can't open file"); } - if ((pid=mylockf(fd))) { + if ((pid = mylockf(fd))) { // file locked by another file_upload_handler: try again later // close(fd); @@ -631,7 +628,7 @@ int main(int argc, char *argv[]) { #endif for(int c = 1; c < argc; c++) { - std::string option(argv[c]); + string option(argv[c]); if(option == "-v" || option == "--version") { printf("%s\n", SVN_VERSION); exit(0); @@ -681,10 +678,14 @@ int main(int argc, char *argv[]) { log_messages.pid = getpid(); log_messages.set_debug_level(config.fuh_debug_level); +#ifndef _USING_FCGI_ if (boinc_file_exists(config.project_path("stop_upload"))) { - return_error(ERR_TRANSIENT, "Maintenance underway: file uploads are temporarily disabled."); + return_error(ERR_TRANSIENT, + "File uploads are temporarily disabled." + ); exit(1); } +#endif if (!config.ignore_upload_certificates) { retval = get_key(key); @@ -698,6 +699,12 @@ int main(int argc, char *argv[]) { while(FCGI_Accept() >= 0) { counter++; //fprintf(stderr, "file_upload_handler (FCGI): counter: %d\n", counter); + if (boinc_file_exists(config.project_path("stop_upload"))) { + return_error(ERR_TRANSIENT, + "File uploads are temporarily disabled." + ); + continue; + } log_messages.set_indent_level(0); #endif handle_request(stdin, key); diff --git a/sched/sched_array.cpp b/sched/sched_array.cpp index 60710ed644..94b23b6fe9 100644 --- a/sched/sched_array.cpp +++ b/sched/sched_array.cpp @@ -44,7 +44,7 @@ static bool quick_check( WU_RESULT& wu_result, WORKUNIT& wu, // a mutable copy of wu_result.workunit. - // We may modify its delay_bound and rsc_fpops_est + // We may modify its delay_bound, rsc_fpops_est, and rsc_fpops_bound BEST_APP_VERSION* &bavp, APP* app, int& last_retval diff --git a/tools/backend_lib.cpp b/tools/backend_lib.cpp index c3a9c9886c..c23300cb9e 100644 --- a/tools/backend_lib.cpp +++ b/tools/backend_lib.cpp @@ -53,8 +53,8 @@ using std::string; static struct random_init { random_init() { - srand48(getpid() + time(0)); - } + srand48(getpid() + time(0)); + } } random_init; int read_file(FILE* f, char* buf, int len) {