]> code.citadel.org Git - citadel.git/commitdiff
* lprintf() now logs the session ID for each log entry within a session.
authorMichael Hampton <io_error@uncensored.citadel.org>
Thu, 17 Jan 2002 10:32:14 +0000 (10:32 +0000)
committerMichael Hampton <io_error@uncensored.citadel.org>
Thu, 17 Jan 2002 10:32:14 +0000 (10:32 +0000)
  Also SMTP, IMAP, POP3 and Citadel protocol commands are differentiated.

citadel/ChangeLog
citadel/citserver.c
citadel/serv_crypto.c
citadel/serv_imap.c
citadel/serv_pop3.c
citadel/serv_smtp.c
citadel/sysdep.c

index 94baec7d52d5ca4679fe1d1e380cec36047bab3d..353cd73d36fb1e2c6417256109177ab5433c55b1 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 590.69  2002/01/17 10:32:14  error
+ * lprintf() now logs the session ID for each log entry within a session.
+   Also SMTP, IMAP, POP3 and Citadel protocol commands are differentiated.
+
  Revision 590.68  2002/01/17 10:16:09  error
  * migratenet.c: cygwin fix: include limits.h
 
@@ -3178,4 +3182,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index 0845f9201bc243b15cd45848b38e1cbae9f8ce1b..a41b91263031ba2bcb78b352f7147885749307d9 100644 (file)
@@ -66,6 +66,9 @@ char *unique_session_numbers;
 int ScheduledShutdown = 0;
 int do_defrag = 0;
 
+extern long int timezone;
+extern int daylight;
+
 /*
  * Various things that need to be initialized at startup
  */
@@ -203,7 +206,7 @@ void RemoveContext (struct CitContext *con)
 
        rec_log(CL_TERMINATE, con->curr_user);
        unlink(con->temp);
-       lprintf(3, "citserver[%3d]: ended.\n", con->cs_pid);
+       lprintf(3, "[%3d] session ended.\n", con->cs_pid);
        
 
        syslog(LOG_NOTICE,"session %d: ended", con->cs_pid);
@@ -352,8 +355,9 @@ void cmd_time(void)
    time_t tv;
    
    tv = time(NULL);
+   localtime(&tv);
    
-   cprintf("%d %ld\n", OK, (long)tv);
+   cprintf("%d %ld|%ld|%d\n", OK, (long)tv, timezone, daylight);
 }
 
 /*
@@ -839,7 +843,7 @@ void begin_session(struct CitContext *con)
        if ((config.c_maxsessions > 0)&&(num_sessions > config.c_maxsessions))
                con->nologin = 1;
 
-       lprintf(3, "citserver[%3d]: started.\n", con->cs_pid);
+       lprintf(3, "[%3d] session started.\n", con->cs_pid);
 
        /* Run any session startup routines registered by loadable modules */
        PerformSessionHooks(EVT_START);
@@ -877,7 +881,7 @@ void do_command_loop(void) {
                CC->kill_me = 1;
                return;
        }
-       lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
+       lprintf(5, "Citadel: %s\n", cmdbuf);
 
        /*
         * Let other clients see the last command we executed, and
index 5adcc6a7e83b5d6886567653e5207ac222c32364..39131ecd5a847e0eb8d39c107dca6f91a595be4f 100644 (file)
@@ -266,7 +266,7 @@ void cmd_stls(char *params)
        }
        BIO_set_close(CC->ssl->rbio, BIO_NOCLOSE);
        bits = SSL_CIPHER_get_bits(SSL_get_current_cipher(CC->ssl), &alg_bits);
-       lprintf(3, "Session %d using %s on %s (%d of %d bits)\n", CC->cs_pid,
+       lprintf(3, "SSL/TLS using %s on %s (%d of %d bits)\n",
                        SSL_CIPHER_get_name(SSL_get_current_cipher(CC->ssl)),
                        SSL_CIPHER_get_version(SSL_get_current_cipher(CC->ssl)),
                        bits, alg_bits);
@@ -316,7 +316,7 @@ void cmd_etls(char *params)
  */
 void endtls(int who)
 {
-       lprintf(7, "Session %d ending SSL/TLS%s\n", CC->cs_pid,
+       lprintf(7, "Ending SSL/TLS%s\n",
                        (who) ? "" : " at client request");
 
        if (!who) {
index c1489d5e057bdff88ad0217685ad75950b99159c..381649b9d47e4b689257e9d7d210a029b91aa514 100644 (file)
@@ -920,7 +920,7 @@ void imap_command_loop(void) {
                return;
        }
 
-       lprintf(5, "citserver[%3d]: %s\r\n", CC->cs_pid, cmdbuf);
+       lprintf(5, "IMAP: %s\r\n", cmdbuf);
        while (strlen(cmdbuf) < 5) strcat(cmdbuf, " ");
 
 
index 08350c5057cebf2ebb31e7f5cf7f685bcd090829..8cd9d62a3a3a4483911ae38b809d9105928b4fbf 100644 (file)
@@ -545,7 +545,7 @@ void pop3_command_loop(void) {
                CC->kill_me = 1;
                return;
        }
-       lprintf(5, "citserver[%3d]: %s\r\n", CC->cs_pid, cmdbuf);
+       lprintf(5, "POP3: %s\r\n", cmdbuf);
        while (strlen(cmdbuf) < 5) strcat(cmdbuf, " ");
 
        if (!strncasecmp(cmdbuf, "NOOP", 4)) {
index ef18e1a98c9a573121b26382888280c51998b79a..8cf616d86cb976f12ff1e50d9f7751c7c78e2d46 100644 (file)
@@ -572,7 +572,7 @@ void smtp_command_loop(void) {
                CC->kill_me = 1;
                return;
        }
-       lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
+       lprintf(5, "SMTP: %s\n", cmdbuf);
        while (strlen(cmdbuf) < 5) strcat(cmdbuf, " ");
 
        if (SMTP->command_state == smtp_user) {
index 3acb63d99d2e12f52552d664fe7b2bb4c378c262..9ba5f02871d96cdf93c9086bcb4a582402611c87 100644 (file)
@@ -118,10 +118,20 @@ void lprintf(int loglevel, const char *format, ...) {
                 * microsecond accuracy and your OS supports it, change
                 * %03ld to %06ld and remove " / 1000" after tv.tv_usec.
                 */
-               fprintf(stderr, "%04d/%02d/%02d %2d:%02d:%02d.%03ld %s",
-                       tim->tm_year + 1900, tim->tm_mon + 1, tim->tm_mday,
-                       tim->tm_hour, tim->tm_min, tim->tm_sec,
-                       (long)tv.tv_usec / 1000, buf);
+               if (CC) {
+                       fprintf(stderr,
+                               "%04d/%02d/%02d %2d:%02d:%02d.%03ld [%3d] %s",
+                               tim->tm_year + 1900, tim->tm_mon + 1,
+                               tim->tm_mday, tim->tm_hour, tim->tm_min,
+                               tim->tm_sec, (long)tv.tv_usec / 1000,
+                               CC->cs_pid, buf);
+               } else {
+                       fprintf(stderr,
+                               "%04d/%02d/%02d %2d:%02d:%02d.%03ld %s",
+                               tim->tm_year + 1900, tim->tm_mon + 1,
+                               tim->tm_mday, tim->tm_hour, tim->tm_min,
+                               tim->tm_sec, (long)tv.tv_usec / 1000, buf);
+               }
                fflush(stderr);
        }