From 320f2c1b46a08add1e866be64a101329932b98d6 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sat, 4 Mar 2017 17:13:55 -0500 Subject: [PATCH] style cleanup --- citadel/modules/extnotify/extnotify_main.c | 8 +-- citadel/modules/imap/imap_acl.c | 3 +- citadel/modules/imap/imap_acl.h | 8 +-- citadel/modules/imap/imap_fetch.c | 21 +++---- citadel/modules/imap/imap_fetch.h | 20 +++---- citadel/modules/imap/imap_list.c | 4 +- citadel/modules/imap/imap_metadata.c | 24 ++++---- citadel/modules/imap/imap_metadata.h | 20 +++---- citadel/modules/imap/imap_misc.c | 6 +- citadel/modules/imap/imap_misc.h | 20 +++---- citadel/modules/imap/imap_search.h | 20 +++---- citadel/modules/imap/imap_store.h | 20 +++---- citadel/modules/imap/imap_tools.c | 13 ++--- citadel/modules/imap/serv_imap.c | 66 +++++++++------------- citadel/modules/imap/serv_imap.h | 12 ---- 15 files changed, 101 insertions(+), 164 deletions(-) diff --git a/citadel/modules/extnotify/extnotify_main.c b/citadel/modules/extnotify/extnotify_main.c index 097c9fef8..7bbad0503 100644 --- a/citadel/modules/extnotify/extnotify_main.c +++ b/citadel/modules/extnotify/extnotify_main.c @@ -174,7 +174,7 @@ eNotifyType extNotify_getConfigMessage(char *username, num_msgs = cdbfr->len / sizeof(long); cdb_free(cdbfr); } else { - MARKM_syslog(LOG_DEBUG, + syslog(LOG_DEBUG, "extNotify_getConfigMessage: " "No config messages found"); return eNone; /* No messages at all? No further action. */ @@ -392,7 +392,7 @@ void do_extnotify_queue(void) if (IsEmptyStr(CtdlGetConfigStr("c_pager_program")) && IsEmptyStr(CtdlGetConfigStr("c_funambol_host"))) { - MARKM_syslog(LOG_DEBUG, + syslog(LOG_DEBUG, "No external notifiers configured on system/user"); return; } @@ -409,7 +409,7 @@ void do_extnotify_queue(void) /* * Go ahead and run the queue */ - MARKM_syslog(LOG_DEBUG, "serv_extnotify: processing notify queue"); + syslog(LOG_DEBUG, "serv_extnotify: processing notify queue"); memset(&Ctx, 0, sizeof(NotifyContext)); if ((GetNotifyHosts(&Ctx) > 0) && @@ -426,7 +426,7 @@ void do_extnotify_queue(void) } CtdlForEachMessage(MSGS_ALL, 0L, NULL, SPOOLMIME, NULL, process_notify, &Ctx); - MARKM_syslog(LOG_DEBUG, "serv_extnotify: queue run completed"); + syslog(LOG_DEBUG, "serv_extnotify: queue run completed"); doing_queue = 0; if (Ctx.nNotifyHosts > 0) { diff --git a/citadel/modules/imap/imap_acl.c b/citadel/modules/imap/imap_acl.c index 207a32817..450d5ebf2 100644 --- a/citadel/modules/imap/imap_acl.c +++ b/citadel/modules/imap/imap_acl.c @@ -1,8 +1,7 @@ /* * Functions which implement RFC2086 (and maybe RFC4314) (IMAP ACL extension) * - * - * Copyright (c) 2007-2011 by the citadel.org team + * Copyright (c) 2007-2017 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/citadel/modules/imap/imap_acl.h b/citadel/modules/imap/imap_acl.h index 61b04f13a..a3b260513 100644 --- a/citadel/modules/imap/imap_acl.h +++ b/citadel/modules/imap/imap_acl.h @@ -1,19 +1,13 @@ /* - * Copyright (c) 2007-2012 by the citadel.org team + * Copyright (c) 2007-2017 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. - * - * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * - * - * */ void imap_setacl(int num_parms, ConstStr *Params); diff --git a/citadel/modules/imap/imap_fetch.c b/citadel/modules/imap/imap_fetch.c index 8fcd6bd81..2939f43d5 100644 --- a/citadel/modules/imap/imap_fetch.c +++ b/citadel/modules/imap/imap_fetch.c @@ -2,7 +2,7 @@ * Implements the FETCH command in IMAP. * This is a good example of the protocol's gratuitous complexity. * - * Copyright (c) 2001-2015 by the citadel.org team + * Copyright (c) 2001-2017 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -234,7 +234,7 @@ void imap_fetch_rfc822(long msgnum, const char *whichfmt) { text_size = 0; } - IMAP_syslog(LOG_DEBUG, + syslog(LOG_DEBUG, "RFC822: headers=" SIZE_T_FMT ", text=" SIZE_T_FMT ", total=" SIZE_T_FMT, @@ -278,12 +278,11 @@ void imap_load_part(char *name, char *filename, char *partnum, char *disp, void *content, char *cbtype, char *cbcharset, size_t length, char *encoding, char *cbid, void *cbuserdata) { - struct CitContext *CCC = CC; char mimebuf2[SIZ]; StrBuf *desired_section; desired_section = (StrBuf *)cbuserdata; - IMAP_syslog(LOG_DEBUG, "imap_load_part() looking for %s, found %s", + syslog(LOG_DEBUG, "imap_load_part() looking for %s, found %s", ChrPtr(desired_section), partnum ); @@ -666,9 +665,7 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) { if (strchr(ChrPtr(section), '[') != NULL) { StrBufStripAllBut(section, '[', ']'); } - IMAP_syslog(LOG_DEBUG, "Section is: [%s]", - (StrLength(section) == 0) ? "(empty)" : ChrPtr(section) - ); + syslog(LOG_DEBUG, "Section is: [%s]", (StrLength(section) == 0) ? "(empty)" : ChrPtr(section)); /* Burn the cache if we don't have the same section of the * same message again. @@ -700,7 +697,7 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) { is_partial = 1; } if ( (is_partial == 1) && (StrLength(partial) > 0) ) { - IMAP_syslog(LOG_DEBUG, "Partial is <%s>", ChrPtr(partial)); + syslog(LOG_DEBUG, "Partial is <%s>", ChrPtr(partial)); } if (Imap->cached_body == NULL) { @@ -1125,16 +1122,16 @@ void imap_do_fetch(citimap_command *Cmd) { /* debug output the parsed vector */ { int i; - IMAP_syslog(LOG_DEBUG, "----- %ld params", 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)) - IMAP_syslog(LOG_DEBUG, "*********** %ld != %ld : %s", + syslog(LOG_DEBUG, "*********** %ld != %ld : %s", Cmd->Params[i].len, strlen(Cmd->Params[i].Key), Cmd->Params[i].Key); else - IMAP_syslog(LOG_DEBUG, "%ld : %s", + syslog(LOG_DEBUG, "%ld : %s", Cmd->Params[i].len, Cmd->Params[i].Key); }} @@ -1457,7 +1454,7 @@ void imap_uidfetch(int num_parms, ConstStr *Params) { MakeStringOf(Cmd.CmdBuf, 4); #if 0 - IMAP_syslog(LOG_DEBUG, "-------%s--------", 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_fetch.h b/citadel/modules/imap/imap_fetch.h index 261e15995..7847fce53 100644 --- a/citadel/modules/imap/imap_fetch.h +++ b/citadel/modules/imap/imap_fetch.h @@ -1,19 +1,13 @@ /* - * Copyright (c) 2001-2012 by the citadel.org team + * Copyright (c) 2001-2017 by the citadel.org team * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * - * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ void imap_pick_range(const char *range, int is_uid); diff --git a/citadel/modules/imap/imap_list.c b/citadel/modules/imap/imap_list.c index 14cd0476e..4cf1ff5c8 100644 --- a/citadel/modules/imap/imap_list.c +++ b/citadel/modules/imap/imap_list.c @@ -1,7 +1,7 @@ /* * Implements the LIST and LSUB commands. * - * Copyright (c) 2000-2009 by Art Cancro and others. + * Copyright (c) 2000-2017 by Art Cancro and others. * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -378,7 +378,7 @@ void imap_list(int num_parms, ConstStr *Params) &Params[i], 1); - IMAP_syslog(LOG_DEBUG, "evaluating <%s>", 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_metadata.c b/citadel/modules/imap/imap_metadata.c index e9ea55ee9..4b3d1681c 100644 --- a/citadel/modules/imap/imap_metadata.c +++ b/citadel/modules/imap/imap_metadata.c @@ -3,21 +3,21 @@ * * This is an implementation of the Bynari variant of the METADATA extension. * - * Copyright (c) 2007-2009 by the citadel.org team + * Copyright (c) 2007-2017 by the citadel.org team * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ diff --git a/citadel/modules/imap/imap_metadata.h b/citadel/modules/imap/imap_metadata.h index b45d22a86..3f2a8bcbd 100644 --- a/citadel/modules/imap/imap_metadata.h +++ b/citadel/modules/imap/imap_metadata.h @@ -1,19 +1,13 @@ /* - * Copyright (c) 2007-2012 by the citadel.org team + * Copyright (c) 2007-2017 by the citadel.org team * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * - * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ void imap_getmetadata(int num_parms, ConstStr *Params); diff --git a/citadel/modules/imap/imap_misc.c b/citadel/modules/imap/imap_misc.c index 366526455..b966f87b4 100644 --- a/citadel/modules/imap/imap_misc.c +++ b/citadel/modules/imap/imap_misc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1987-2015 by the citadel.org team + * Copyright (c) 1987-2017 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -351,10 +351,10 @@ void imap_append(int num_parms, ConstStr *Params) { client_getln(dummy, sizeof dummy); /* Convert RFC822 newlines (CRLF) to Unix newlines (LF) */ - IMAPM_syslog(LOG_DEBUG, "Converting CRLF to LF"); + syslog(LOG_DEBUG, "Converting CRLF to LF"); StrBufToUnixLF(Imap->TransmittedMessage); - IMAPM_syslog(LOG_DEBUG, "Converting message format"); + 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_misc.h b/citadel/modules/imap/imap_misc.h index 1866bf9ff..d0dfa40b9 100644 --- a/citadel/modules/imap/imap_misc.h +++ b/citadel/modules/imap/imap_misc.h @@ -1,19 +1,13 @@ /* - * Copyright (c) 2001-2012 by the citadel.org team + * Copyright (c) 2001-2017 by the citadel.org team * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * - * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ void imap_copy(int num_parms, ConstStr *Params); diff --git a/citadel/modules/imap/imap_search.h b/citadel/modules/imap/imap_search.h index cfb1b9b58..ce2f27cea 100644 --- a/citadel/modules/imap/imap_search.h +++ b/citadel/modules/imap/imap_search.h @@ -1,19 +1,13 @@ /* - * Copyright (c) 2001-2012 by the citadel.org team + * Copyright (c) 2001-2017 by the citadel.org team * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * - * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ void imap_search(int num_parms, ConstStr *Params); diff --git a/citadel/modules/imap/imap_store.h b/citadel/modules/imap/imap_store.h index 26d270f00..cf47377aa 100644 --- a/citadel/modules/imap/imap_store.h +++ b/citadel/modules/imap/imap_store.h @@ -1,19 +1,13 @@ /* - * Copyright (c) 2001-2012 by the citadel.org team + * Copyright (c) 2001-2017 by the citadel.org team * - * This program is open source software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 3. - * - * + * This program is open source software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * - * - * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ void imap_store(int num_parms, ConstStr *Params); diff --git a/citadel/modules/imap/imap_tools.c b/citadel/modules/imap/imap_tools.c index f3ccee05c..f6839c9e8 100644 --- a/citadel/modules/imap/imap_tools.c +++ b/citadel/modules/imap/imap_tools.c @@ -1,7 +1,7 @@ /* * Utility functions for the IMAP module. * - * Copyright (c) 2001-2009 by the citadel.org team and others, except for + * Copyright (c) 2001-2017 by the citadel.org team and others, except for * most of the UTF7 and UTF8 handling code which was lifted from Evolution. * * This program is open source software; you can redistribute it and/or modify @@ -221,7 +221,7 @@ static char* toimap(char* destp, char* destend, char* src) *destp = 0; string_init(&dest, destp, destend-destp); - /* IMAP_syslog(LOG_DEBUG, "toimap %s", src); */ + /* syslog(LOG_DEBUG, "toimap %s", src); */ for (;;) { @@ -287,7 +287,7 @@ static char* toimap(char* destp, char* destend, char* src) if (state == 1) utf7_closeb64(&dest, v, i); - /* IMAP_syslog(LOG_DEBUG, " -> %s", destp); */ + /* syslog(LOG_DEBUG, " -> %s", destp); */ return string_end(&dest); } @@ -305,7 +305,7 @@ static char* fromimap(char* destp, char* destend, const char* src) *destp = 0; string_init(&dest, destp, destend-destp); - /* IMAP_syslog(LOG_DEBUG, "fromimap %s", src); */ + /* syslog(LOG_DEBUG, "fromimap %s", src); */ do { c = *p++; @@ -363,7 +363,7 @@ static char* fromimap(char* destp, char* destend, const char* src) } } while (c != '\0'); - /* IMAP_syslog(LOG_DEBUG, " -> %s", destp); */ + /* syslog(LOG_DEBUG, " -> %s", destp); */ return string_end(&dest); } @@ -606,7 +606,6 @@ long imap_mailboxname(char *buf, int bufsize, struct ctdlroom *qrbuf) int imap_roomname(char *rbuf, int bufsize, const char *foldername) { - struct CitContext *CCC = CC; int levels; char floorname[ROOMNAMELEN*2]; char roomname[ROOMNAMELEN]; @@ -683,7 +682,7 @@ int imap_roomname(char *rbuf, int bufsize, const char *foldername) ret = (0 | IR_MAILBOX); exit: - IMAP_syslog(LOG_DEBUG, "(That translates to \"%s\")", rbuf); + syslog(LOG_DEBUG, "(That translates to \"%s\")", rbuf); return(ret); } diff --git a/citadel/modules/imap/serv_imap.c b/citadel/modules/imap/serv_imap.c index 60584df27..33a3f3ba7 100644 --- a/citadel/modules/imap/serv_imap.c +++ b/citadel/modules/imap/serv_imap.c @@ -1,7 +1,7 @@ /* * IMAP server for the Citadel system * - * Copyright (C) 2000-2015 by Art Cancro and others. + * Copyright (C) 2000-2017 by Art Cancro and others. * This code is released under the terms of the GNU General Public License. * * WARNING: the IMAP protocol is badly designed. No implementation of it @@ -65,7 +65,6 @@ #include "imap_misc.h" #include "ctdl_module.h" -int IMAPDebugEnabled = 0; HashList *ImapCmds = NULL; void registerImapCMD(const char *First, long FLen, const char *Second, long SLen, @@ -109,33 +108,31 @@ const imap_handler_hook *imap_lookup(int num_parms, ConstStr *Params) StrBufPlain(Imap->Reply, CKEY(Params[1])); StrBufUpCase(Imap->Reply); - IMAP_syslog(LOG_DEBUG, "---- Looking up [%s] -----", - ChrPtr(Imap->Reply)); + syslog(LOG_DEBUG, "---- Looking up [%s] -----", ChrPtr(Imap->Reply)); if (GetHash(ImapCmds, SKEY(Imap->Reply), &v)) { - IMAPM_syslog(LOG_DEBUG, "Found."); + syslog(LOG_DEBUG, "Found."); FlushStrBuf(Imap->Reply); return (imap_handler_hook *) v; } if (num_parms == 1) { - IMAPM_syslog(LOG_DEBUG, "NOT Found."); + syslog(LOG_DEBUG, "NOT Found."); FlushStrBuf(Imap->Reply); return NULL; } - IMAP_syslog(LOG_DEBUG, "---- Looking up [%s] -----", - ChrPtr(Imap->Reply)); + syslog(LOG_DEBUG, "---- Looking up [%s] -----", ChrPtr(Imap->Reply)); StrBufAppendBufPlain(Imap->Reply, CKEY(Params[2]), 0); StrBufUpCase(Imap->Reply); if (GetHash(ImapCmds, SKEY(Imap->Reply), &v)) { - IMAPM_syslog(LOG_DEBUG, "Found."); + syslog(LOG_DEBUG, "Found."); FlushStrBuf(Imap->Reply); return (imap_handler_hook *) v; } - IMAPM_syslog(LOG_DEBUG, "NOT Found."); + syslog(LOG_DEBUG, "NOT Found."); FlushStrBuf(Imap->Reply); return NULL; } @@ -307,7 +304,7 @@ void imap_load_msgids(void) citimap *Imap = CCCIMAP; if (Imap->selected == 0) { - IMAPM_syslog(LOG_ERR, "imap_load_msgids() can't run; no room selected"); + syslog(LOG_ERR, "imap_load_msgids() can't run; no room selected"); return; } @@ -350,7 +347,7 @@ void imap_rescan_msgids(void) int num_recent = 0; if (Imap->selected == 0) { - IMAPM_syslog(LOG_ERR, "imap_load_msgids() can't run; no room selected"); + syslog(LOG_ERR, "imap_load_msgids() can't run; no room selected"); return; } @@ -482,7 +479,7 @@ void imap_cleanup_function(void) imap_do_expunge(); } - IMAPM_syslog(LOG_DEBUG, "Performing IMAP cleanup hook"); + syslog(LOG_DEBUG, "Performing IMAP cleanup hook"); imap_free_msgids(); imap_free_transmitted_message(); @@ -502,7 +499,7 @@ void imap_cleanup_function(void) FreeStrBuf(&Imap->Reply); if (Imap->Cmd.Params != NULL) free(Imap->Cmd.Params); free(Imap); - IMAPM_syslog(LOG_DEBUG, "Finished IMAP cleanup hook"); + syslog(LOG_DEBUG, "Finished IMAP cleanup hook"); } @@ -945,7 +942,7 @@ int imap_do_expunge(void) long *delmsgs = NULL; int num_delmsgs = 0; - IMAPM_syslog(LOG_DEBUG, "imap_do_expunge() called"); + syslog(LOG_DEBUG, "imap_do_expunge() called"); if (Imap->selected == 0) { return (0); } @@ -968,7 +965,7 @@ int imap_do_expunge(void) imap_rescan_msgids(); } - IMAP_syslog(LOG_DEBUG, "Expunged %d messages from <%s>", num_expunged, CC->room.QRname); + syslog(LOG_DEBUG, "Expunged %d messages from <%s>", num_expunged, CC->room.QRname); return (num_expunged); } @@ -1049,7 +1046,6 @@ void imap_namespace(int num_parms, ConstStr *Params) */ void imap_create(int num_parms, ConstStr *Params) { - struct CitContext *CCC = CC; int ret; char roomname[ROOMNAMELEN]; int floornum; @@ -1065,14 +1061,14 @@ void imap_create(int num_parms, ConstStr *Params) if (strchr(Params[2].Key, '\\') != NULL) { IReply("NO Invalid character in folder name"); - IMAPM_syslog(LOG_ERR, "invalid character in folder name"); + syslog(LOG_ERR, "invalid character in folder name"); return; } ret = imap_roomname(roomname, sizeof roomname, Params[2].Key); if (ret < 0) { IReply("NO Invalid mailbox name or location"); - IMAPM_syslog(LOG_ERR, "invalid mailbox name or location"); + syslog(LOG_ERR, "invalid mailbox name or location"); return; } floornum = (ret & 0x00ff); /* lower 8 bits = floor number */ @@ -1081,7 +1077,7 @@ void imap_create(int num_parms, ConstStr *Params) if (flags & IR_MAILBOX) { if (strncasecmp(Params[2].Key, "INBOX/", 6)) { IReply("NO Personal folders must be created under INBOX"); - IMAPM_syslog(LOG_ERR, "not subordinate to inbox"); + syslog(LOG_ERR, "not subordinate to inbox"); return; } } @@ -1094,7 +1090,7 @@ void imap_create(int num_parms, ConstStr *Params) newroomview = VIEW_BBS; } - IMAP_syslog(LOG_INFO, "Create new room <%s> on floor <%d> with type <%d>", + syslog(LOG_INFO, "Create new room <%s> on floor <%d> with type <%d>", roomname, floornum, newroomtype); ret = CtdlCreateRoom(roomname, newroomtype, "", floornum, 1, 0, newroomview); @@ -1116,7 +1112,7 @@ void imap_create(int num_parms, ConstStr *Params) CtdlAideMessage(notification_message, "Room Creation Message"); free(notification_message); } - IMAPM_syslog(LOG_DEBUG, "imap_create() completed"); + syslog(LOG_DEBUG, "imap_create() completed"); } @@ -1481,9 +1477,8 @@ void imap_rename(int num_parms, ConstStr *Params) irl->irl_newroom, irl->irl_newfloor); if (r != crr_ok) { - struct CitContext *CCC = CC; /* FIXME handle error returns better */ - IMAP_syslog(LOG_ERR, "CtdlRenameRoom() error %d", r); + syslog(LOG_ERR, "CtdlRenameRoom() error %d", r); } irlp = irl; irl = irl->next; @@ -1525,23 +1520,23 @@ void imap_command_loop(void) FlushStrBuf(Imap->Cmd.CmdBuf); if (CtdlClientGetLine(Imap->Cmd.CmdBuf) < 1) { - IMAPM_syslog(LOG_ERR, "client disconnected: ending session."); + syslog(LOG_ERR, "client disconnected: ending session."); CC->kill_me = KILLME_CLIENT_DISCONNECTED; return; } if (Imap->authstate == imap_as_expecting_password) { - IMAPM_syslog(LOG_INFO, ""); + syslog(LOG_INFO, ""); } else if (Imap->authstate == imap_as_expecting_plainauth) { - IMAPM_syslog(LOG_INFO, ""); + syslog(LOG_INFO, ""); } else if ((Imap->authstate == imap_as_expecting_multilineusername) || cbmstrcasestr(ChrPtr(Imap->Cmd.CmdBuf), " LOGIN ")) { - IMAPM_syslog(LOG_INFO, "LOGIN..."); + syslog(LOG_INFO, "LOGIN..."); } else { - IMAP_syslog(LOG_DEBUG, "%s", ChrPtr(Imap->Cmd.CmdBuf)); + syslog(LOG_DEBUG, "%s", ChrPtr(Imap->Cmd.CmdBuf)); } pchs = ChrPtr(Imap->Cmd.CmdBuf); @@ -1593,16 +1588,16 @@ void imap_command_loop(void) /* debug output the parsed vector */ { int i; - IMAP_syslog(LOG_DEBUG, "----- %ld params", Imap->Cmd.num_parms); + syslog(LOG_DEBUG, "----- %ld params", Imap->Cmd.num_parms); for (i=0; i < Imap->Cmd.num_parms; i++) { if (Imap->Cmd.Params[i].len != strlen(Imap->Cmd.Params[i].Key)) - IMAP_syslog(LOG_DEBUG, "*********** %ld != %ld : %s", + syslog(LOG_DEBUG, "*********** %ld != %ld : %s", Imap->Cmd.Params[i].len, strlen(Imap->Cmd.Params[i].Key), Imap->Cmd.Params[i].Key); else - IMAP_syslog(LOG_DEBUG, "%ld : %s", + syslog(LOG_DEBUG, "%ld : %s", Imap->Cmd.Params[i].len, Imap->Cmd.Params[i].Key); }} @@ -1655,7 +1650,7 @@ BAIL: gettimeofday(&tv2, NULL); total_time = (tv2.tv_usec + (tv2.tv_sec * 1000000)) - (tv1.tv_usec + (tv1.tv_sec * 1000000)); - IMAP_syslog(LOG_DEBUG, "IMAP command completed in %ld.%ld seconds", + syslog(LOG_DEBUG, "IMAP command completed in %ld.%ld seconds", (total_time / 1000000), (total_time % 1000000) ); @@ -1680,10 +1675,6 @@ void imap_logout(int num_parms, ConstStr *Params) const char *CitadelServiceIMAP="IMAP"; const char *CitadelServiceIMAPS="IMAPS"; -void SetIMAPDebugEnabled(const int n) -{ - IMAPDebugEnabled = n; -} /* * This function is called to register the IMAP extension with Citadel. */ @@ -1739,7 +1730,6 @@ CTDL_MODULE_INIT(imap) if (!threading) { - CtdlRegisterDebugFlagHook(HKEY("imapsrv"), SetIMAPDebugEnabled, &IMAPDebugEnabled); CtdlRegisterServiceHook(CtdlGetConfigInt("c_imap_port"), NULL, imap_greeting, imap_command_loop, NULL, CitadelServiceIMAP); #ifdef HAVE_OPENSSL diff --git a/citadel/modules/imap/serv_imap.h b/citadel/modules/imap/serv_imap.h index aa3ab2cde..bd5b93390 100644 --- a/citadel/modules/imap/serv_imap.h +++ b/citadel/modules/imap/serv_imap.h @@ -101,22 +101,10 @@ enum { #define FDELIM '\\' -extern int IMAPDebugEnabled; - #define IMAP ((citimap *)CC->session_specific_data) #define CCCIMAP ((citimap *)CCC->session_specific_data) #define IMAPDBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (IMAPDebugEnabled != 0)) -#define CCCID CCC->cs_pid -#define IMAP_syslog(LEVEL, FORMAT, ...) \ - IMAPDBGLOG(LEVEL) syslog(LEVEL, \ - "IMAP %s CC[%d] " FORMAT, \ - IOSTR, CCCID, __VA_ARGS__) - -#define IMAPM_syslog(LEVEL, FORMAT) \ - IMAPDBGLOG(LEVEL) syslog(LEVEL, \ - "IMAP %s CC[%d] " FORMAT, \ - IOSTR, CCCID) #define I_FLAG_NONE (0) #define I_FLAG_LOGGED_IN (1<<0) -- 2.30.2