Author: Pekka Riikonen <priikone@silcnet.org>
- 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
#include "serverincludes.h"
#include "server_internal.h"
-#include <assert.h>
extern char *server_version;
if (!client)
return;
- SILC_LOG_DEBUG(("Remove client %s from all channels",
- client->nickname ? client->nickname :
+ SILC_LOG_DEBUG(("Remove client %p %s from all channels",
+ client, client->nickname ? client->nickname :
(unsigned char *)""));
if (silc_hash_table_find(clients, client, NULL, NULL))
silc_hash_table_add(channels, channel, channel);
}
silc_hash_table_list_reset(&htl);
- assert(!silc_hash_table_count(client->channels));
+ SILC_VERIFY(!silc_hash_table_count(client->channels));
}
/* This function removes all client entries that are originated from
}
/* Update statistics */
- assert(server->stat.clients > 0);
+ 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)
server->stat.cell_clients--;
}
/* Update statistics */
- assert(server->stat.clients > 0);
+ 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)
server->stat.cell_clients--;
SilcSKRKey key;
if (keys) {
+ SILC_LOG_DEBUG(("Found %d keys", silc_dlist_count(keys)));
silc_dlist_start(keys);
key = silc_dlist_get(keys);
*public_key = key->key;
SilcClientEntry client)
{
SilcCipher key;
+ SilcHmac hmac;
SILC_LOG_DEBUG(("Send welcome notifys"));
server->stat.my_router_ops +
server->stat.my_server_ops));
- silc_packet_get_keys(sock, &key, NULL, NULL, NULL);
+ silc_packet_get_keys(sock, &key, NULL, &hmac, NULL);
SILC_SERVER_SEND_NOTIFY(server, sock, SILC_NOTIFY_TYPE_NONE,
- ("Your connection is secured with %s cipher, "
- "key length %d bits",
+ ("Your connection is secured with %s cipher "
+ "and %s MAC",
silc_cipher_get_name(key),
- silc_cipher_get_key_len(key)));
+ silc_hmac_get_name(hmac)));
SILC_SERVER_SEND_NOTIFY(server, sock, SILC_NOTIFY_TYPE_NONE,
("Your current nickname is %s",
client->nickname));
}
} else {
/* Update statistics */
- assert(server->stat.clients > 0);
+ 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)
server->stat.cell_clients--;
}
if (SILC_IS_LOCAL(remote_client)) {
- server->stat.my_clients--;
+ if (!remote_client->local_detached)
+ server->stat.my_clients--;
silc_schedule_task_del_by_context(server->schedule, remote_client);
}