From: Pekka Riikonen Date: Thu, 8 Jan 2009 19:58:39 +0000 (+0200) Subject: Added debug logs for updating stat.clients value X-Git-Tag: silc.client.1.1.7~5 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=9a3eb96ee8950fbce03b1e115e656960be189dfc Added debug logs for updating stat.clients value --- diff --git a/apps/silcd/command_reply.c b/apps/silcd/command_reply.c index 0b1645ec..b54126cf 100644 --- a/apps/silcd/command_reply.c +++ b/apps/silcd/command_reply.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2005, 2007 Pekka Riikonen + Copyright (C) 1997 - 2009 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1242,6 +1242,8 @@ SILC_SERVER_CMD_REPLY_FUNC(stats) SILC_STR_END); } + SILC_LOG_DEBUG(("stat.clients = %d\n", server->stat.clients)); + out: SILC_SERVER_PENDING_EXEC(cmd, SILC_COMMAND_STATS); err: diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index e776863e..0d96f7bb 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -326,6 +326,8 @@ static void silc_server_notify_process(SilcServer server, tmp_len = 128; /* Update statistics */ + SILC_LOG_DEBUG(("stat.clients %d->%d", server->stat.clients, + server->stat.clients - 1)); SILC_VERIFY(server->stat.clients > 0); server->stat.clients--; if (server->stat.cell_clients) @@ -1246,6 +1248,8 @@ static void silc_server_notify_process(SilcServer server, } /* Update statistics */ + SILC_LOG_DEBUG(("stat.clients %d->%d", server->stat.clients, + server->stat.clients - 1)); SILC_VERIFY(server->stat.clients > 0); server->stat.clients--; if (server->stat.cell_clients) @@ -1492,6 +1496,8 @@ static void silc_server_notify_process(SilcServer server, } /* Update statistics */ + SILC_LOG_DEBUG(("stat.clients %d->%d", server->stat.clients, + server->stat.clients - 1)); SILC_VERIFY(server->stat.clients > 0); server->stat.clients--; if (server->stat.cell_clients) @@ -2686,6 +2692,8 @@ static void silc_server_new_id_real(SilcServer server, if (idata->conn_type == SILC_CONN_SERVER) server->stat.cell_clients++; + SILC_LOG_DEBUG(("stat.clients %d->%d", server->stat.clients, + server->stat.clients + 1)); server->stat.clients++; /* Check if anyone is watching this nickname */ @@ -3742,6 +3750,8 @@ void silc_server_resume_client(SilcServer server, we decremented the count already during detach, thus we'd be undoing that operation. */ detached_client->local_detached = FALSE; + SILC_LOG_DEBUG(("stat.clients %d->%d", server->stat.clients, + server->stat.clients - 1)); SILC_VERIFY(server->stat.clients > 0); server->stat.clients--; if (server->stat.cell_clients) diff --git a/apps/silcd/server.c b/apps/silcd/server.c index 5120382a..0b0e24cd 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -2345,6 +2345,8 @@ silc_server_accept_auth_compl(SilcConnAuth connauth, SilcBool success, entry->data.conn_type = SILC_CONN_CLIENT; /* Statistics */ + SILC_LOG_DEBUG(("stat.clients %d->%d", server->stat.clients, + server->stat.clients + 1)); server->stat.my_clients++; server->stat.clients++; server->stat.cell_clients++; @@ -3154,6 +3156,8 @@ void silc_server_free_client_data(SilcServer server, /* Local detached clients aren't counted. */ if (!client->local_detached) server->stat.my_clients--; + SILC_LOG_DEBUG(("stat.clients %d->%d", server->stat.clients, + server->stat.clients - 1)); SILC_VERIFY(server->stat.clients > 0); server->stat.clients--; if (server->stat.cell_clients) @@ -3215,11 +3219,13 @@ void silc_server_free_sock_user_data(SilcServer server, if (idata->sconn && idata->sconn->op) { SILC_LOG_DEBUG(("Abort active protocol")); silc_async_abort(idata->sconn->op, NULL, NULL); + idata->sconn->op = NULL; } if (idata->conn_type == SILC_CONN_UNKNOWN && ((SilcUnknownEntry)idata)->op) { SILC_LOG_DEBUG(("Abort active protocol")); silc_async_abort(((SilcUnknownEntry)idata)->op, NULL, NULL); + idata->sconn->op = NULL; } } diff --git a/apps/silcd/server_util.c b/apps/silcd/server_util.c index b7b50617..1b8249a5 100644 --- a/apps/silcd/server_util.c +++ b/apps/silcd/server_util.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2008 Pekka Riikonen + Copyright (C) 1997 - 2009 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -205,6 +205,8 @@ SilcBool silc_server_remove_clients_by_server(SilcServer server, } /* Update statistics */ + SILC_LOG_DEBUG(("stat.clients %d->%d", server->stat.clients, + server->stat.clients - 1)); SILC_VERIFY(server->stat.clients > 0); server->stat.clients--; if (server->stat.cell_clients) @@ -269,6 +271,8 @@ SilcBool silc_server_remove_clients_by_server(SilcServer server, } /* Update statistics */ + SILC_LOG_DEBUG(("stat.clients %d->%d", server->stat.clients, + server->stat.clients - 1)); SILC_VERIFY(server->stat.clients > 0); server->stat.clients--; if (server->stat.cell_clients) @@ -1562,6 +1566,8 @@ void silc_server_kill_client(SilcServer server, } } else { /* Update statistics */ + SILC_LOG_DEBUG(("stat.clients %d->%d", server->stat.clients, + server->stat.clients - 1)); SILC_VERIFY(server->stat.clients > 0); server->stat.clients--; if (server->stat.cell_clients)