SilcChannelClientEntry chl2;
SilcHashTableList htl2;
- channel->id = NULL;
+ channel->disabled = TRUE;
silc_hash_table_list(channel->user_list, &htl2);
while (silc_hash_table_get(&htl2, NULL, (void *)&chl2)) {
}
if (client->router != entry) {
- if (server_signoff && client->connection) {
+ if (server_signoff) {
clients = silc_realloc(clients,
sizeof(*clients) * (clients_c + 1));
clients[clients_c] = client;
/* Remove the client entry */
silc_server_remove_clients_channels(server, NULL, client, channels);
- silc_idlist_del_client(server->local_list, client);
+ client->data.status &= ~SILC_IDLIST_STATUS_REGISTERED;
+ id_cache->expire = SILC_ID_CACHE_EXPIRE_DEF;
+ server->stat.clients--;
+ if (server->server_type == SILC_ROUTER)
+ server->stat.cell_clients--;
if (!silc_idcache_list_next(list, &id_cache))
break;
/* Remove the client entry */
silc_server_remove_clients_channels(server, NULL, client, channels);
- silc_idlist_del_client(server->global_list, client);
+ client->data.status &= ~SILC_IDLIST_STATUS_REGISTERED;
+ id_cache->expire = SILC_ID_CACHE_EXPIRE_DEF;
+ server->stat.clients--;
+ if (server->server_type == SILC_ROUTER)
+ server->stat.cell_clients--;
if (!silc_idcache_list_next(list, &id_cache))
break;
/* Send the SERVER_SIGNOFF notify */
if (server_signoff) {
- SilcBuffer args;
+ SilcBuffer args, not;
/* Send SERVER_SIGNOFF notify to our primary router */
if (!server->standalone && server->router &&
silc_buffer_free(args);
}
+ /* Send to local clients. We also send the list of client ID's that
+ is to be removed for those servers that would like to use that list. */
args = silc_argument_payload_encode(argc, argv, argv_lens,
argv_types);
- /* Send to local clients */
- for (i = 0; i < clients_c; i++) {
- silc_server_send_notify_args(server, clients[i]->connection,
- FALSE, SILC_NOTIFY_TYPE_SERVER_SIGNOFF,
- argc, args);
- }
+ not = silc_notify_payload_encode_args(SILC_NOTIFY_TYPE_SERVER_SIGNOFF,
+ argc, args);
+ silc_server_packet_send_clients(server, clients, clients_c,
+ SILC_PACKET_NOTIFY, 0, FALSE,
+ not->data, not->len, FALSE);
silc_free(clients);
silc_buffer_free(args);
+ silc_buffer_free(not);
for (i = 0; i < argc; i++)
silc_free(argv[i]);
silc_free(argv);
if (silc_idcache_list_first(list, &id_cache)) {
while (id_cache) {
client = (SilcClientEntry)id_cache->context;
-
-
if (!(client->data.status & SILC_IDLIST_STATUS_REGISTERED)) {
if (!silc_idcache_list_next(list, &id_cache))
break;
if (silc_idcache_list_first(list, &id_cache)) {
while (id_cache) {
client = (SilcClientEntry)id_cache->context;
-
if (!(client->data.status & SILC_IDLIST_STATUS_REGISTERED)) {
if (!silc_idcache_list_next(list, &id_cache))
break;