]> code.citadel.org Git - citadel.git/blobdiff - citadel/sysdep.c
* Changed 'number of worker threads' from a sysconfig.h #define to an actual
[citadel.git] / citadel / sysdep.c
index a53f6353dd697535462f8bdee2bbb8861ce2acee..333319b9cfcec0c262cee6bd957ccd1027276761 100644 (file)
@@ -425,7 +425,7 @@ int client_read_to(char *buf, int bytes, int timeout)
        while(len<bytes) {
                FD_ZERO(&rfds);
                FD_SET(CC->client_socket, &rfds);
-               tv.tv_sec = 1;
+               tv.tv_sec = timeout;
                tv.tv_usec = 0;
 
                retval = select( (CC->client_socket)+1, 
@@ -635,7 +635,7 @@ int convert_login(char NameToConvert[]) {
  */
 void dead_session_purge(void) {
        struct CitContext *ptr, *rem;
-       
+
        if ( (time(NULL) - last_purge) < 5 ) return;    /* Too soon, go away */
        time(&last_purge);
 
@@ -652,7 +652,10 @@ void dead_session_purge(void) {
                /* RemoveContext() enters its own S_SESSION_TABLE critical
                 * section, so we have to do it like this.
                 */     
-               if (rem != NULL) RemoveContext(rem);
+               if (rem != NULL) {
+                       lprintf(9, "Purging session %d\n", rem->cs_pid);
+                       RemoveContext(rem);
+               }
 
        } while (rem != NULL);
 }
@@ -810,7 +813,7 @@ int main(int argc, char **argv)
        /*
         * Now create a bunch of worker threads.
         */
-       for (i=0; i<(NUM_WORKER_THREADS-1); ++i) {
+       for (i=0; i<(config.c_worker_threads-1); ++i) {
                pthread_attr_init(&attr);
                        pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
                if (pthread_create(&HousekeepingThread, &attr,