* 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.
/*-----------------------------------------------------------------------------*
* Network maps: evaluate other nodes *
*-----------------------------------------------------------------------------*/
-int NTTDebugEnabled = 0;
-int NTTDumpEnabled = 0;
/*
* network_talking_to() -- concurrency checker
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) ||
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;
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);
}
-/*
- * Module entry point
- */
-void SetNTTDebugEnabled(const int n)
-{
- NTTDebugEnabled = n;
-}
-
-void SetNTTDumpEnabled(const int n)
-{
- NTTDumpEnabled = n;
-}
-
-
/*
* Module entry point
{
if (!threading)
{
- CtdlRegisterDebugFlagHook(HKEY("networktalkingto"), SetNTTDebugEnabled, &NTTDebugEnabled);
- CtdlRegisterDebugFlagHook(HKEY("dumpnetworktalkingto"), SetNTTDumpEnabled, &NTTDumpEnabled);
-
CtdlRegisterCleanupHook(cleanup_nttlist);
}
return "nttlist";