Module: ngircd.git Branch: master Commit: 3600dc60fc54e4317b04ca5896515cf9913910c0 URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=3600d...
Author: Alexander Barton alex@barton.de Date: Fri Sep 10 21:11:25 2010 +0200
Output connection status when dumping the internal server state
---
src/ngircd/conn.c | 24 ++++++++++++++++++++++++ src/ngircd/conn.h | 4 ++++ src/ngircd/sighandlers.c | 1 + 3 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index e4851a9..d74f251 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -2184,4 +2184,28 @@ Conn_UsesSSL(CONN_ID Idx) #endif
+#ifdef DEBUG + +GLOBAL void +Conn_DebugDump(void) +{ + int i; + + Log(LOG_DEBUG, "Connection status:"); + for (i = 0; i < Pool_Size; i++) { + if (My_Connections[i].sock == NONE) + continue; + Log(LOG_DEBUG, + " - %d: host=%s, lastdata=%ld, lastping=%ld, delaytime=%ld, flag=%d, options=%d, bps=%d, client=%s", + My_Connections[i].sock, My_Connections[i].host, + My_Connections[i].lastdata, My_Connections[i].lastping, + My_Connections[i].delaytime, My_Connections[i].flag, + My_Connections[i].options, My_Connections[i].bps, + My_Connections[i].client ? Client_ID(My_Connections[i].client) : "-"); + } +} /* Conn_DumpClients */ + +#endif + + /* -eof- */ diff --git a/src/ngircd/conn.h b/src/ngircd/conn.h index a0bddaa..1e938ad 100644 --- a/src/ngircd/conn.h +++ b/src/ngircd/conn.h @@ -129,6 +129,10 @@ GLOBAL long Conn_Count PARAMS((void)); GLOBAL long Conn_CountMax PARAMS((void)); GLOBAL long Conn_CountAccepted PARAMS((void));
+#ifdef DEBUG +GLOBAL void Conn_DebugDump PARAMS((void)); +#endif + #endif
diff --git a/src/ngircd/sighandlers.c b/src/ngircd/sighandlers.c index cb12a84..57bf80f 100644 --- a/src/ngircd/sighandlers.c +++ b/src/ngircd/sighandlers.c @@ -46,6 +46,7 @@ Dump_State(void) Client_ID(Client_ThisServer())); Log(LOG_DEBUG, "time()=%ld", time(NULL)); Conf_DebugDump(); + Conn_DebugDump(); Client_DebugDump(); Log(LOG_DEBUG, "--- End of state dump ---"); } /* Dump_State */
ngircd-commits@lists.barton.de