From c793b3980c5c019211e077659847df7f09367a30 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 13 Mar 2011 03:50:01 -0400 Subject: [PATCH] Removed newlines from syslog in pop3 and imap modules --- citadel/modules/imap/imap_fetch.c | 17 ++++++++--------- citadel/modules/imap/imap_list.c | 2 +- citadel/modules/imap/imap_misc.c | 4 ++-- citadel/modules/imap/imap_tools.c | 10 +++++----- citadel/modules/pop3/serv_pop3.c | 14 +++++++------- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/citadel/modules/imap/imap_fetch.c b/citadel/modules/imap/imap_fetch.c index fa6cc0c84..db0fbeae8 100644 --- a/citadel/modules/imap/imap_fetch.c +++ b/citadel/modules/imap/imap_fetch.c @@ -243,7 +243,7 @@ void imap_fetch_rfc822(long msgnum, const char *whichfmt) { syslog(LOG_DEBUG, "RFC822: headers=" SIZE_T_FMT ", text=" SIZE_T_FMT - ", total=" SIZE_T_FMT "\n", + ", total=" SIZE_T_FMT, headers_size, text_size, total_size); if (!strcasecmp(whichfmt, "RFC822.SIZE")) { @@ -288,7 +288,7 @@ void imap_load_part(char *name, char *filename, char *partnum, char *disp, char *desired_section; desired_section = (char *)cbuserdata; - syslog(LOG_DEBUG, "imap_load_part() looking for %s, found %s\n", + syslog(LOG_DEBUG, "imap_load_part() looking for %s, found %s", desired_section, partnum ); @@ -671,7 +671,7 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) { if (strchr(ChrPtr(section), '[') != NULL) { StrBufStripAllBut(section, '[', ']'); } - syslog(LOG_DEBUG, "Section is: [%s]\n", + syslog(LOG_DEBUG, "Section is: [%s]", (StrLength(section) == 0) ? "(empty)" : ChrPtr(section) ); @@ -705,7 +705,7 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) { is_partial = 1; } if ( (is_partial == 1) && (StrLength(partial) > 0) ) { - syslog(LOG_DEBUG, "Partial is <%s>\n", ChrPtr(partial)); + syslog(LOG_DEBUG, "Partial is <%s>", ChrPtr(partial)); } if (Imap->cached_body == NULL) { @@ -1133,17 +1133,16 @@ void imap_do_fetch(citimap_command *Cmd) { /* debug output the parsed vector */ { int i; - syslog(LOG_DEBUG, "----- %ld params \n", - Cmd->num_parms); + syslog(LOG_DEBUG, "----- %ld params", Cmd->num_parms); for (i=0; i < Cmd->num_parms; i++) { if (Cmd->Params[i].len != strlen(Cmd->Params[i].Key)) - syslog(LOG_DEBUG, "*********** %ld != %ld : %s\n", + syslog(LOG_DEBUG, "*********** %ld != %ld : %s", Cmd->Params[i].len, strlen(Cmd->Params[i].Key), Cmd->Params[i].Key); else - syslog(LOG_DEBUG, "%ld : %s\n", + syslog(LOG_DEBUG, "%ld : %s", Cmd->Params[i].len, Cmd->Params[i].Key); }} @@ -1468,7 +1467,7 @@ void imap_uidfetch(int num_parms, ConstStr *Params) { MakeStringOf(Cmd.CmdBuf, 4); #if 0 - syslog(LOG_DEBUG, "-------%s--------\n", ChrPtr(Cmd.CmdBuf)); + syslog(LOG_DEBUG, "-------%s--------", ChrPtr(Cmd.CmdBuf)); #endif num_items = imap_extract_data_items(&Cmd); if (num_items < 1) { diff --git a/citadel/modules/imap/imap_list.c b/citadel/modules/imap/imap_list.c index 465c6ea40..49c19a666 100644 --- a/citadel/modules/imap/imap_list.c +++ b/citadel/modules/imap/imap_list.c @@ -377,7 +377,7 @@ void imap_list(int num_parms, ConstStr *Params) &Params[i], 1); - syslog(LOG_DEBUG, "evaluating <%s>\n", Params[i].Key); + syslog(LOG_DEBUG, "evaluating <%s>", Params[i].Key); if (!strcasecmp(Params[i].Key, "SUBSCRIBED")) { ImapFilter.return_subscribed = 1; diff --git a/citadel/modules/imap/imap_misc.c b/citadel/modules/imap/imap_misc.c index 14cc8afa9..203b75c3e 100644 --- a/citadel/modules/imap/imap_misc.c +++ b/citadel/modules/imap/imap_misc.c @@ -355,10 +355,10 @@ void imap_append(int num_parms, ConstStr *Params) { client_getln(dummy, sizeof dummy); /* Convert RFC822 newlines (CRLF) to Unix newlines (LF) */ - syslog(LOG_DEBUG, "Converting CRLF to LF\n"); + syslog(LOG_DEBUG, "Converting CRLF to LF"); StrBufToUnixLF(Imap->TransmittedMessage); - syslog(LOG_DEBUG, "Converting message format\n"); + syslog(LOG_DEBUG, "Converting message format"); msg = convert_internet_message_buf(&Imap->TransmittedMessage); ret = imap_grabroom(roomname, Params[2].Key, 1); diff --git a/citadel/modules/imap/imap_tools.c b/citadel/modules/imap/imap_tools.c index 28fb95948..cb99d7a67 100644 --- a/citadel/modules/imap/imap_tools.c +++ b/citadel/modules/imap/imap_tools.c @@ -225,7 +225,7 @@ static char* toimap(char* destp, char* destend, char* src) *destp = 0; string_init(&dest, destp, destend-destp); - /* syslog(LOG_DEBUG, "toimap %s\r\n", src); */ + /* syslog(LOG_DEBUG, "toimap %s", src); */ for (;;) { @@ -291,7 +291,7 @@ static char* toimap(char* destp, char* destend, char* src) if (state == 1) utf7_closeb64(&dest, v, i); - /* syslog(LOG_DEBUG, " -> %s\r\n", destp); */ + /* syslog(LOG_DEBUG, " -> %s", destp); */ return string_end(&dest); } @@ -309,7 +309,7 @@ static char* fromimap(char* destp, char* destend, const char* src) *destp = 0; string_init(&dest, destp, destend-destp); - /* syslog(LOG_DEBUG, "fromimap %s\r\n", src); */ + /* syslog(LOG_DEBUG, "fromimap %s", src); */ do { c = *p++; @@ -367,7 +367,7 @@ static char* fromimap(char* destp, char* destend, const char* src) } } while (c != '\0'); - /* syslog(LOG_DEBUG, " -> %s\r\n", destp); */ + /* syslog(LOG_DEBUG, " -> %s", destp); */ return string_end(&dest); } @@ -680,7 +680,7 @@ int imap_roomname(char *rbuf, int bufsize, const char *foldername) ret = (0 | IR_MAILBOX); exit: - syslog(LOG_DEBUG, "(That translates to \"%s\")\n", rbuf); + syslog(LOG_DEBUG, "(That translates to \"%s\")", rbuf); return(ret); } diff --git a/citadel/modules/pop3/serv_pop3.c b/citadel/modules/pop3/serv_pop3.c index 89bfef80e..ec98569c2 100644 --- a/citadel/modules/pop3/serv_pop3.c +++ b/citadel/modules/pop3/serv_pop3.c @@ -81,7 +81,7 @@ void pop3_cleanup_function(void) { /* Don't do this stuff if this is not a POP3 session! */ if (CC->h_command_function != pop3_command_loop) return; - syslog(LOG_DEBUG, "Performing POP3 cleanup hook\n"); + syslog(LOG_DEBUG, "Performing POP3 cleanup hook"); if (POP3->msgs != NULL) free(POP3->msgs); free(POP3); @@ -134,7 +134,7 @@ void pop3_user(char *argbuf) { strcpy(username, argbuf); striplt(username); - /* syslog(LOG_DEBUG, "Trying <%s>\n", username); */ + /* syslog(LOG_DEBUG, "Trying <%s>", username); */ if (CtdlLoginExistingUser(NULL, username) == login_ok) { cprintf("+OK Password required for %s\r\n", username); } @@ -212,7 +212,7 @@ void pop3_login(void) if (msgs >= 0) { cprintf("+OK %s is logged in (%d messages)\r\n", CC->user.fullname, msgs); - syslog(LOG_NOTICE, "POP3 authenticated %s\n", CC->user.fullname); + syslog(LOG_NOTICE, "POP3 authenticated %s", CC->user.fullname); } else { cprintf("-ERR Can't open your mailbox\r\n"); @@ -230,7 +230,7 @@ void pop3_pass(char *argbuf) { safestrncpy(password, argbuf, sizeof password); striplt(password); - /* syslog(LOG_DEBUG, "Trying <%s>\n", password); */ + /* syslog(LOG_DEBUG, "Trying <%s>", password); */ if (CtdlTryPassword(password, strlen(password)) == pass_ok) { pop3_login(); } @@ -569,15 +569,15 @@ void pop3_command_loop(void) { time(&CC->lastcmd); memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */ if (client_getln(cmdbuf, sizeof cmdbuf) < 1) { - syslog(LOG_ERR, "Client disconnected: ending session.\r\n"); + syslog(LOG_ERR, "Client disconnected: ending session."); CC->kill_me = 1; return; } if (!strncasecmp(cmdbuf, "PASS", 4)) { - syslog(LOG_INFO, "POP3: PASS...\r\n"); + syslog(LOG_INFO, "POP3: PASS..."); } else { - syslog(LOG_INFO, "POP3: %s\r\n", cmdbuf); + syslog(LOG_INFO, "POP3: %s", cmdbuf); } while (strlen(cmdbuf) < 5) strcat(cmdbuf, " "); -- 2.30.2