- file upload handler: in FCGI version, check for trigger file

each time through loop (from Bernd).
- validator: fix bug that zeroed result.random
This commit is contained in:
David Anderson 2012-12-24 12:14:22 -08:00 committed by Oliver Bock
parent cfe37e985e
commit 6f962d5b61
6 changed files with 36 additions and 16 deletions

View File

@ -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

View File

@ -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
);

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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) {