mirror of https://github.com/BOINC/boinc.git
- file upload handler: fix major bug (introducted 12 Sept)
that caused it to report "volume full" erroneously - added --help option to some backend programs; gives general info and directs to web page file_upload_handler.C svn path=/trunk/boinc/; revision=13685
This commit is contained in:
parent
8103f74d3e
commit
505d04969a
|
@ -8844,4 +8844,15 @@ Charlie 27 Sep 2007
|
|||
|
||||
api/
|
||||
boinc_api.C
|
||||
|
||||
|
||||
David 27 Sept 2007
|
||||
- file upload handler: fix major bug (introducted 12 Sept)
|
||||
that caused it to report "volume full" erroneously
|
||||
- added --help option to some backend programs;
|
||||
gives general info and directs to web page
|
||||
|
||||
sched/
|
||||
assimilator.C
|
||||
census.C
|
||||
db_dump.C
|
||||
file_upload_handler.C
|
||||
|
|
|
@ -72,7 +72,7 @@ bool do_pass(APP& app) {
|
|||
check_stop_daemons();
|
||||
|
||||
if (wu_id_modulus) {
|
||||
sprintf(mod_clause, " and workunit.id %% %d = %d ",
|
||||
sprintf(mod_clause, " and workunit.id %% %d = %d ",
|
||||
wu_id_modulus, wu_id_remainder
|
||||
);
|
||||
} else {
|
||||
|
@ -144,6 +144,14 @@ bool do_pass(APP& app) {
|
|||
return did_something;
|
||||
}
|
||||
|
||||
void show_help() {
|
||||
fprintf(stderr,
|
||||
"This program is an 'assimilator'; it handles validated results.\n"
|
||||
"Normally it is run as a daemon from config.xml.\n"
|
||||
"For more info: http://boinc.berkeley.edu/trac/wiki/BackendPrograms\n"
|
||||
);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int retval;
|
||||
bool one_pass = false;
|
||||
|
@ -179,14 +187,19 @@ int main(int argc, char** argv) {
|
|||
} else if (!strcmp(argv[i], "-mod")) {
|
||||
wu_id_modulus = atoi(argv[++i]);
|
||||
wu_id_remainder = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) {
|
||||
show_help();
|
||||
exit(0);
|
||||
} else {
|
||||
log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL, "Unrecognized arg: %s\n", argv[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (wu_id_modulus) {
|
||||
log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG, "Using mod'ed WU enumeration. modulus = %d remainder = %d\n",
|
||||
wu_id_modulus, wu_id_remainder);
|
||||
log_messages.printf(SCHED_MSG_LOG::MSG_DEBUG,
|
||||
"Using mod'ed WU enumeration. modulus = %d remainder = %d\n",
|
||||
wu_id_modulus, wu_id_remainder
|
||||
);
|
||||
}
|
||||
|
||||
retval = config.parse_file("..");
|
||||
|
|
|
@ -31,11 +31,27 @@
|
|||
#include "sched_msgs.h"
|
||||
#include "hr_info.h"
|
||||
|
||||
int main() {
|
||||
void show_help() {
|
||||
fprintf(stderr,
|
||||
"This program writes a file '%s' containing the distribution of\n"
|
||||
"host platforms (needed if you use homogeneous redundancy).\n"
|
||||
"This should be run ~once/day as a periodic task from config.xml.\n"
|
||||
"For more info, see http://boinc.berkeley.edu/trac/wiki/HomogeneousRedundancy",
|
||||
HR_INFO_FILENAME
|
||||
);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
HR_INFO hri;
|
||||
int retval;
|
||||
SCHED_CONFIG config;
|
||||
|
||||
for (int i=0; i<argc; i++) {
|
||||
if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) {
|
||||
show_help();
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
check_stop_daemons();
|
||||
retval = config.parse_file("..");
|
||||
if (retval) {
|
||||
|
|
|
@ -759,6 +759,14 @@ int ENUMERATION::make_it_happen(char* output_dir) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void show_help() {
|
||||
fprintf(stderr,
|
||||
"This program generates XML files containing project statistics.\n"
|
||||
"It should be run once a day as a periodic task in config.xml.\n"
|
||||
"For more info, see http://boinc.berkeley.edu/trac/wiki/DbDump\n"
|
||||
);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
SCHED_CONFIG config;
|
||||
int retval, i;
|
||||
|
@ -779,8 +787,11 @@ int main(int argc, char** argv) {
|
|||
log_messages.set_debug_level(atoi(argv[++i]));
|
||||
} else if (!strcmp(argv[i], "-db_host")) {
|
||||
db_host = argv[++i];
|
||||
} else if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) {
|
||||
show_help();
|
||||
exit(0);
|
||||
} else {
|
||||
log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL, "Usage: %s\n", argv[i]);
|
||||
log_messages.printf(SCHED_MSG_LOG::MSG_CRITICAL, "Bad arg: %s\n", argv[i]);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -416,7 +416,9 @@ bool volume_full(char* path) {
|
|||
double total, avail;
|
||||
int retval = get_filesystem_info(total, avail, path);
|
||||
if (retval) return false;
|
||||
if (avail<1e6) return true;
|
||||
if (avail<1e6) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -444,7 +446,7 @@ int handle_get_file_size(char* file_name) {
|
|||
// if the volume is full, report a transient error
|
||||
// to prevent the client from starting a transfer
|
||||
//
|
||||
if (volume_full(path)) {
|
||||
if (volume_full(config.upload_dir)) {
|
||||
return return_error(ERR_TRANSIENT, "Server is out of space");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue