diff --git a/checkin_notes b/checkin_notes
index f8b7e8c1f2..b1d66b14c5 100755
--- a/checkin_notes
+++ b/checkin_notes
@@ -13733,3 +13733,10 @@ David 16 June 2004
boinc_gui.vcproj
boinc_guirpc_test.vcproj
+David 16 June 2004
+ - scheduler returns message to client in case of internal errors
+
+ sched/
+ main.C,h
+ handle_request.C
+
diff --git a/html/user/team_display.php b/html/user/team_display.php
index 622d1aca5a..c72d3b782a 100644
--- a/html/user/team_display.php
+++ b/html/user/team_display.php
@@ -5,8 +5,9 @@ $sort_by = $_GET["sort_by"];
if (!$sort_by) $sort_by = "expavg_credit";
$offset = $_GET["offset"];
if (!$offset) $offset=0;
+$teamid = $_GET["teamid"];
-$cache_args = "sort_by=$sort_by&offset=$offset";
+$cache_args = "teamid=$teamid&sort_by=$sort_by&offset=$offset";
start_cache(3600, $cache_args);
require_once("../inc/db.inc");
@@ -16,7 +17,6 @@ require_once("../inc/team.inc");
db_init();
$user = get_logged_in_user(false);
-$teamid = $_GET["teamid"];
$result = mysql_query("select * from team where id=$teamid");
if ($result) {
$team = mysql_fetch_object($result);
diff --git a/sched/handle_request.C b/sched/handle_request.C
index f656965416..038870c8aa 100644
--- a/sched/handle_request.C
+++ b/sched/handle_request.C
@@ -630,7 +630,7 @@ void process_request(
//
retval = open_database();
if (retval) {
- send_shut_message();
+ send_message("Server can't open database", 3600);
return;
}
diff --git a/sched/main.C b/sched/main.C
index 2be9e5c3b7..0e52efefc0 100644
--- a/sched/main.C
+++ b/sched/main.C
@@ -68,13 +68,14 @@ bool use_files = false; // use disk files for req/reply msgs (for debugging)
SCHED_CONFIG config;
key_t sema_key;
-void send_shut_message() {
+void send_message(char* msg, int delay) {
printf(
"Content-type: text/plain\n\n"
"\n"
- " Project is temporarily shut down for maintenance\n"
- " 3600\n"
- "\n"
+ " %s\n"
+ " %d\n"
+ "\n",
+ msg, delay
);
}
@@ -106,20 +107,22 @@ int main() {
get_log_path(path);
if (!freopen(path, "a", stderr)) {
fprintf(stderr, "Can't redirect stderr\n");
- exit(1);
+ send_message("Server can't open log file", 3600);
+ exit(0);
}
log_messages.set_debug_level(DEBUG_LEVEL);
if (check_stop_sched()) {
- send_shut_message();
+ send_message("Project is temporarily shut down for maintenance", 3600);
goto done;
}
retval = config.parse_file("..");
if (retval) {
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "Can't parse config file\n");
- exit(1);
+ send_message("Server can't parse configuration file", 3600);
+ exit(0);
}
sprintf(path, "%s/code_sign_public", config.key_dir);
@@ -128,7 +131,8 @@ int main() {
log_messages.printf(SCHED_MSG_LOG::CRITICAL,
"Can't read code sign key file (%s)\n", path
);
- exit(1);
+ send_message("Server can't find key file", 3600);
+ exit(0);
}
get_project_dir(path, sizeof(path));
@@ -147,7 +151,8 @@ int main() {
log_messages.printf(SCHED_MSG_LOG::CRITICAL,
"shmem has wrong struct sizes - recompile\n"
);
- exit(1);
+ send_message("Server has software problem", 3600);
+ exit(0);
}
for (i=0; i<10; i++) {
@@ -157,7 +162,8 @@ int main() {
}
if (!ssp->ready) {
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "feeder doesn't seem to be running\n");
- exit(1);
+ send_message("Server has software problem", 3600);
+ exit(0);
}
}
@@ -167,7 +173,7 @@ int main() {
counter++;
#endif
if (project_stopped) {
- send_shut_message();
+ send_message("Project is temporarily shut down for maintenance", 3600);
goto done;
}
printf("Content-type: text/plain\n\n");
diff --git a/sched/main.h b/sched/main.h
index ce43420e73..6668c61696 100644
--- a/sched/main.h
+++ b/sched/main.h
@@ -24,5 +24,5 @@
extern SCHED_CONFIG config;
extern key_t sema_key;
-extern void send_shut_message();
+extern void send_message(char*, int);
extern int open_database();