more log silencing.
authorWilfried Goesgens <willi@arangodb.com>
Sat, 23 Jan 2016 16:42:48 +0000 (17:42 +0100)
committerWilfried Goesgens <willi@arangodb.com>
Sat, 23 Jan 2016 16:42:48 +0000 (17:42 +0100)
citadel/internet_addressing.c
citadel/modules/smtp/serv_smtpqueue.c
citadel/modules/smtp/smtp_util.c
citadel/modules/xmpp/xmpp_presence.c
citadel/modules/xmpp/xmpp_query_namespace.c
citadel/msgbase.c
citadel/room_ops.c

index 99b22d786ff7f73ec06a46cb2926c3a17b65d170..d7473e8529687a8eac87868bd3714aecb9568327 100644 (file)
@@ -1176,6 +1176,7 @@ void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name)
  * message text.
  */
 int convert_field(struct CtdlMessage *msg, const char *beg, const char *end) {
+       struct CitContext *CCC = CC;
        char *key, *value, *valueend;
        long len;
        const char *pos;
@@ -1225,7 +1226,7 @@ int convert_field(struct CtdlMessage *msg, const char *beg, const char *end) {
 
        else if (!strcasecmp(key, "From")) {
                process_rfc822_addr(value, user, node, name);
-               syslog(LOG_DEBUG, "Converted to <%s@%s> (%s)\n", user, node, name);
+               MSG_syslog(LOG_DEBUG, "Converted to <%s@%s> (%s)\n", user, node, name);
                snprintf(addr, sizeof(addr), "%s@%s", user, node);
                if (CM_IsEmpty(msg, eAuthor) && !IsEmptyStr(name))
                        CM_SetField(msg, eAuthor, name, strlen(name));
@@ -1530,6 +1531,7 @@ char *rfc822_fetch_field(const char *rfc822, const char *fieldname) {
 void directory_key(char *key, char *addr) {
        int i;
        int keylen = 0;
+       struct CitContext *CCC = CC;
 
        for (i=0; !IsEmptyStr(&addr[i]); ++i) {
                if (!isspace(addr[i])) {
@@ -1538,7 +1540,7 @@ void directory_key(char *key, char *addr) {
        }
        key[keylen++] = 0;
 
-       syslog(LOG_DEBUG, "Directory key is <%s>\n", key);
+       MSG_syslog(LOG_DEBUG, "Directory key is <%s>\n", key);
 }
 
 
@@ -1580,10 +1582,11 @@ void CtdlDirectoryInit(void) {
  */
 int CtdlDirectoryAddUser(char *internet_addr, char *citadel_addr) {
        char key[SIZ];
+       struct CitContext *CCC = CC;
 
        if (IsDirectory(internet_addr, 0) == 0) 
                return 0;
-       syslog(LOG_DEBUG, "Create directory entry: %s --> %s\n", internet_addr, citadel_addr);
+       MSG_syslog(LOG_DEBUG, "Create directory entry: %s --> %s\n", internet_addr, citadel_addr);
        directory_key(key, internet_addr);
        cdb_store(CDB_DIRECTORY, key, strlen(key), citadel_addr, strlen(citadel_addr)+1 );
        return 1;
@@ -1598,8 +1601,9 @@ int CtdlDirectoryAddUser(char *internet_addr, char *citadel_addr) {
  */
 int CtdlDirectoryDelUser(char *internet_addr, char *citadel_addr) {
        char key[SIZ];
-
-       syslog(LOG_DEBUG, "Delete directory entry: %s --> %s\n", internet_addr, citadel_addr);
+       struct CitContext *CCC = CC;
+       
+       MSG_syslog(LOG_DEBUG, "Delete directory entry: %s --> %s\n", internet_addr, citadel_addr);
        directory_key(key, internet_addr);
        return cdb_delete(CDB_DIRECTORY, key, strlen(key) ) == 0;
 }
index a7754616ed720fc46e27b7fcec44515172c6046f..59dcd64a403205ea16a3a31153148f663e69e347 100644 (file)
@@ -992,12 +992,12 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
                                nActivated++;
 
                                if (i > 1) n = MsgCount++;
-                               syslog(LOG_INFO,
-                                      "SMTPC: giving up on <%ld> <%s> %d / %d \n",
-                                      MyQItem->MessageID,
-                                      ChrPtr(ThisItem->Recipient),
-                                      i,
-                                      m);
+                               SMTPC_syslog(LOG_INFO,
+                                            "SMTPC: giving up on <%ld> <%s> %d / %d \n",
+                                            MyQItem->MessageID,
+                                            ChrPtr(ThisItem->Recipient),
+                                            i,
+                                            m);
                                (*((int*) userdata)) ++;
                                smtp_try_one_queue_entry(MyQItem,
                                                         ThisItem,
@@ -1034,12 +1034,12 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
                                        usleep(delay_msec);
 
                                if (i > 1) n = MsgCount++;
-                               syslog(LOG_DEBUG,
-                                      "SMTPC: Trying <%ld> <%s> %d / %d \n",
-                                      MyQItem->MessageID,
-                                      ChrPtr(ThisItem->Recipient),
-                                      i,
-                                      m);
+                               SMTPC_syslog(LOG_DEBUG,
+                                            "SMTPC: Trying <%ld> <%s> %d / %d \n",
+                                            MyQItem->MessageID,
+                                            ChrPtr(ThisItem->Recipient),
+                                            i,
+                                            m);
                                (*((int*) userdata)) ++;
                                smtp_try_one_queue_entry(MyQItem,
                                                         ThisItem,
index 1cca96e3afced7b091e5c96a7c65d051c3c1e209..7484cd5f4a18b0ede753bb629d1824e9b41cffdf 100644 (file)
@@ -81,6 +81,8 @@
 #include "ctdl_module.h"
 
 #include "smtp_util.h"
+#include "smtpqueue.h"
+#include "smtp_clienthandlers.h"
 
 const char *smtp_get_Recipients(void)
 {
@@ -119,7 +121,7 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
        StrBuf *BounceMB;
        long omsgid = (-1);
 
-       syslog(LOG_DEBUG, "smtp_do_bounce() called\n");
+       SMTPCM_syslog(LOG_DEBUG, "smtp_do_bounce() called");
        strcpy(bounceto, "");
        boundary = NewStrBufPlain(HKEY("=_Citadel_Multipart_"));
 
@@ -204,8 +206,8 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
                dsnlen = extract_token(dsn, buf, 3, '|', sizeof dsn);
                bounce_this = 0;
 
-               syslog(LOG_DEBUG, "key=<%s> addr=<%s> status=%d dsn=<%s>\n",
-                      key, addr, status, dsn);
+               SMTPC_syslog(LOG_DEBUG, "key=<%s> addr=<%s> status=%d dsn=<%s>",
+                            key, addr, status, dsn);
 
                if (!strcasecmp(key, "bounceto")) {
                        strcpy(bounceto, addr);
@@ -277,14 +279,16 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
        CM_SetAsFieldSB(bmsg, eMesageText, &BounceMB);
 
        /* Deliver the bounce if there's anything worth mentioning */
-       syslog(LOG_DEBUG, "num_bounces = %d\n", num_bounces);
+       SMTPC_syslog(LOG_DEBUG, "num_bounces = %d\n", num_bounces);
        if (num_bounces > 0) {
 
                /* First try the user who sent the message */
-               if (IsEmptyStr(bounceto))
-                       syslog(LOG_ERR, "No bounce address specified\n");
-               else
-                       syslog(LOG_DEBUG, "bounce to user <%s>\n", bounceto);
+               if (IsEmptyStr(bounceto)) {
+                       SMTPCM_syslog(LOG_ERR, "No bounce address specified");
+               }
+               else {
+                       SMTPC_syslog(LOG_DEBUG, "bounce to user <%s>", bounceto);
+               }
                /* Can we deliver the bounce to the original sender? */
                valid = validate_recipients(bounceto,
                                            smtp_get_Recipients (),
@@ -308,5 +312,5 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
        }
        FreeStrBuf(&boundary);
        CM_Free(bmsg);
-       syslog(LOG_DEBUG, "Done processing bounces\n");
+       SMTPCM_syslog(LOG_DEBUG, "Done processing bounces\n");
 }
index a3be435f73e7c3799e8c1ec4775aa61c0916b6d8..4c4fa9335c5ed578b8eceaa8f72fe300d3048099 100644 (file)
@@ -195,11 +195,11 @@ void xmpp_presence_notify(char *presence_jid, int event_type) {
                }
        }
 
-       syslog(LOG_DEBUG, "%d sessions for <%s> are now visible to session %d\n", visible_sessions, presence_jid, CC->cs_pid);
+       XMPP_syslog(LOG_DEBUG, "%d sessions for <%s> are now visible to session %d\n", visible_sessions, presence_jid, CC->cs_pid);
 
        if ( (event_type == XMPP_EVT_LOGIN) && (visible_sessions == 1) ) {
 
-               syslog(LOG_DEBUG, "Telling session %d that <%s> logged in\n", CC->cs_pid, presence_jid);
+               XMPP_syslog(LOG_DEBUG, "Telling session %d that <%s> logged in\n", CC->cs_pid, presence_jid);
 
                /* Do an unsolicited roster update that adds a new contact. */
                assert(which_cptr_is_relevant >= 0);
@@ -213,7 +213,7 @@ void xmpp_presence_notify(char *presence_jid, int event_type) {
        }
 
        if (visible_sessions == 0) {
-               syslog(LOG_DEBUG, "Telling session %d that <%s> logged out\n",
+               XMPP_syslog(LOG_DEBUG, "Telling session %d that <%s> logged out\n",
                            CC->cs_pid, presence_jid);
                xmpp_destroy_buddy(presence_jid, 0);    /* non aggressive presence update */
        }
@@ -270,7 +270,7 @@ void xmpp_fetch_mortuary_backend(long msgnum, void *userdata) {
 HashList *xmpp_fetch_mortuary(void) {
        HashList *mortuary = NewHash(1, NULL);
        if (!mortuary) {
-               syslog(LOG_ALERT, "NewHash() failed!\n");
+               XMPPM_syslog(LOG_ALERT, "NewHash() failed!\n");
                return(NULL);
        }
 
index 848fcc735897a79eceeab0c876098c399638155b..a517f2a5070f23c1e61d5bb61c13167a36fd835e 100644 (file)
@@ -78,7 +78,7 @@ void xmpp_iq_roster_query(void)
        struct CitContext *cptr;
        int nContexts, i;
 
-       syslog(LOG_DEBUG, "Roster push!");
+       XMPPM_syslog(LOG_DEBUG, "Roster push!");
        cprintf("<query xmlns=\"jabber:iq:roster\">");
        cptr = CtdlGetContextArray(&nContexts);
        if (cptr) {
index 42e83b68fc7884d67196b3b7dae7fdc4805360b4..2709a62fa2f1c9e607d00699bb8a8083826291ca 100644 (file)
@@ -3128,6 +3128,7 @@ void flood_protect_quickie_message(const char *from,
                                   long ioid,
                                   time_t NOW)
 {
+       struct CitContext *CCC = CC;
        int i;
        u_char rawdigest[MD5_DIGEST_LEN];
        struct MD5Context md5context;
@@ -3165,14 +3166,14 @@ void flood_protect_quickie_message(const char *from,
        {
                FreeStrBuf(&guid);
                /* yes, we did. flood protection kicks in. */
-               syslog(LOG_DEBUG,
-                      "not sending message again - %ld < %ld \n", seenstamp, tsday);
+               MSG_syslog(LOG_DEBUG,
+                          "not sending message again - %ld < %ld \n", seenstamp, tsday);
                return;
        }
        else
        {
-               syslog(LOG_DEBUG,
-                      "sending message. %ld >= %ld", seenstamp, tsday);
+               MSG_syslog(LOG_DEBUG,
+                          "sending message. %ld >= %ld", seenstamp, tsday);
                FreeStrBuf(&guid);
                /* no, this message isn't sent recently; go ahead. */
                quickie_message(from,
index 8d0a0d212ae01cbf86134e1409c76f79b818c53d..a018662d99a9ce332540b4b2e1ff42e75dd27f3c 100644 (file)
@@ -978,6 +978,7 @@ void convert_room_name_macros(char *towhere, size_t maxlen) {
  * in *at least* the old name!
  */
 int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
+       struct CitContext *CCC = CC;
        int old_floor = 0;
        struct ctdlroom qrbuf;
        struct ctdlroom qrtmp;
@@ -987,7 +988,7 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
        long owner = 0L;
        char actual_old_name[ROOMNAMELEN];
 
-       syslog(LOG_DEBUG, "CtdlRenameRoom(%s, %s, %d)", old_name, new_name, new_floor);
+       MSG_syslog(LOG_DEBUG, "CtdlRenameRoom(%s, %s, %d)", old_name, new_name, new_floor);
 
        if (new_floor >= 0) {
                fl = CtdlGetCachedFloor(new_floor);
@@ -1007,9 +1008,9 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
                ret = crr_room_not_found;
        }
 
-       else if ( (CC->user.axlevel < AxAideU) && (!CC->internal_pgm)
-                 && (CC->user.usernum != qrbuf.QRroomaide)
-                 && ( (((qrbuf.QRflags & QR_MAILBOX) == 0) || (atol(qrbuf.QRname) != CC->user.usernum))) )  {
+       else if ( (CCC->user.axlevel < AxAideU) && (!CCC->internal_pgm)
+                 && (CCC->user.usernum != qrbuf.QRroomaide)
+                 && ( (((qrbuf.QRflags & QR_MAILBOX) == 0) || (atol(qrbuf.QRname) != CCC->user.usernum))) )  {
                ret = crr_access_denied;
        }
 
@@ -1076,11 +1077,11 @@ int CtdlRenameRoom(char *old_name, char *new_name, int new_floor) {
                lgetfloor(&flbuf, old_floor);
                --flbuf.f_ref_count;
                lputfloor(&flbuf, old_floor);
-               syslog(LOG_DEBUG, "Reference count for floor %d is now %d", old_floor, flbuf.f_ref_count);
+               MSG_syslog(LOG_DEBUG, "Reference count for floor %d is now %d", old_floor, flbuf.f_ref_count);
                lgetfloor(&flbuf, new_floor);
                ++flbuf.f_ref_count;
                lputfloor(&flbuf, new_floor);
-               syslog(LOG_DEBUG, "Reference count for floor %d is now %d", new_floor, flbuf.f_ref_count);
+               MSG_syslog(LOG_DEBUG, "Reference count for floor %d is now %d", new_floor, flbuf.f_ref_count);
        }
 
        /* ...and everybody say "YATTA!" */