]> code.citadel.org Git - citadel.git/blobdiff - citadel/citserver.c
* We now have a housekeeping thread and a housekeeping queue.
[citadel.git] / citadel / citserver.c
index 0bfb13af6608ab3913d2bf49bc71a8884a806495..195b42637de6052050b0c939813742fddc84a542 100644 (file)
@@ -28,8 +28,8 @@
 #include "housekeeping.h"
 #include "user_ops.h"
 #include "logging.h"
-#include "support.h"
 #include "msgbase.h"
+#include "support.h"
 #include "locate_host.h"
 #include "room_ops.h"
 #include "file_ops.h"
@@ -146,10 +146,8 @@ void cleanup_stuff(void *arg)
        lprintf(7, "cleanup_stuff() calling RemoveContext(%d)\n", CC->cs_pid);
        RemoveContext(CC);
 
-       /* While we still have an extra thread with no user attached to it,
-        * take the opportunity to do some housekeeping before exiting.
-        */
-       do_housekeeping();
+       /* Wake up the housekeeping thread */
+       enter_housekeeping_cmd("SCHED_SHUTDOWN");
        }
 
 
@@ -195,15 +193,14 @@ void CtdlAllocUserData(unsigned long requested_sym, size_t num_bytes)
 
        lprintf(9, "CtdlAllocUserData(%ld) called\n", requested_sym);
 
+       /* Fail silently if the symbol is already registered. */
        for (ptr = CC->FirstSessData; ptr != NULL; ptr = ptr->next)  {
                if (ptr->sym_id == requested_sym) {
-                       lprintf(2, "ERROR: CtdlAllocUserData() requested for"
-                               " symbol id %ld already registered\n", 
-                               requested_sym);
                        return;
                }
        }
 
+       /* Grab us some memory!  Dem's good eatin' !!  */
        ptr = mallok(sizeof(struct CtdlSessData));
        ptr->sym_id = requested_sym;
        ptr->sym_data = mallok(num_bytes);
@@ -433,6 +430,7 @@ void cmd_iden(char *argbuf)
        strncpy(CC->cs_clientname,desc,31);
        CC->cs_clientname[31] = 0;
 
+       lprintf(9, "Looking up hostname\n");
        if ((strlen(from_host)>0) && 
           (is_public_client(CC->cs_host))) {
                if (inet_aton(from_host, &addr))
@@ -442,6 +440,8 @@ void cmd_iden(char *argbuf)
                        CC->cs_host[24] = 0;
                        }
                }
+
+       lprintf(9, "Setting wtmpsupp\n");
        set_wtmpsupp_to_current_room();
 
        syslog(LOG_NOTICE,"client %d/%d/%01d.%02d (%s)\n",
@@ -751,6 +751,7 @@ void cmd_ipgm(char *argbuf)
                }
        else {
                cprintf("%d Authentication failed.\n",ERROR);
+               lprintf(3, "Warning: ipgm authentication failed.\n");
                }
        }
 
@@ -760,7 +761,7 @@ void cmd_ipgm(char *argbuf)
  */
 void cmd_down(void) {
        if (!CC->logged_in) {
-               cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
+               cprintf("%d Not logged in.\n", ERROR+NOT_LOGGED_IN);
                return;
                }
 
@@ -1058,10 +1059,6 @@ void *context_loop(struct CitContext *con)
                        cmd_gnur();
                        }
 
-               else if (!strncasecmp(cmdbuf,"GREG",4)) {
-                       cmd_greg(&cmdbuf[5]);
-                       }
-
                else if (!strncasecmp(cmdbuf,"VALI",4)) {
                        cmd_vali(&cmdbuf[5]);
                        }
@@ -1074,10 +1071,6 @@ void *context_loop(struct CitContext *con)
                        cmd_list();
                        }
 
-               else if (!strncasecmp(cmdbuf,"REGI",4)) {
-                       cmd_regi();
-                       }
-
                else if (!strncasecmp(cmdbuf,"CHEK",4)) {
                        cmd_chek();
                        }