From: Art Cancro Date: Sat, 4 Mar 2017 05:26:45 +0000 (-0500) Subject: style cleanup X-Git-Tag: v939~622 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=964604f73db61b2c82421eef207e05d0e9db0f82 style cleanup --- diff --git a/citadel/context.c b/citadel/context.c index 576e9359c..82ab97b43 100644 --- a/citadel/context.c +++ b/citadel/context.c @@ -102,7 +102,7 @@ int CtdlTerminateOtherSession (int session_num) aide = ( (CCC->user.axlevel >= AxAideU) || (CCC->internal_pgm) ) ; - CONM_syslog(LOG_DEBUG, "Locating session to kill\n"); + syslog(LOG_DEBUG, "Locating session to kill\n"); begin_critical_section(S_SESSION_TABLE); for (ccptr = ContextList; ccptr != NULL; ccptr = ccptr->next) { if (session_num == ccptr->cs_pid) { @@ -259,9 +259,9 @@ void terminate_idle_sessions(void) } end_critical_section(S_SESSION_TABLE); if (killed > 0) - CON_syslog(LOG_INFO, "Scheduled %d idle sessions for termination\n", killed); + syslog(LOG_INFO, "Scheduled %d idle sessions for termination\n", killed); if (longrunners > 0) - CON_syslog(LOG_INFO, "Didn't terminate %d protected idle sessions", longrunners); + syslog(LOG_INFO, "Didn't terminate %d protected idle sessions", longrunners); } @@ -278,10 +278,10 @@ void terminate_all_sessions(void) if (ccptr->client_socket != -1) { if (ccptr->IO != NULL) { - CON_syslog(LOG_INFO, "terminate_all_sessions() is murdering %s IO[%ld]CC[%d]", ccptr->curr_user, ccptr->IO->ID, ccptr->cs_pid); + syslog(LOG_INFO, "terminate_all_sessions() is murdering %s IO[%ld]CC[%d]", ccptr->curr_user, ccptr->IO->ID, ccptr->cs_pid); } else { - CON_syslog(LOG_INFO, "terminate_all_sessions() is murdering %s CC[%d]", ccptr->curr_user, ccptr->cs_pid); + syslog(LOG_INFO, "terminate_all_sessions() is murdering %s CC[%d]", ccptr->curr_user, ccptr->cs_pid); } close(ccptr->client_socket); ccptr->client_socket = -1; @@ -290,7 +290,7 @@ void terminate_all_sessions(void) } end_critical_section(S_SESSION_TABLE); if (killed > 0) { - CON_syslog(LOG_INFO, "Flushed %d stuck sessions\n", killed); + syslog(LOG_INFO, "Flushed %d stuck sessions\n", killed); } } @@ -303,14 +303,14 @@ void RemoveContext (CitContext *con) { const char *c; if (con == NULL) { - CONM_syslog(LOG_ERR, "WARNING: RemoveContext() called with NULL!"); + syslog(LOG_ERR, "WARNING: RemoveContext() called with NULL!"); return; } c = con->ServiceName; if (c == NULL) { c = "WTF?"; } - CON_syslog(LOG_DEBUG, "RemoveContext(%s) session %d", c, con->cs_pid); + syslog(LOG_DEBUG, "RemoveContext(%s) session %d", c, con->cs_pid); /// cit_backtrace(); /* Run any cleanup routines registered by loadable modules. @@ -323,7 +323,7 @@ void RemoveContext (CitContext *con) client_close(); /* If the client is still connected, blow 'em away. */ become_session(NULL); - CON_syslog(LOG_NOTICE, "[%3d]SRV[%s] Session ended.", con->cs_pid, c); + syslog(LOG_NOTICE, "[%3d]SRV[%s] Session ended.", con->cs_pid, c); /* * If the client is still connected, blow 'em away. @@ -331,7 +331,7 @@ void RemoveContext (CitContext *con) */ if (con->client_socket > 0) { - CON_syslog(LOG_NOTICE, "Closing socket %d", con->client_socket); + syslog(LOG_NOTICE, "Closing socket %d", con->client_socket); close(con->client_socket); } @@ -347,7 +347,7 @@ void RemoveContext (CitContext *con) free(con->cached_msglist); } - CONM_syslog(LOG_DEBUG, "Done with RemoveContext()"); + syslog(LOG_DEBUG, "Done with RemoveContext()"); } @@ -363,7 +363,7 @@ CitContext *CreateNewContext(void) { me = (CitContext *) malloc(sizeof(CitContext)); if (me == NULL) { - CONM_syslog(LOG_ALERT, "citserver: can't allocate memory!!\n"); + syslog(LOG_ALERT, "citserver: can't allocate memory!!\n"); return NULL; } memset(me, 0, sizeof(CitContext)); @@ -412,7 +412,7 @@ CitContext *CloneContext(CitContext *CloneMe) { me = (CitContext *) malloc(sizeof(CitContext)); if (me == NULL) { - CONM_syslog(LOG_ALERT, "citserver: can't allocate memory!!\n"); + syslog(LOG_ALERT, "citserver: can't allocate memory!!\n"); return NULL; } memcpy(me, CloneMe, sizeof(CitContext)); @@ -612,7 +612,7 @@ void CtdlFillSystemContext(CitContext *context, char *name) if (context->user.usernum == 0) { /* old system user with number 0, upgrade it */ context->user.usernum = get_new_user_number(); - CON_syslog(LOG_INFO, "Upgrading system user \"%s\" from user number 0 to user number %ld\n", context->user.fullname, context->user.usernum); + syslog(LOG_INFO, "Upgrading system user \"%s\" from user number 0 to user number %ld\n", context->user.fullname, context->user.usernum); /* add user to the database */ CtdlPutUser(&(context->user)); cdb_store(CDB_USERSBYNUMBER, &(context->user.usernum), sizeof(long), context->user.fullname, strlen(context->user.fullname)+1); @@ -646,7 +646,7 @@ void context_cleanup(void) rem = ptr->next; --num_sessions; - CON_syslog(LOG_DEBUG, "context_cleanup(): purging session %d\n", ptr->cs_pid); + syslog(LOG_DEBUG, "context_cleanup(): purging session %d\n", ptr->cs_pid); RemoveContext(ptr); free (ptr); ptr = rem; @@ -706,7 +706,7 @@ void dead_session_purge(int force) { * is allocated privately on this thread's stack. */ while (rem != NULL) { - CON_syslog(LOG_DEBUG, "dead_session_purge(): purging session %d, reason=%d\n", rem->cs_pid, rem->kill_me); + syslog(LOG_DEBUG, "dead_session_purge(): purging session %d, reason=%d\n", rem->cs_pid, rem->kill_me); RemoveContext(rem); ptr = rem; rem = rem->next; @@ -737,7 +737,7 @@ void InitializeMasterCC(void) { */ void set_async_waiting(struct CitContext *ccptr) { - CON_syslog(LOG_DEBUG, "Setting async_waiting flag for session %d\n", ccptr->cs_pid); + syslog(LOG_DEBUG, "Setting async_waiting flag for session %d\n", ccptr->cs_pid); if (ccptr->is_async) { ccptr->async_waiting++; if (ccptr->state == CON_IDLE) { diff --git a/citadel/database.c b/citadel/database.c index 977814d42..aec4a61f6 100644 --- a/citadel/database.c +++ b/citadel/database.c @@ -1,7 +1,7 @@ /* * This is a data store backend for the Citadel server which uses Berkeley DB. * - * Copyright (c) 1987-2016 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 version 3. @@ -213,7 +213,7 @@ void cdb_checkpoint(void) { int ret; - MARKM_syslog(LOG_DEBUG, "-- db checkpoint --"); + syslog(LOG_DEBUG, "-- db checkpoint --"); ret = dbenv->txn_checkpoint(dbenv, MAX_CHECKPOINT_KBYTES, MAX_CHECKPOINT_MINUTES, 0); if (ret != 0) { @@ -873,18 +873,6 @@ void cdb_trunc(int cdb) int SeentDebugEnabled = 0; -#define DBGLOG(LEVEL) if ((LEVEL != LOG_DEBUG) || (SeentDebugEnabled != 0)) -#define SEENM_syslog(LEVEL, FORMAT) \ - DBGLOG(LEVEL) syslog(LEVEL, \ - "%s[%ld]CC[%ld] SEEN[%s][%d] " FORMAT, \ - IOSTR, ioid, ccid, Facility, cType) - -#define SEEN_syslog(LEVEL, FORMAT, ...) \ - DBGLOG(LEVEL) syslog(LEVEL, \ - "%s[%ld]CC[%ld] SEEN[%s][%d] " FORMAT, \ - IOSTR, ioid, ccid, Facility, cType, \ - __VA_ARGS__) - time_t CheckIfAlreadySeen(const char *Facility, StrBuf *guid, time_t now, @@ -899,7 +887,7 @@ time_t CheckIfAlreadySeen(const char *Facility, if (cType != eWrite) { - SEEN_syslog(LOG_DEBUG, "Loading [%s]", ChrPtr(guid)); + syslog(LOG_DEBUG, "Loading [%s]", ChrPtr(guid)); cdbut = cdb_fetch(CDB_USETABLE, SKEY(guid)); if ((cdbut != NULL) && (cdbut->ptr != NULL)) { memcpy(&ut, cdbut->ptr, @@ -909,13 +897,13 @@ time_t CheckIfAlreadySeen(const char *Facility, if (InDBTimeStamp < antiexpire) { - SEEN_syslog(LOG_DEBUG, "Found - Not expired %ld < %ld", InDBTimeStamp, antiexpire); + syslog(LOG_DEBUG, "Found - Not expired %ld < %ld", InDBTimeStamp, antiexpire); cdb_free(cdbut); return InDBTimeStamp; } else { - SEEN_syslog(LOG_DEBUG, "Found - Expired. %ld >= %ld", InDBTimeStamp, antiexpire); + syslog(LOG_DEBUG, "Found - Expired. %ld >= %ld", InDBTimeStamp, antiexpire); cdb_free(cdbut); } } @@ -923,7 +911,7 @@ time_t CheckIfAlreadySeen(const char *Facility, { if (cdbut) cdb_free(cdbut); - SEENM_syslog(LOG_DEBUG, "not Found"); + syslog(LOG_DEBUG, "not Found"); if (cType == eCheckUpdate) return 0; } @@ -935,13 +923,13 @@ time_t CheckIfAlreadySeen(const char *Facility, memcpy(ut.ut_msgid, SKEY(guid)); ut.ut_timestamp = now; - SEENM_syslog(LOG_DEBUG, "Saving new Timestamp"); + syslog(LOG_DEBUG, "Saving new Timestamp"); /* rewrite the record anyway, to update the timestamp */ cdb_store(CDB_USETABLE, SKEY(guid), &ut, sizeof(struct UseTable) ); - SEENM_syslog(LOG_DEBUG, "Done Saving"); + syslog(LOG_DEBUG, "Done Saving"); return InDBTimeStamp; } diff --git a/citadel/event_client.c b/citadel/event_client.c index 4ab63a4a2..1d0fad542 100644 --- a/citadel/event_client.c +++ b/citadel/event_client.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2012 by the citadel.org team + * Copyright (c) 1998-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. @@ -109,11 +109,11 @@ eNextState QueueAnDBOperation(AsyncIO *IO) { /* shutting down... */ free(h); - EVM_syslog(LOG_DEBUG, "DBEVENT Q exiting.\n"); + syslog(LOG_DEBUG, "DBEVENT Q exiting.\n"); pthread_mutex_unlock(&DBEventQueueMutex); return eAbort; } - EVM_syslog(LOG_DEBUG, "DBEVENT Q\n"); + syslog(LOG_DEBUG, "DBEVENT Q\n"); i = ++evdb_count ; Put(DBInboundEventQueue, IKEY(i), h, NULL); pthread_mutex_unlock(&DBEventQueueMutex); @@ -127,7 +127,7 @@ eNextState QueueAnDBOperation(AsyncIO *IO) ev_async_send (event_db, &DBAddJob); pthread_mutex_unlock(&DBEventExitQueueMutex); - EVQM_syslog(LOG_DEBUG, "DBEVENT Q Done.\n"); + syslog(LOG_DEBUG, "DBEVENT Q Done.\n"); return eDBQuery; } @@ -144,7 +144,7 @@ void ShutDownDBCLient(AsyncIO *IO) become_session(Ctx); SetEVState(IO, eDBTerm); - EVM_syslog(LOG_DEBUG, "DBEVENT Terminating.\n"); + syslog(LOG_DEBUG, "DBEVENT Terminating.\n"); StopDBWatchers(IO); assert(IO->DBTerminate); @@ -158,7 +158,7 @@ DB_PerformNext(struct ev_loop *loop, ev_idle *watcher, int revents) SetEVState(IO, eDBNext); SET_EV_TIME(IO, event_db); - EV_syslog(LOG_DEBUG, "%s()", __FUNCTION__); + syslog(LOG_DEBUG, "%s()", __FUNCTION__); become_session(IO->CitContext); ev_idle_stop(event_db, &IO->db_unwind_stack); @@ -220,7 +220,7 @@ static void IO_abort_shutdown_callback(struct ev_loop *loop, AsyncIO *IO = watcher->data; SetEVState(IO, eIOAbort); - EV_syslog(LOG_DEBUG, "EVENT Q: %s\n", __FUNCTION__); + syslog(LOG_DEBUG, "EVENT Q: %s\n", __FUNCTION__); SET_EV_TIME(IO, event_base); assert(IO->ShutdownAbort); IO->ShutdownAbort(IO); @@ -249,11 +249,11 @@ eNextState QueueAnEventContext(AsyncIO *IO) { free(h); /* shutting down... */ - EVM_syslog(LOG_DEBUG, "EVENT Q exiting.\n"); + syslog(LOG_DEBUG, "EVENT Q exiting.\n"); pthread_mutex_unlock(&EventQueueMutex); return eAbort; } - EVM_syslog(LOG_DEBUG, "EVENT Q\n"); + syslog(LOG_DEBUG, "EVENT Q\n"); i = ++evbase_count; Put(InboundEventQueue, IKEY(i), h, NULL); pthread_mutex_unlock(&EventQueueMutex); @@ -265,7 +265,7 @@ eNextState QueueAnEventContext(AsyncIO *IO) } ev_async_send (event_base, &AddJob); pthread_mutex_unlock(&EventExitQueueMutex); - EVM_syslog(LOG_DEBUG, "EVENT Q Done.\n"); + syslog(LOG_DEBUG, "EVENT Q Done.\n"); return eSendReply; } @@ -305,12 +305,12 @@ eNextState QueueCurlContext(AsyncIO *IO) { /* shutting down... */ free(h); - EVM_syslog(LOG_DEBUG, "EVENT Q exiting.\n"); + syslog(LOG_DEBUG, "EVENT Q exiting.\n"); pthread_mutex_unlock(&EventQueueMutex); return eAbort; } - EVM_syslog(LOG_DEBUG, "EVENT Q\n"); + syslog(LOG_DEBUG, "EVENT Q\n"); i = ++evbase_count; Put(InboundEventQueue, IKEY(i), h, NULL); pthread_mutex_unlock(&EventQueueMutex); @@ -323,7 +323,7 @@ eNextState QueueCurlContext(AsyncIO *IO) ev_async_send (event_base, &AddJob); pthread_mutex_unlock(&EventExitQueueMutex); - EVM_syslog(LOG_DEBUG, "EVENT Q Done.\n"); + syslog(LOG_DEBUG, "EVENT Q Done.\n"); return eSendReply; } @@ -357,7 +357,7 @@ void FreeAsyncIOContents(AsyncIO *IO) void DestructCAres(AsyncIO *IO); void StopClientWatchers(AsyncIO *IO, int CloseFD) { - EVM_syslog(LOG_DEBUG, "EVENT StopClientWatchers"); + syslog(LOG_DEBUG, "EVENT StopClientWatchers"); DestructCAres(IO); @@ -379,7 +379,7 @@ void StopClientWatchers(AsyncIO *IO, int CloseFD) void StopCurlWatchers(AsyncIO *IO) { - EVM_syslog(LOG_DEBUG, "EVENT StopCurlWatchers \n"); + syslog(LOG_DEBUG, "EVENT StopCurlWatchers \n"); ev_timer_stop (event_base, &IO->rw_timeout); ev_timer_stop(event_base, &IO->conn_fail); @@ -407,7 +407,7 @@ eNextState ShutDownCLient(AsyncIO *IO) SetEVState(IO, eExit); become_session(Ctx); - EVM_syslog(LOG_DEBUG, "EVENT Terminating \n"); + syslog(LOG_DEBUG, "EVENT Terminating \n"); StopClientWatchers(IO, 1); @@ -673,7 +673,7 @@ IO_send_callback(struct ev_loop *loop, ev_io *watcher, int revents) else if (rc < 0) { if (errno != EAGAIN) { StopClientWatchers(IO, 1); - EV_syslog(LOG_DEBUG, + syslog(LOG_DEBUG, "IO_send_callback(): Socket Invalid! [%d] [%s] [%d]\n", errno, strerror(errno), IO->SendBuf.fd); StrBufPrintf(IO->ErrMsg, @@ -814,7 +814,7 @@ IO_connestd_callback(struct ev_loop *loop, ev_io *watcher, int revents) SetEVState(IO, eIOConnNow); SET_EV_TIME(IO, event_base); - EVM_syslog(LOG_DEBUG, "connect() succeeded.\n"); + syslog(LOG_DEBUG, "connect() succeeded.\n"); ev_io_stop(loop, &IO->conn_event); ev_timer_stop(event_base, &IO->conn_fail); @@ -827,7 +827,7 @@ IO_connestd_callback(struct ev_loop *loop, ev_io *watcher, int revents) if ((err == 0) && (so_err != 0)) { - EV_syslog(LOG_DEBUG, "connect() failed [%d][%s]\n", + syslog(LOG_DEBUG, "connect() failed [%d][%s]\n", so_err, strerror(so_err)); IO_connfail_callback(loop, &IO->conn_fail, revents); @@ -835,7 +835,7 @@ IO_connestd_callback(struct ev_loop *loop, ev_io *watcher, int revents) } else { - EVM_syslog(LOG_DEBUG, "connect() succeeded\n"); + syslog(LOG_DEBUG, "connect() succeeded\n"); set_start_callback(loop, IO, revents); } } @@ -915,7 +915,7 @@ IO_recv_callback(struct ev_loop *loop, ev_io *watcher, int revents) if (errno != EAGAIN) { // FD is gone. kick it. StopClientWatchers(IO, 1); - EV_syslog(LOG_DEBUG, + syslog(LOG_DEBUG, "IO_recv_callback(): Socket Invalid! [%d] [%s] [%d]\n", errno, strerror(errno), IO->SendBuf.fd); StrBufPrintf(IO->ErrMsg, @@ -934,7 +934,7 @@ IO_postdns_callback(struct ev_loop *loop, ev_idle *watcher, int revents) SetEVState(IO, eCaresFinished); SET_EV_TIME(IO, event_base); - EV_syslog(LOG_DEBUG, "event: %s\n", __FUNCTION__); + syslog(LOG_DEBUG, "event: %s\n", __FUNCTION__); become_session(IO->CitContext); assert(IO->DNS.Query->PostDNS); switch (IO->DNS.Query->PostDNS(IO)) @@ -989,7 +989,7 @@ eNextState EvConnectSock(AsyncIO *IO, IPPROTO_TCP); if (IO->SendBuf.fd < 0) { - EV_syslog(LOG_ERR, + syslog(LOG_ERR, "EVENT: socket() failed: %s\n", strerror(errno)); @@ -1001,7 +1001,7 @@ eNextState EvConnectSock(AsyncIO *IO, } fdflags = fcntl(IO->SendBuf.fd, F_GETFL); if (fdflags < 0) { - EV_syslog(LOG_ERR, + syslog(LOG_ERR, "EVENT: unable to get socket %d flags! %s \n", IO->SendBuf.fd, strerror(errno)); @@ -1015,7 +1015,7 @@ eNextState EvConnectSock(AsyncIO *IO, } fdflags = fdflags | O_NONBLOCK; if (fcntl(IO->SendBuf.fd, F_SETFL, fdflags) < 0) { - EV_syslog( + syslog( LOG_ERR, "EVENT: unable to set socket %d nonblocking flags! %s \n", IO->SendBuf.fd, @@ -1076,13 +1076,13 @@ eNextState EvConnectSock(AsyncIO *IO, if (rc >= 0){ SetEVState(IO, eIOConnNow); - EV_syslog(LOG_DEBUG, "connect() = %d immediate success.\n", IO->SendBuf.fd); + syslog(LOG_DEBUG, "connect() = %d immediate success.\n", IO->SendBuf.fd); set_start_callback(event_base, IO, 0); return IO->NextState; } else if (errno == EINPROGRESS) { SetEVState(IO, eIOConnWait); - EV_syslog(LOG_DEBUG, "connect() = %d have to wait now.\n", IO->SendBuf.fd); + syslog(LOG_DEBUG, "connect() = %d have to wait now.\n", IO->SendBuf.fd); ev_io_init(&IO->conn_event, IO_connestd_callback, @@ -1102,7 +1102,7 @@ eNextState EvConnectSock(AsyncIO *IO, IO->conn_fail_immediate.data = IO; ev_idle_start(event_base, &IO->conn_fail_immediate); - EV_syslog(LOG_ERR, + syslog(LOG_ERR, "connect() = %d failed: %s\n", IO->SendBuf.fd, strerror(errno)); @@ -1176,7 +1176,7 @@ void InitIOStruct(AsyncIO *IO, IO->SendBuf.Buf = NewStrBufPlain(NULL, 1024); IO->RecvBuf.Buf = NewStrBufPlain(NULL, 1024); IO->IOBuf = NewStrBuf(); - EV_syslog(LOG_DEBUG, + syslog(LOG_DEBUG, "EVENT: Session lives at %p IO at %p \n", Data, IO); @@ -1220,7 +1220,7 @@ eNextState KillTerminate(AsyncIO *IO) { long id; KillOtherSessionContext *Ctx = (KillOtherSessionContext*)IO->Data; - EV_syslog(LOG_DEBUG, "%s Exit\n", __FUNCTION__); + syslog(LOG_DEBUG, "%s Exit\n", __FUNCTION__); id = IO->ID; FreeAsyncIOContents(IO); memset(Ctx, 0, sizeof(KillOtherSessionContext)); @@ -1315,10 +1315,10 @@ void EV_backtrace(AsyncIO *IO) strings = backtrace_symbols(stack_frames, size); for (i = 0; i < size; i++) { if (strings != NULL) { - EV_syslog(LOG_ALERT, " BT %s\n", strings[i]); + syslog(LOG_ALERT, " BT %s\n", strings[i]); } else { - EV_syslog(LOG_ALERT, " BT %p\n", stack_frames[i]); + syslog(LOG_ALERT, " BT %p\n", stack_frames[i]); } } free(strings); diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index d7473e852..c18f8b364 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -2,7 +2,7 @@ * This file contains functions which handle the mapping of Internet addresses * to users on the Citadel system. * - * 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 version 3. @@ -410,7 +410,6 @@ void remove_any_whitespace_to_the_left_or_right_of_at_symbol(char *name) */ int alias(char *name) { /* process alias and routing info for mail */ - struct CitContext *CCC = CC; FILE *fp; int a, i; char aaa[SIZ], bbb[SIZ]; @@ -460,7 +459,7 @@ int alias(char *name) } if (strcasecmp(original_name, name)) { - MSG_syslog(LOG_INFO, "%s is being forwarded to %s\n", original_name, name); + syslog(LOG_INFO, "%s is being forwarded to %s\n", original_name, name); } /* Change "user @ xxx" to "user" if xxx is an alias for this host */ @@ -468,7 +467,7 @@ int alias(char *name) if (name[a] == '@') { if (CtdlHostAlias(&name[a+1]) == hostalias_localhost) { name[a] = 0; - MSG_syslog(LOG_INFO, "Changed to <%s>\n", name); + syslog(LOG_INFO, "Changed to <%s>\n", name); break; } } @@ -621,7 +620,7 @@ recptypes *validate_recipients(const char *supplied_recipients, striplt(this_recp); if (IsEmptyStr(this_recp)) break; - MSG_syslog(LOG_DEBUG, "Evaluating recipient #%d: %s\n", num_recps, this_recp); + syslog(LOG_DEBUG, "Evaluating recipient #%d: %s\n", num_recps, this_recp); ++num_recps; strcpy(org_recp, this_recp); @@ -774,12 +773,12 @@ recptypes *validate_recipients(const char *supplied_recipients, strcpy(ret->errormsg, "No recipients specified."); } - MSGM_syslog(LOG_DEBUG, "validate_recipients()\n"); - MSG_syslog(LOG_DEBUG, " local: %d <%s>\n", ret->num_local, ret->recp_local); - MSG_syslog(LOG_DEBUG, " room: %d <%s>\n", ret->num_room, ret->recp_room); - MSG_syslog(LOG_DEBUG, " inet: %d <%s>\n", ret->num_internet, ret->recp_internet); - MSG_syslog(LOG_DEBUG, " ignet: %d <%s>\n", ret->num_ignet, ret->recp_ignet); - MSG_syslog(LOG_DEBUG, " error: %d <%s>\n", ret->num_error, ret->errormsg); + syslog(LOG_DEBUG, "validate_recipients()\n"); + syslog(LOG_DEBUG, " local: %d <%s>\n", ret->num_local, ret->recp_local); + syslog(LOG_DEBUG, " room: %d <%s>\n", ret->num_room, ret->recp_room); + syslog(LOG_DEBUG, " inet: %d <%s>\n", ret->num_internet, ret->recp_internet); + syslog(LOG_DEBUG, " ignet: %d <%s>\n", ret->num_ignet, ret->recp_ignet); + syslog(LOG_DEBUG, " error: %d <%s>\n", ret->num_error, ret->errormsg); free(recipients); return(ret); @@ -796,8 +795,7 @@ void free_recipients(recptypes *valid) { } if (valid->recptypes_magic != RECPTYPES_MAGIC) { - struct CitContext *CCC = CC; - MSGM_syslog(LOG_EMERG, "Attempt to call free_recipients() on some other data type!\n"); + syslog(LOG_EMERG, "Attempt to call free_recipients() on some other data type!\n"); abort(); } @@ -817,7 +815,6 @@ void free_recipients(recptypes *valid) { char *qp_encode_email_addrs(char *source) { - struct CitContext *CCC = CC; char *user, *node, *name; const char headerStr[] = "=?UTF-8?Q?"; char *Encoded; @@ -836,8 +833,7 @@ char *qp_encode_email_addrs(char *source) if (source == NULL) return source; if (IsEmptyStr(source)) return source; - if (MessageDebugEnabled != 0) cit_backtrace(); - MSG_syslog(LOG_DEBUG, "qp_encode_email_addrs: [%s]\n", source); + syslog(LOG_DEBUG, "qp_encode_email_addrs: [%s]\n", source); AddrPtr = malloc (sizeof (long) * nAddrPtrMax); AddrUtf8 = malloc (sizeof (long) * nAddrPtrMax); @@ -1176,7 +1172,6 @@ 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; @@ -1226,7 +1221,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); - MSG_syslog(LOG_DEBUG, "Converted to <%s@%s> (%s)\n", user, node, name); + 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)); @@ -1531,7 +1526,6 @@ 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])) { @@ -1540,7 +1534,7 @@ void directory_key(char *key, char *addr) { } key[keylen++] = 0; - MSG_syslog(LOG_DEBUG, "Directory key is <%s>\n", key); + syslog(LOG_DEBUG, "Directory key is <%s>\n", key); } @@ -1582,11 +1576,10 @@ 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; - MSG_syslog(LOG_DEBUG, "Create directory entry: %s --> %s\n", internet_addr, citadel_addr); + 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; @@ -1601,9 +1594,8 @@ int CtdlDirectoryAddUser(char *internet_addr, char *citadel_addr) { */ int CtdlDirectoryDelUser(char *internet_addr, char *citadel_addr) { char key[SIZ]; - struct CitContext *CCC = CC; - MSG_syslog(LOG_DEBUG, "Delete directory entry: %s --> %s\n", internet_addr, citadel_addr); + 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; } diff --git a/citadel/modules/ctdlproto/serv_ctdlproto.c b/citadel/modules/ctdlproto/serv_ctdlproto.c index 811fcb6dc..cf51e62c3 100644 --- a/citadel/modules/ctdlproto/serv_ctdlproto.c +++ b/citadel/modules/ctdlproto/serv_ctdlproto.c @@ -1,7 +1,7 @@ /* - * Citadel protocoll main dispatcher + * Citadel protocol main dispatcher * - * 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, version 3. @@ -28,19 +28,19 @@ void do_command_loop(void) { time(&CCC->lastcmd); memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */ if (client_getln(cmdbuf, sizeof cmdbuf) < 1) { - CTDLM_syslog(LOG_INFO, "Citadel client disconnected: ending session."); + syslog(LOG_INFO, "Citadel client disconnected: ending session."); CCC->kill_me = KILLME_CLIENT_DISCONNECTED; return; } /* Log the server command, but don't show passwords... */ if ( (strncasecmp(cmdbuf, "PASS", 4)) && (strncasecmp(cmdbuf, "SETP", 4)) ) { - CTDL_syslog(LOG_DEBUG, "[%s(%ld)] %s", + syslog(LOG_DEBUG, "[%s(%ld)] %s", CCC->curr_user, CCC->user.usernum, cmdbuf ); } else { - CTDL_syslog(LOG_DEBUG, "[%s(%ld)]