Also SMTP, IMAP, POP3 and Citadel protocol commands are differentiated.
$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
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
int ScheduledShutdown = 0;
int do_defrag = 0;
+extern long int timezone;
+extern int daylight;
+
/*
* Various things that need to be initialized at startup
*/
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);
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);
}
/*
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);
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
}
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);
*/
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) {
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, " ");
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)) {
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) {
* 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);
}