X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fnttlist.c;h=34d698442c08c6f3218ea80fe8d160eb0b31751c;hp=a38cd35db49d83216a367652595398f4d880418b;hb=964604f73db61b2c82421eef207e05d0e9db0f82;hpb=a21ccc76e93fe4f0cf95257c1e5fffe76fdb09d5 diff --git a/citadel/nttlist.c b/citadel/nttlist.c index a38cd35db..34d698442 100644 --- a/citadel/nttlist.c +++ b/citadel/nttlist.c @@ -2,7 +2,7 @@ * This module handles shared rooms, inter-Citadel mail, and outbound * mailing list processing. * - * Copyright (c) 2000-2012 by the citadel.org team + * Copyright (c) 2000-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. @@ -22,8 +22,6 @@ /*-----------------------------------------------------------------------------* * Network maps: evaluate other nodes * *-----------------------------------------------------------------------------*/ -int NTTDebugEnabled = 0; -int NTTDumpEnabled = 0; /* * network_talking_to() -- concurrency checker @@ -44,7 +42,7 @@ int CtdlNetworkTalkingTo(const char *nodename, long len, int operation) if (nttlist == NULL) nttlist = NewHash(1, NULL); Put(nttlist, nodename, len, NewStrBufPlain(nodename, len), HFreeStrBuf); - if (NTTDebugEnabled) syslog(LOG_DEBUG, "nttlist: added <%s>\n", nodename); + syslog(LOG_DEBUG, "nttlist: added <%s>\n", nodename); break; case NTT_REMOVE: if ((nttlist == NULL) || @@ -54,7 +52,7 @@ int CtdlNetworkTalkingTo(const char *nodename, long len, int operation) if (GetHashPosFromKey (nttlist, nodename, len, Pos)) DeleteEntryFromHash(nttlist, Pos); DeleteHashPos(&Pos); - if (NTTDebugEnabled) syslog(LOG_DEBUG, "nttlist: removed <%s>\n", nodename); + syslog(LOG_DEBUG, "nttlist: removed <%s>\n", nodename); break; @@ -64,33 +62,10 @@ int CtdlNetworkTalkingTo(const char *nodename, long len, int operation) break; if (GetHash(nttlist, nodename, len, &vdata)) retval ++; - if (NTTDebugEnabled) syslog(LOG_DEBUG, "nttlist: have [%d] <%s>\n", retval, nodename); + syslog(LOG_DEBUG, "nttlist: have [%d] <%s>\n", retval, nodename); break; } - if (NTTDumpEnabled) - { - HashPos *It; - StrBuf *NTTDump; - long len; - const char *Key; - void *v; - NTTDump = NewStrBuf (); - - It = GetNewHashPos(nttlist, 0); - while (GetNextHashPos(nttlist, It, &len, &Key, &v)) - { - if (StrLength(NTTDump) > 0) - StrBufAppendBufPlain(NTTDump, HKEY("|"), 0); - StrBufAppendBuf(NTTDump, (StrBuf*) v, 0); - } - DeleteHashPos(&It); - - syslog(LOG_DEBUG, "nttlist: Dump: [%d] <%s>\n", - GetCount(nttlist), - ChrPtr(NTTDump)); - FreeStrBuf(&NTTDump); - } end_critical_section(S_NTTLIST); return(retval); } @@ -104,20 +79,6 @@ void cleanup_nttlist(void) -/* - * Module entry point - */ -void SetNTTDebugEnabled(const int n) -{ - NTTDebugEnabled = n; -} - -void SetNTTDumpEnabled(const int n) -{ - NTTDumpEnabled = n; -} - - /* * Module entry point @@ -126,9 +87,6 @@ CTDL_MODULE_INIT(nttlist) { if (!threading) { - CtdlRegisterDebugFlagHook(HKEY("networktalkingto"), SetNTTDebugEnabled, &NTTDebugEnabled); - CtdlRegisterDebugFlagHook(HKEY("dumpnetworktalkingto"), SetNTTDumpEnabled, &NTTDumpEnabled); - CtdlRegisterCleanupHook(cleanup_nttlist); } return "nttlist";