]> code.citadel.org Git - citadel.git/blobdiff - citadel/sysdep.c
* The size constant "256" which shows up everywhere as a buffer size has now
[citadel.git] / citadel / sysdep.c
index e592b1415395bf3c76ed9a52ce337f6569f70f1f..a50bb0818fe0f7a9d3a8c561f0439d536aafb425 100644 (file)
@@ -461,7 +461,7 @@ void client_write(char *buf, int nbytes)
  */
 void cprintf(const char *format, ...) {   
         va_list arg_ptr;   
-        char buf[256];   
+        char buf[SIZ];   
    
         va_start(arg_ptr, format);   
         if (vsnprintf(buf, sizeof buf, format, arg_ptr) == -1)
@@ -636,7 +636,7 @@ void cmd_nset(char *cmdbuf)
        FILE *netsetup;
        int ch;
        int a, b;
-       char netsetup_args[3][256];
+       char netsetup_args[3][SIZ];
 
        if (CC->usersupp.axlevel < 6) {
                cprintf("%d Higher access required.\n", 
@@ -953,13 +953,11 @@ int main(int argc, char **argv)
         * Load any server-side modules (plugins) available here.
         */
        lprintf(7, "Initializing loadable modules\n");
-       cdb_begin_transaction();
        if ((moddir = malloc(strlen(bbs_home_directory) + 9)) != NULL) {
                sprintf(moddir, "%s/modules", bbs_home_directory);
                DLoader_Init(moddir);
                free(moddir);
        }
-       cdb_end_transaction();
 
        /*
         * The rescan pipe exists so that worker threads can be woken up and
@@ -997,11 +995,12 @@ int main(int argc, char **argv)
 
        /* We want to check for idle sessions once per minute */
        CtdlRegisterSessionHook(terminate_idle_sessions, EVT_TIMER);
-
+       
        /*
         * Now create a bunch of worker threads.
         */
        for (i=0; i<(config.c_min_workers-1); ++i) {
+               lprintf(9, "Creating worker thread %d\n", i);
                pthread_attr_init(&attr);
                        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
                if (pthread_create(&WorkerThread, &attr,
@@ -1011,7 +1010,9 @@ int main(int argc, char **argv)
                }
        }
 
+
        /* Now this thread can become a worker as well. */
+       lprintf(9, "Original thread entering worker loop\n");
        worker_thread();
 
        return(0);
@@ -1049,8 +1050,6 @@ void worker_thread(void) {
 
        while (!time_to_die) {
 
-               cdb_begin_transaction();
-
                /* 
                 * A naive implementation would have all idle threads
                 * calling select() and then they'd all wake up at once.  We
@@ -1192,8 +1191,6 @@ SETUP_FD: memcpy(&readfds, &masterfds, sizeof masterfds);
                }
 
                check_sched_shutdown();
-
-               cdb_end_transaction();
        }
 
        /* If control reaches this point, the server is shutting down */