clients of those servers can be removed too. Affected file
silcd/server_util.[ch].
+ * When removing clients after a server has signed of remove
+ also all servers behind that server (unless they are known
+ to be available locally), and send SERVER_SIGNOFF for each
+ of the server separately. Also the signed off clients are
+ sent now separately per signed off server. The affected files
+ are silcd/server.c and silcd/server_util.[ch].
+
+ * All servers added with silc_idlist_add_server must always
+ have both "router" and "connection" pointers set. Otherwise,
+ bad server entries may be left around in the cache.
+ Affected file silcd/command_reply.c.
+
+ * Do not create the channel key in NEW_CHANNEL packet
+ processing if the channel is empty. Affected file
+ silcd/packet_receive.c.
+
+ * Completed backup router support for standalone routers.
+ Supports also servers in the cell that do not use the backup
+ at all.
+
Wed Jun 26 10:38:11 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Fixed a bug in silc_string_regexify which did not add '^'
set as the new server's context instead of SilcServerEntry.
This naturally caused some weird bugs.
+ * Added "updated" field the SilcChannelEntry which indicates
+ the time since the channel entry was last accessed. This
+ can be used to determine whether it is necessary to
+ announce the channel after backup resuming protocol.
+ Affected files silcd/idlist.[ch].
+
Thu Aug 9 18:28:37 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
* Do not delete the channel rekey task when adding it
TODO/bugs In SILC Client Library
================================
+ o Still crash with NICK_CHANGE notify.
+
o The PRIVATE_MESSAGE_KEY packet is not handled (it is implemented
though). This should be added and perhaps new client operation
should be added to notify application that it was received and
the core library, client and server. Maybe implementations of
RFC 2425 and RFC 2426 to make it complete.
- o Add special handling in router and server for "connection timed out"
- error. Be optimistic.
-
- o Backup router related issues (Fix this to 0.9.x):
-
- o Complete backup router support with standalone router
-
- o Make the backup router work even if not all servers in the
- cell use it. When primary goes down, also those that are
- not using it (are not connected locally) are signoffed.
-
- o When primary goes down and removing clients of non-backup
- aware server the SERVER_SIGNOFF includes the router's ID
- not the server's ID, which it should include. The notify
- is sent by backup.
+ o Backup router related issues:
- o When removing clients by server in signoff, EOF etc, find also
- the client's real server (based on the Client ID's IP), and
- remove the server too.
+ o Add special handling in router and server for "connection
+ timed out" error. Be optimistic.
o Testing
3, tmp_mask, 4);
silc_server_packet_send(server, cmd->sock, SILC_PACKET_COMMAND_REPLY, 0,
packet->data, packet->len, FALSE);
-
+
silc_buffer_free(packet);
silc_buffer_free(cidp);
/* We don't have that server anywhere, add it. */
server_entry = silc_idlist_add_server(server->global_list,
strdup(name), 0,
- server_id, NULL, NULL);
+ server_id, server->router,
+ SILC_PRIMARY_ROUTE(server));
if (!server_entry) {
silc_free(server_id);
goto error;
/* Add the server to global list */
server_id = silc_id_dup(server_id, SILC_ID_SERVER);
entry = silc_idlist_add_server(server->global_list, name, 0,
- server_id, NULL, NULL);
+ server_id, cmd->sock->user_data,
+ cmd->sock);
if (!entry) {
silc_free(server_id);
goto out;
{
SilcIDListPurge i = (SilcIDListPurge)context;
- SILC_LOG_DEBUG(("Start"));
+ SILC_LOG_DEBUG(("Purging cache"));
silc_idcache_purge(i->cache);
silc_schedule_task_add(i->schedule, 0,
channel->router = router;
channel->channel_key = channel_key;
channel->hmac = hmac;
- channel->created = time(0);
+ channel->created = channel->updated = time(0);
if (!channel->hmac)
if (!silc_hmac_alloc(SILC_DEFAULT_HMAC, NULL, &channel->hmac)) {
silc_free(channel);
SilcChannelClientEntry chl = (SilcChannelClientEntry)context;
SILC_LOG_DEBUG(("Removing client %s from channel %s",
- chl->client->nickname, chl->channel->channel_name));
+ chl->client->nickname ? chl->client->nickname :
+ (unsigned char *)"", chl->channel->channel_name));
/* Remove the context from the client's channel hash table as that
table and channel's user_list hash table share this same context. */
int silc_idlist_del_channel(SilcIDList id_list, SilcChannelEntry entry)
{
if (entry) {
- SILC_LOG_DEBUG(("Deleting channel %s", entry->channel_name));
-
/* Remove from cache */
if (!silc_idcache_del_by_context(id_list->channels, entry))
return FALSE;
+ SILC_LOG_DEBUG(("Deleting channel %s", entry->channel_name));
+
/* Free all client entrys from the users list. The silc_hash_table_free
will free all the entries so they are not freed at the foreach
callback. */
SILC_LOG_DEBUG(("Found"));
+ /* Touch channel */
+ ((SilcChannelEntry)id_cache->context)->updated = time(NULL);
+
return id_cache->context;
}
SILC_LOG_DEBUG(("Found"));
+ /* Touch channel */
+ channel->updated = time(NULL);
+
return channel;
}
SILC_LOG_DEBUG(("Replaced"));
+ /* Touch channel */
+ channel->updated = time(NULL);
+
return channel;
}
SilcServerChannelRekey rekey;
unsigned long created;
+ unsigned long updated;
/* Flags */
unsigned int global_users : 1;
channel_id, SILC_ID_CHANNEL,
packet->buffer->data,
packet->buffer->len, FALSE);
- silc_server_backup_send_dest(server, (SilcServerEntry)sock->user_data,
+ silc_server_backup_send_dest(server, sock->user_data,
packet->type, packet->flags,
channel_id, SILC_ID_CHANNEL,
packet->buffer->data, packet->buffer->len,
packet->flags | SILC_PACKET_FLAG_BROADCAST,
packet->buffer->data, packet->buffer->len,
FALSE);
- silc_server_backup_send(server, (SilcServerEntry)sock->user_data,
+ silc_server_backup_send(server, sock->user_data,
packet->type, packet->flags,
packet->buffer->data, packet->buffer->len,
FALSE, TRUE);
/* Do not add client to channel if it is there already */
if (silc_server_client_on_channel(client, channel, NULL)) {
- SILC_LOG_DEBUG(("Client already on channel"));
+ SILC_LOG_DEBUG(("Client already on channel %s",
+ channel->channel_name));
break;
}
if (server->server_type == SILC_SERVER &&
sock == SILC_PRIMARY_ROUTE(server) &&
mode & SILC_CHANNEL_MODE_FOUNDER_AUTH) {
- SILC_LOG_DEBUG(("Founder public key received from primary router"));
+ SILC_LOG_DEBUG(("Founder public key received from router"));
tmp = silc_argument_get_arg_type(args, 6, &tmp_len);
if (!tmp)
break;
/* Send the same notify to the channel */
if (!notify_sent)
- silc_server_packet_send_to_channel(server, NULL, channel,
- packet->type,
- FALSE, packet->buffer->data,
+ silc_server_packet_send_to_channel(server, NULL, channel,
+ packet->type,
+ FALSE, packet->buffer->data,
packet->buffer->len, FALSE);
silc_free(channel_id);
/* Remove the clients that this server owns as they will become
invalid now too. */
- silc_server_remove_clients_by_server(server, server_entry,
+ silc_server_remove_clients_by_server(server, server_entry->router,
server_entry, TRUE);
silc_server_backup_del(server, server_entry);
if (server->server_type != SILC_BACKUP_ROUTER) {
/* Distribute to local cell backup routers. */
- silc_server_backup_send(server, (SilcServerEntry)sock->user_data,
+ silc_server_backup_send(server, sock->user_data,
SILC_PACKET_CHANNEL_KEY, 0,
buffer->data, buffer->len, FALSE, TRUE);
}
/* Distribute to backup routers */
if (server->server_type == SILC_ROUTER) {
SilcBuffer idp = silc_id_payload_encode(client->id, SILC_ID_CLIENT);
- silc_server_backup_send(server, NULL, SILC_PACKET_NEW_ID, 0,
+ silc_server_backup_send(server, sock->user_data, SILC_PACKET_NEW_ID, 0,
idp->data, idp->len, FALSE, TRUE);
silc_buffer_free(idp);
}
if (server->server_type == SILC_ROUTER) {
/* Distribute to backup routers */
SilcBuffer idp = silc_id_payload_encode(new_server->id, SILC_ID_SERVER);
- silc_server_backup_send(server, NULL, SILC_PACKET_NEW_ID, 0,
+ silc_server_backup_send(server, sock->user_data, SILC_PACKET_NEW_ID, 0,
idp->data, idp->len, FALSE, TRUE);
silc_buffer_free(idp);
packet->type,
packet->flags | SILC_PACKET_FLAG_BROADCAST,
buffer->data, buffer->len, FALSE);
- silc_server_backup_send(server, (SilcServerEntry)sock->user_data,
+ silc_server_backup_send(server, sock->user_data,
packet->type, packet->flags,
packet->buffer->data, packet->buffer->len,
FALSE, TRUE);
packet->flags | SILC_PACKET_FLAG_BROADCAST,
packet->buffer->data,
packet->buffer->len, FALSE);
- silc_server_backup_send(server, (SilcServerEntry)sock->user_data,
+ silc_server_backup_send(server, sock->user_data,
packet->type, packet->flags,
packet->buffer->data, packet->buffer->len,
FALSE, TRUE);
return;
}
channel->disabled = TRUE;
- channel->mode = silc_channel_get_mode(payload);
+ if (server_entry->server_type != SILC_BACKUP_ROUTER)
+ channel->mode = silc_channel_get_mode(payload);
/* Send the new channel key to the server */
id = silc_id_id2str(channel->id, SILC_ID_CHANNEL);
/* Create new key for the channel and send it to the server and
everybody else possibly on the channel. */
if (!(channel->mode & SILC_CHANNEL_MODE_PRIVKEY)) {
- if (!silc_server_create_channel_key(server, channel, 0))
- return;
-
- /* Send to the channel */
- silc_server_send_channel_key(server, sock, channel, FALSE);
- id = silc_id_id2str(channel->id, SILC_ID_CHANNEL);
- id_len = silc_id_get_len(channel->id, SILC_ID_CHANNEL);
+
+ if (silc_hash_table_count(channel->user_list)) {
+ if (!silc_server_create_channel_key(server, channel, 0))
+ return;
+
+ /* Send to the channel */
+ silc_server_send_channel_key(server, sock, channel, FALSE);
+ }
/* Send to the server */
+ id = silc_id_id2str(channel->id, SILC_ID_CHANNEL);
+ id_len = silc_id_get_len(channel->id, SILC_ID_CHANNEL);
chk = silc_channel_key_payload_encode(id_len, id,
strlen(channel->channel_key->
cipher->name),
packet->flags | SILC_PACKET_FLAG_BROADCAST,
packet->buffer->data,
packet->buffer->len, FALSE);
- silc_server_backup_send(server, (SilcServerEntry)sock->user_data,
+ silc_server_backup_send(server, sock->user_data,
packet->type, packet->flags,
packet->buffer->data, packet->buffer->len,
FALSE, TRUE);
packet->type,
packet->flags | SILC_PACKET_FLAG_BROADCAST,
buffer->data, buffer->len, FALSE);
- silc_server_backup_send(server, (SilcServerEntry)sock->user_data,
+ silc_server_backup_send(server, sock->user_data,
packet->type, packet->flags,
packet->buffer->data, packet->buffer->len,
FALSE, TRUE);
bool gone = FALSE;
int k;
- SILC_LOG_DEBUG(("Sending packet to list of clients"));
+ if (!silc_hash_table_count(clients))
+ return;
+
+ SILC_LOG_DEBUG(("Sending packet to %d clients",
+ silc_hash_table_count(clients)));
/* Send to all clients in table */
silc_hash_table_list(clients, &htl);
goto out;
}
- SILC_LOG_DEBUG(("Sending %s packet to channel %s",
+ SILC_LOG_DEBUG(("Sending %s to channel %s",
silc_get_packet_name(type), channel->channel_name));
routed = silc_calloc(silc_hash_table_count(channel->user_list),
sock = (SilcSocketConnection)router->connection;
idata = (SilcIDListData)router;
- SILC_LOG_DEBUG(("Sending channel message to router for routing"));
+ SILC_LOG_DEBUG(("Sending message to router for routing"));
silc_server_packet_send_to_channel_real(server, sock, &packetdata,
idata->send_key,
SILC_LOG_DEBUG(("New server id(%s)",
silc_id_render(ctx->dest_id, SILC_ID_SERVER)));
- /* Add the connected router to global server list */
+ /* Add the connected router to global server list. Router is sent
+ as NULL since it's local to us. */
id_entry = silc_idlist_add_server(server->global_list,
strdup(sock->hostname),
SILC_ROUTER, ctx->dest_id, NULL, sock);
server->router = id_entry;
server->standalone = FALSE;
- /* If we are router then announce our possible servers. */
+ /* If we are router then announce our possible servers. Backup
+ router announces also global servers. */
if (server->server_type == SILC_ROUTER)
- silc_server_announce_servers(server, FALSE, 0,
- SILC_PRIMARY_ROUTE(server));
+ silc_server_announce_servers(server,
+ server->backup_router ? TRUE : FALSE,
+ 0, SILC_PRIMARY_ROUTE(server));
/* Announce our clients and channels to the router */
silc_server_announce_clients(server, 0, SILC_PRIMARY_ROUTE(server));
/* Enable local server connections that may be disabled */
silc_server_local_servers_toggle_enabled(server, TRUE);
+ /* Update the client entries of this server to the new backup
+ router. If we are the backup router we also resolve the real
+ servers for the clients. After updating is over this also
+ removes the clients that this server explicitly owns. */
+ silc_server_update_clients_by_server(server, user_data,
+ backup_router, TRUE);
+
/* If we are router and just lost our primary router (now standlaone)
we remove everything that was behind it, since we don't know
any better. */
remove the clients of those servers too. */
silc_server_remove_servers_by_server(server, user_data, TRUE);
- /* Update the client entries of this server to the new backup
- router. If we are the backup router we also resolve the real
- servers for the clients. After updating is over this also
- removes the clients that this server explicitly owns. */
- silc_server_update_clients_by_server(server, user_data,
- backup_router, TRUE, TRUE);
+ /* Finally remove the clients that are explicitly owned by this
+ server. They go down with the server. */
+ silc_server_remove_clients_by_server(server, user_data,
+ user_data, TRUE);
/* Update our server cache to use the new backup router too. */
silc_server_update_servers_by_server(server, user_data, backup_router);
unsigned char channel_key[32], hash[32];
SilcUInt32 len;
- SILC_LOG_DEBUG(("Generating channel key"));
-
if (channel->mode & SILC_CHANNEL_MODE_PRIVKEY) {
SILC_LOG_DEBUG(("Channel has private keys, will not generate new key"));
return TRUE;
}
+ SILC_LOG_DEBUG(("Generating channel %s key", channel->channel_name));
+
if (!channel->channel_key)
if (!silc_cipher_alloc(SILC_DEFAULT_CIPHER, &channel->channel_key)) {
channel->channel_key = NULL;
SilcUInt32 tmp_len;
char *cipher;
- SILC_LOG_DEBUG(("Saving new channel key"));
-
/* Decode channel key payload */
payload = silc_channel_key_payload_parse(key_payload->data,
key_payload->len);
}
}
+ SILC_LOG_DEBUG(("Saving new channel %s key", channel->channel_name));
+
tmp = silc_channel_key_get_key(payload, &tmp_len);
if (!tmp) {
channel = NULL;
silc_buffer_pull(*channels, len);
}
- /* Channel user modes */
- *channel_users_modes = silc_realloc(*channel_users_modes,
- sizeof(**channel_users_modes) *
- (i + 1));
- (*channel_users_modes)[i] = NULL;
- *channel_modes = silc_realloc(*channel_modes,
- sizeof(**channel_modes) * (i + 1));
- (*channel_modes)[i] = NULL;
- *channel_ids = silc_realloc(*channel_ids,
- sizeof(**channel_ids) * (i + 1));
- (*channel_ids)[i] = NULL;
- silc_server_announce_get_channel_users(server, channel,
- &(*channel_modes)[i],
- channel_users,
- &(*channel_users_modes)[i]);
- (*channel_ids)[i] = channel->id;
-
- /* Channel's topic */
- *channel_topics = silc_realloc(*channel_topics,
- sizeof(**channel_topics) * (i + 1));
- (*channel_topics)[i] = NULL;
- silc_server_announce_get_channel_topic(server, channel,
- &(*channel_topics)[i]);
- (*channel_users_modes_c)++;
- i++;
+ if (creation_time && channel->updated < creation_time)
+ announce = FALSE;
+ else
+ announce = TRUE;
+
+ if (announce) {
+ /* Channel user modes */
+ *channel_users_modes = silc_realloc(*channel_users_modes,
+ sizeof(**channel_users_modes) *
+ (i + 1));
+ (*channel_users_modes)[i] = NULL;
+ *channel_modes = silc_realloc(*channel_modes,
+ sizeof(**channel_modes) * (i + 1));
+ (*channel_modes)[i] = NULL;
+ *channel_ids = silc_realloc(*channel_ids,
+ sizeof(**channel_ids) * (i + 1));
+ (*channel_ids)[i] = NULL;
+ silc_server_announce_get_channel_users(server, channel,
+ &(*channel_modes)[i],
+ channel_users,
+ &(*channel_users_modes)[i]);
+ (*channel_ids)[i] = channel->id;
+
+ /* Channel's topic */
+ *channel_topics = silc_realloc(*channel_topics,
+ sizeof(**channel_topics) * (i + 1));
+ (*channel_topics)[i] = NULL;
+ silc_server_announce_get_channel_topic(server, channel,
+ &(*channel_topics)[i]);
+ (*channel_users_modes_c)++;
+ i++;
+ }
if (!silc_idcache_list_next(list, &id_cache))
break;
for (i = 0; i < server->backup->servers_count; i++) {
backup = server->backup->servers[i].server;
- if (!backup)
+ if (!backup || sender == backup)
continue;
-
- if (sender == backup)
- continue;
-
if (local && server->backup->servers[i].local == FALSE)
continue;
if (server->backup->servers[i].server == server->id_entry)
for (i = 0; i < server->backup->servers_count; i++) {
backup = server->backup->servers[i].server;
- if (!backup)
+ if (!backup || sender == backup)
continue;
-
- if (sender == backup)
- continue;
-
if (local && server->backup->servers[i].local == FALSE)
continue;
if (server->backup->servers[i].server == server->id_entry)
silc_buffer_free(packet);
- /* Announce all of our information */
- silc_server_announce_servers(server, TRUE, 0, ctx->sock);
- silc_server_announce_clients(server, 0, ctx->sock);
- silc_server_announce_channels(server, 0, ctx->sock);
+ /* If we are not standalone and our primary is not the one we've
+ talking to now, then announce our information to it since we
+ haven't done that yet. Standalone backup router announces
+ these during connecting to the primary. */
+ if (!server->standalone && SILC_PRIMARY_ROUTE(server) != ctx->sock) {
+ silc_server_announce_servers(server, TRUE, 0, ctx->sock);
+ silc_server_announce_clients(server, 0, ctx->sock);
+ silc_server_announce_channels(server, 0, ctx->sock);
+ }
protocol->state++;
} else {
silc_server_update_servers_by_server(server, ctx->sock->user_data,
server->router);
silc_server_update_clients_by_server(server, ctx->sock->user_data,
- server->router, TRUE, FALSE);
+ server->router, TRUE);
if (server->server_type == SILC_SERVER)
silc_server_update_channels_by_server(server, ctx->sock->user_data,
server->router);
/* We have new primary router now */
server->id_entry->router = router;
server->router = router;
- server->router->data.status &= ~SILC_IDLIST_STATUS_DISABLED;
-
SILC_LOG_INFO(("Switching back to primary router %s",
server->router->server_name));
} else {
/* We are connected to new primary and now continue using it */
- router->data.status &= ~SILC_IDLIST_STATUS_DISABLED;
SILC_LOG_INFO(("Resuming the use of primary router %s",
router->server_name));
}
/* Update the client entries of the backup router to the new
router */
silc_server_local_servers_toggle_enabled(server, FALSE);
+ router->data.status &= ~SILC_IDLIST_STATUS_DISABLED;
silc_server_update_servers_by_server(server, backup_router, router);
- silc_server_update_clients_by_server(server, NULL, router,
- FALSE, FALSE);
+ silc_server_update_clients_by_server(server, NULL, router, FALSE);
if (server->server_type == SILC_SERVER)
silc_server_update_channels_by_server(server, backup_router, router);
silc_server_backup_replaced_del(server, backup_router);
/* Announce all of our information to the router. */
if (server->server_type == SILC_ROUTER)
- silc_server_announce_servers(server, FALSE, 0, router->connection);
+ silc_server_announce_servers(server, FALSE, ctx->start,
+ router->connection);
/* Announce our clients and channels to the router */
- silc_server_announce_clients(server, 0, router->connection);
- silc_server_announce_channels(server, 0, router->connection);
+ silc_server_announce_clients(server, ctx->start,
+ router->connection);
+ silc_server_announce_channels(server, ctx->start,
+ router->connection);
}
/* Send notify about primary router going down to local operators */
server_entry = (SilcServerEntry)id_cache->context;
sock = (SilcSocketConnection)server_entry->connection;
- /* XXXX */
- if (!sock) {
- SILC_LOG_DEBUG(("******** REMOVE THIS TEST, IT ALLOWS A BUG"));
- if (!silc_idcache_list_next(list, &id_cache))
- break;
- continue;
- }
-
if (sock->protocol == protocol) {
sock->protocol = NULL;
server_entry = (SilcServerEntry)id_cache->context;
sock = (SilcSocketConnection)server_entry->connection;
- /* XXXX */
- if (!sock) {
- SILC_LOG_DEBUG(("******** REMOVE THIS TEST, IT ALLOWS A BUG"));
- if (!silc_idcache_list_next(list, &id_cache))
- break;
- continue;
- }
-
if (sock->protocol == protocol) {
sock->protocol = NULL;
or is not owned by `entry', skip it. */
if (!(client->data.status & SILC_IDLIST_STATUS_REGISTERED) ||
client->router != router ||
- !SILC_ID_COMPARE(client->id, entry->id, client->id->ip.data_len)) {
+ (router != entry && !SILC_ID_COMPARE(client->id, entry->id,
+ client->id->ip.data_len))) {
if (!silc_idcache_list_next(list, &id_cache))
break;
else
or is not owned by `entry', skip it. */
if (!(client->data.status & SILC_IDLIST_STATUS_REGISTERED) ||
client->router != router ||
- !SILC_ID_COMPARE(client->id, entry->id, client->id->ip.data_len)) {
+ (router != entry && !SILC_ID_COMPARE(client->id, entry->id,
+ client->id->ip.data_len))) {
if (!silc_idcache_list_next(list, &id_cache))
break;
else
attempt to figure out which clients really are originated from the
`from' and which are originated from a server that we have connection
to, when we've acting as backup router. If it is FALSE the `to' will
- be the new source. This function also removes the clients that are
- *really* originated from `from' if `remove_from' is TRUE. These are
- clients that the `from' owns, and not just clients that are behind
- the `from'. If `from' is NULL then all non-local clients are switched
- to `to'. */
+ be the new source. */
void silc_server_update_clients_by_server(SilcServer server,
SilcServerEntry from,
SilcServerEntry to,
- bool resolve_real_server,
- bool remove_from)
+ bool resolve_real_server)
{
SilcIDCacheList list = NULL;
SilcIDCacheEntry id_cache = NULL;
SilcClientEntry client = NULL;
bool local;
- if (from)
- SILC_LOG_DEBUG(("Updating %s", silc_id_render(from->id,
- SILC_ID_SERVER)));
- if (to)
- SILC_LOG_DEBUG(("to %s", silc_id_render(to->id,
- SILC_ID_SERVER)));
-
local = FALSE;
if (silc_idcache_get_all(server->global_list->clients, &list)) {
if (silc_idcache_list_first(list, &id_cache)) {
continue;
}
- SILC_LOG_DEBUG(("Client (global) %s",
+ SILC_LOG_DEBUG(("Client %s",
silc_id_render(client->id, SILC_ID_CLIENT)));
if (client->router)
- SILC_LOG_DEBUG(("Client->router (global) %s",
+ SILC_LOG_DEBUG(("Client->router %s",
silc_id_render(client->router->id, SILC_ID_SERVER)));
if (from) {
if (client->router == from) {
- /* Skip clients that are *really* owned by the `from' */
- if (remove_from && SILC_ID_COMPARE(from->id, client->id,
- client->id->ip.data_len)) {
- SILC_LOG_DEBUG(("Found really owned client, skip it"));
- if (!silc_idcache_list_next(list, &id_cache))
- break;
- else
- continue;
- }
-
if (resolve_real_server) {
client->router =
silc_server_update_clients_by_real_server(server, from, client,
continue;
}
- SILC_LOG_DEBUG(("Client (local) %s",
+ SILC_LOG_DEBUG(("Client %s",
silc_id_render(client->id, SILC_ID_CLIENT)));
if (client->router)
- SILC_LOG_DEBUG(("Client->router (local) %s",
+ SILC_LOG_DEBUG(("Client->router %s",
silc_id_render(client->router->id, SILC_ID_SERVER)));
if (from) {
if (client->router == from) {
- /* Skip clients that are *really* owned by the `from' */
- if (remove_from && SILC_ID_COMPARE(from->id, client->id,
- client->id->ip.data_len)) {
- SILC_LOG_DEBUG(("Found really owned client, skip it"));
- if (!silc_idcache_list_next(list, &id_cache))
- break;
- else
- continue;
- }
-
if (resolve_real_server) {
client->router =
silc_server_update_clients_by_real_server(server, from, client,
}
silc_idcache_list_free(list);
}
-
- if (remove_from)
- /* Now remove the clients that are still marked as orignated from the
- `from'. These are the clients that really was owned by the `from' and
- not just exist behind the `from'. */
- silc_server_remove_clients_by_server(server, from, from, TRUE);
}
/* Updates servers that are from `from' to be originated from `to'. This
bool delchan = !(channel->mode & SILC_CHANNEL_MODE_FOUNDER_AUTH);
if (delchan) {
- SILC_LOG_DEBUG(("Deleting %s channel", channel->channel_name));
-
/* Update statistics */
if (server->server_type == SILC_ROUTER)
server->stat.chanclients -= channel->user_count;
attempt to figure out which clients really are originated from the
`from' and which are originated from a server that we have connection
to, when we've acting as backup router. If it is FALSE the `to' will
- be the new source. This function also removes the clients that are
- *really* originated from `from' if `remove_from' is TRUE. These are
- clients that the `from' owns, and not just clients that are behind
- the `from'. If `from' is NULL then all non-local clients are switched
- to `to'. */
+ be the new source. */
void silc_server_update_clients_by_server(SilcServer server,
SilcServerEntry from,
SilcServerEntry to,
- bool resolve_real_server,
- bool remove_from);
+ bool resolve_real_server);
/* Updates servers that are from `from' to be originated from `to'. This
will also update the server's connection to `to's connection. */
{ 3, "silcd\\.c,server\\.c" },
/* More stuff from silcd/ */
- { 7, "silcd\\.c,server\\.c,command\\.c,server_backup\\.c" },
+ { 7, "silcd\\.c,server\\.c,command\\.c,server_backup\\.c,packet_send\\.c" },
/* All basic stuff from silcd/ */
{ 10, "silc_server_*" },
if (newp->argc) {
silc_buffer_pull(&buffer, 5);
newp->args = silc_argument_payload_parse(buffer.data, buffer.len,
- newp->argc);
+ newp->argc);
silc_buffer_push(&buffer, 5);
}