]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_extensions.c
* sending the startup-problem-message now does work.
[citadel.git] / citadel / serv_extensions.c
index 3cbc5b9069d01469a50ace56f7f30ae87b90f35e..ced004cc4859c9b8b7074820cae426162bd219dd 100644 (file)
@@ -58,10 +58,10 @@ static char *portlist = NULL;
 static size_t nSizPort = 0;
 
 static char *errormessages = NULL;
-static size_t nSizErrmsg = 0;
+size_t nSizErrmsg = 0;
 
 
-static long   DetailErrorFlags;
+long   DetailErrorFlags;
 
 char *ErrSubject = "Startup Problems";
 char *ErrGeneral = "Citadel had trouble on starting up. %s This means, citadel won't be the service provider for a specific service you configured it to.\n\n"
@@ -107,6 +107,8 @@ void LogPrintMessages(long err)
 
        snprintf(Message, n * SIZ, ErrGeneral, Short, Where, List, Hint, DetailList);
 
+       lprintf(0,Message);
+       lprintf(0,ErrSubject);
        quickie_message("Citadel", NULL, NULL, AIDEROOM, Message, FMT_FIXED, ErrSubject);
        if (errormessages!=NULL) free (errormessages);
        errormessages = NULL;
@@ -776,11 +778,11 @@ void CtdlDestroyXmsgHooks(void)
 
 
 void CtdlRegisterServiceHook(int tcp_port,
-                       char *sockpath,
-                       void (*h_greeting_function) (void),
-                       void (*h_command_function) (void),
-                       void (*h_async_function) (void)
-                       )
+                            char *sockpath,
+                            void (*h_greeting_function) (void),
+                            void (*h_command_function) (void),
+                            void (*h_async_function) (void),
+                            const char *ServiceName)
 {
        struct ServiceFunctionHook *newfcn;
        char *message;
@@ -797,13 +799,14 @@ void CtdlRegisterServiceHook(int tcp_port,
        newfcn->h_greeting_function = h_greeting_function;
        newfcn->h_command_function = h_command_function;
        newfcn->h_async_function = h_async_function;
+       newfcn->ServiceName = ServiceName;
 
        if (sockpath != NULL) {
                newfcn->msock = ig_uds_server(sockpath, config.c_maxsessions, &error);
                snprintf(message, SIZ, "Unix domain socket '%s': ", sockpath);
        }
        else if (tcp_port <= 0) {       /* port -1 to disable */
-               lprintf(CTDL_INFO, "Service has been manually disabled, skipping\n");
+               lprintf(CTDL_INFO, "Service %s has been manually disabled, skipping\n", ServiceName);
                free (message);
                free(newfcn);
                return;
@@ -813,8 +816,8 @@ void CtdlRegisterServiceHook(int tcp_port,
                                              tcp_port,
                                              config.c_maxsessions, 
                                              &error);
-               snprintf(message, SIZ, "TCP port %s:%d: ", 
-                        config.c_ip_addr, tcp_port);
+               snprintf(message, SIZ, "TCP port %s:%d: (%s) ", 
+                        config.c_ip_addr, tcp_port, ServiceName);
        }
 
        if (newfcn->msock > 0) {