static int signalpipe[2];
+
+#ifdef DEBUG
+
+static void
+Dump_State(void)
+{
+ Log(LOG_DEBUG, "--- Internal server state: ---");
+ Log(LOG_DEBUG, "time()=%ld", time(NULL));
+ Conf_DebugDump();
+ Client_DebugDump();
+ Log(LOG_DEBUG, "--- End of state dump ---");
+} /* Dump_State */
+
+#endif
+
+
static void Signal_Block(int sig)
{
#ifdef HAVE_SIGPROCMASK
while (waitpid( -1, NULL, WNOHANG) > 0)
;
return;
+#ifdef DEBUG
+ case SIGUSR1:
+ if (! NGIRCd_Debug) {
+ Log(LOG_INFO|LOG_snotice,
+ "Got SIGUSR1, debug mode activated.");
+#ifdef SNIFFER
+ strcpy(NGIRCd_DebugLevel, "2");
+ NGIRCd_Debug = true;
+ NGIRCd_Sniffer = true;
+#else
+ strcpy(NGIRCd_DebugLevel, "1");
+ NGIRCd_Debug = true;
+#endif /* SNIFFER */
+ } else {
+ Log(LOG_INFO|LOG_snotice,
+ "Got SIGUSR1, debug mode deactivated.");
+ strcpy(NGIRCd_DebugLevel, "");
+ NGIRCd_Debug = false;
+#ifdef SNIFFER
+ NGIRCd_Sniffer = false;
+#endif /* SNIFFER */
+ }
+ return;
+#endif
}
/*
NGIRCd_Rehash();
break;
#ifdef DEBUG
+ case SIGUSR2:
+ if (NGIRCd_Debug)
+ Dump_State();
+ break;
default:
Log(LOG_DEBUG, "Got signal %d! Ignored.", Signal);
#endif