X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=apps%2Fsilcd%2Fserver.c;h=cf5ddde8a3c2f1cb4a774b270240e9a459597f45;hp=2c3875a5c12bc8826866dcbfbe418621fddc5a20;hb=816a5b080c797c0db47b7b274a85646343c3466e;hpb=c257b555225193e54d85daf541d29578b3c93882 diff --git a/apps/silcd/server.c b/apps/silcd/server.c index 2c3875a5..cf5ddde8 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -278,7 +278,7 @@ bool silc_server_init_secondary(SilcServer server) bool silc_server_init(SilcServer server) { - int sock; + int sock = -1; SilcServerID *id; SilcServerEntry id_entry; SilcIDListPurge purge; @@ -343,22 +343,22 @@ bool silc_server_init(SilcServer server) /* Initialize ID caches */ server->local_list->clients = silc_idcache_alloc(0, SILC_ID_CLIENT, silc_idlist_client_destructor, - FALSE, TRUE); + server, FALSE, TRUE); server->local_list->servers = - silc_idcache_alloc(0, SILC_ID_SERVER, NULL, FALSE, TRUE); + silc_idcache_alloc(0, SILC_ID_SERVER, NULL, NULL, FALSE, TRUE); server->local_list->channels = - silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL, FALSE, TRUE); + silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL, NULL, FALSE, TRUE); /* These are allocated for normal server as well as these hold some global information that the server has fetched from its router. For router these are used as they are supposed to be used on router. */ server->global_list->clients = silc_idcache_alloc(0, SILC_ID_CLIENT, silc_idlist_client_destructor, - FALSE, TRUE); + server, FALSE, TRUE); server->global_list->servers = - silc_idcache_alloc(0, SILC_ID_SERVER, NULL, FALSE, TRUE); + silc_idcache_alloc(0, SILC_ID_SERVER, NULL, NULL, FALSE, TRUE); server->global_list->channels = - silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL, FALSE, TRUE); + silc_idcache_alloc(0, SILC_ID_CHANNEL, NULL, NULL, FALSE, TRUE); /* Init watcher lists */ server->watcher_list = @@ -2862,6 +2862,7 @@ void silc_server_packet_parse_type(SilcServer server, */ if (packet->flags & SILC_PACKET_FLAG_LIST) break; + server->stat.commands_received++; silc_server_command_process(server, sock, packet); break; @@ -2873,6 +2874,7 @@ void silc_server_packet_parse_type(SilcServer server, */ if (packet->flags & SILC_PACKET_FLAG_LIST) break; + server->stat.commands_received++; silc_server_command_reply(server, sock, packet); break; @@ -5079,6 +5081,8 @@ void silc_server_announce_watches(SilcServer server, if (!client || !client->id) continue; + server->stat.commands_sent++; + idp = silc_id_payload_encode(client->id, SILC_ID_CLIENT); args = silc_buffer_alloc_size(2); silc_buffer_format(args, @@ -5718,6 +5722,7 @@ SILC_TASK_CALLBACK(silc_server_get_stats) if (!server->standalone) { SILC_LOG_DEBUG(("Retrieving stats from router")); + server->stat.commands_sent++; idp = silc_id_payload_encode(server->router->id, SILC_ID_SERVER); packet = silc_command_payload_encode_va(SILC_COMMAND_STATS, ++server->cmd_ident, 1,