* setup.c: default value for maxsessions is now 0 (no limit)
authorArt Cancro <ajc@citadel.org>
Sat, 12 Dec 1998 00:14:20 +0000 (00:14 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 12 Dec 1998 00:14:20 +0000 (00:14 +0000)
        * room_ops.c: don't allow users to create a room called "Mail"
        * serv_expire.c: fixed "number of messages purged" display

citadel/ChangeLog
citadel/housekeeping.c
citadel/room_ops.c
citadel/serv_expire.c
citadel/serv_upgrade.c
citadel/setup.c

index 1ebf37aa7cb752de6b63a1aa0278ae6aa2d75aec..e3fd4d2000ee31a0d6d91ac5004954dac399efcf 100644 (file)
@@ -1,3 +1,8 @@
+Fri Dec 11 18:50:00 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * setup.c: default value for maxsessions is now 0 (no limit)
+       * room_ops.c: don't allow users to create a room called "Mail"
+       * serv_expire.c: fixed "number of messages purged" display
+
 Tue Dec  8 07:58:16 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Beta 2
 
index 42bab2eee3243e26675bdc9d960257c682efdaf7..e8c060c7bf0d075fa0e075fc81f02a332ea111b4 100644 (file)
 void terminate_idle_sessions(void) {
        struct CitContext *ccptr;
        time_t now;
-       
-       time(&now);
+
+START_OVER:
+       now = time(NULL);
        for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) {
                if (  (ccptr!=CC)
                   && (config.c_sleeping > 0)
                   && (now - (ccptr->lastcmd) > config.c_sleeping) ) {
-                       lprintf(3, "Session %d timed out\n", ccptr->cs_pid);
+                       lprintf(3, "Session %d timed out.  Terminating it...\n",
+                               ccptr->cs_pid);
                        kill_session(ccptr->cs_pid);
-                       ccptr = ContextList;
+                       lprintf(9, "...done terminating it.\n");
+                       goto START_OVER;
                        }
                }
        }
@@ -50,12 +53,14 @@ void terminate_idle_sessions(void) {
  */
 void do_housekeeping(void) {
 
+       lprintf(9, "--- begin housekeeping ---\n");
        begin_critical_section(S_HOUSEKEEPING);
        /*
         * Terminate idle sessions.
         */
        lprintf(7, "Calling terminate_idle_sessions()\n");
        terminate_idle_sessions();
+       lprintf(9, "Done with terminate_idle_sessions()\n");
 
        /*
         * If the server is scheduled to shut down the next time all
@@ -66,6 +71,7 @@ void do_housekeeping(void) {
                master_cleanup();
                }
        end_critical_section(S_HOUSEKEEPING);
+       lprintf(9, "--- end housekeeping ---\n");
        }
 
 
index 2dac9c90e950fdefbfbbd5a717af3a86bba2a921..f1bf82cb81d1799db551eeb8308d104ed8bebe96 100644 (file)
@@ -1316,6 +1316,12 @@ void cmd_cre8(char *args)
                return;
                }
 
+       if (!strcasecmp(new_room_name, MAILROOM)) {
+               cprintf("%d '%s' already exists.\n",
+                       ERROR+ALREADY_EXISTS, new_room_name);
+               return;
+               }
+
        if (num_parms(args)>=5) {
                getfloor(&flbuf,extract_int(args,4));
                if ((flbuf.f_flags & F_INUSE) == 0) {
@@ -1347,7 +1353,7 @@ void cmd_cre8(char *args)
        /* Check to make sure the requested room name doesn't already exist */
        if (getroom(&qrbuf, new_room_name)==0) {
                cprintf("%d '%s' already exists.\n",
-                       ERROR,qrbuf.QRname);
+                       ERROR+ALREADY_EXISTS, qrbuf.QRname);
                return;
                }
 
index 59cd938571f8c9740e1f2f4e1de5e4fcb9d7be48..271dbf2e92d1a786bcad6f3d60042a1711991aaf 100644 (file)
@@ -113,7 +113,6 @@ void DoPurgeMessages(struct quickroom *qrbuf) {
        char msgid[64];
        int a;
 
-       messages_purged = 0;
        time(&now);
        GetExpirePolicy(&epbuf, qrbuf);
        
@@ -157,9 +156,10 @@ void DoPurgeMessages(struct quickroom *qrbuf) {
 
                        if ((xtime > 0L)
                           && (now - xtime > (time_t)(epbuf.expire_value * 86400L))) {
+                               lprintf(5, "Expiring message %ld\n", delnum);
                                cdb_delete(CDB_MSGMAIN, &delnum, sizeof(long));
                                SetMessageInList(a, 0L);
-                               lprintf(5, "Expiring message %ld\n", delnum);
+                               ++messages_purged;
                                }
                        }
                }
@@ -170,6 +170,7 @@ void DoPurgeMessages(struct quickroom *qrbuf) {
 
 void PurgeMessages(void) {
        lprintf(5, "PurgeMessages() called\n");
+       messages_purged = 0;
        ForEachRoom(DoPurgeMessages);
        }
 
index 01c920c5889ae4eca3e9bb65066737c12f7643cd..ffa6a51e59f6ddf47753b2b1fe9bfbe565b68eb7 100644 (file)
@@ -486,6 +486,12 @@ void import_databases(void) {
 
 void do_import(char *argbuf) {
        char import_filename[PATH_MAX];
+
+        if (CC->internal_pgm == 0) {
+                cprintf("%d This command is for internal programs only.\n",
+                        ERROR);
+                return;
+                }
        
        extract(import_filename, argbuf, 0);
        imfp = fopen(import_filename, "rb");
@@ -654,6 +660,12 @@ void export_visits(void) {
 
 void do_export(char *argbuf) {
        char export_filename[PATH_MAX];
+
+        if (CC->internal_pgm == 0) {
+                cprintf("%d This command is for internal programs only.\n",
+                        ERROR);
+                return;
+                }
        
        extract(export_filename, argbuf, 0);
        exfp = fopen(export_filename, "wb");
index 2abb1de5d246ac525f78ac7e6364e27f4e746fcf..3af89468cc2be0449e51c1235ad6b227ebbdb10f 100644 (file)
@@ -855,10 +855,10 @@ int main(int argc, char *argv[]) {
                }
        
        /*
-        * Make sure that at least one concurrent session is allowed!
+        * Negative values for maxsessions are not allowed.
         */
-       if (config.c_maxsessions < 1) {
-               config.c_maxsessions = 1;
+       if (config.c_maxsessions < 0) {
+               config.c_maxsessions = 0;
                }
 
        /* We need a system default message expiry policy, because this is