/* $Id$ */
#include "clientlibincludes.h"
+#include "client_internal.h"
typedef struct {
SilcClientCommandContext cmd;
uint32 clients_count = 0;
int c;
+ SILC_LOG_DEBUG(("Start"));
+
for (c = 0; c < i->list_count; c++) {
uint16 idp_len;
SilcClientID *client_id;
SILC_GET16_MSB(idp_len, client_id_list->data + 2);
idp_len += 4;
client_id = silc_id_payload_parse_id(client_id_list->data, idp_len);
- if (!client_id)
+ if (!client_id) {
+ silc_buffer_pull(client_id_list, idp_len);
continue;
+ }
/* Get the client entry */
if (silc_idcache_find_by_id_one_ext(i->conn->client_cache,
{
GetClientsByListInternal i = (GetClientsByListInternal)context;
+ SILC_LOG_DEBUG(("Start"));
+
if (i->found == FALSE)
i->completion(i->client, i->conn, NULL, 0, i->context);
uint32 *res_argv_lens = NULL, *res_argv_types = NULL, res_argc = 0;
GetClientsByListInternal in;
+ SILC_LOG_DEBUG(("Start"));
+
in = silc_calloc(1, sizeof(*in));
in->client = client;
in->conn = conn;
SILC_GET16_MSB(idp_len, client_id_list->data + 2);
idp_len += 4;
client_id = silc_id_payload_parse_id(client_id_list->data, idp_len);
- if (!client_id)
+ if (!client_id) {
+ silc_buffer_pull(client_id_list, idp_len);
continue;
+ }
/* Check if we have this client cached already. */
id_cache = NULL;
it from the server. */
entry = id_cache ? (SilcClientEntry)id_cache->context : NULL;
if (!id_cache || !entry->nickname) {
+
+ if (entry) {
+ if (entry->status & SILC_CLIENT_STATUS_RESOLVING) {
+ entry->status &= ~SILC_CLIENT_STATUS_RESOLVING;
+ silc_free(client_id);
+ silc_buffer_pull(client_id_list, idp_len);
+ continue;
+ }
+
+ entry->status |= SILC_CLIENT_STATUS_RESOLVING;
+ }
+
/* No we don't have it, query it from the server. Assemble argument
table that will be sent fr the IDENTIFY command later. */
res_argv = silc_realloc(res_argv, sizeof(*res_argv) *
SilcIDCacheList list = NULL;
SilcClientEntry entry = NULL;
+ SILC_LOG_DEBUG(("Start"));
+
/* Find ID from cache */
if (!silc_idcache_find_by_name(conn->client_cache, (char *)nickname,
&list)) {
SilcBuffer idp;
GetClientByIDInternal i = silc_calloc(1, sizeof(*i));
+ SILC_LOG_DEBUG(("Start"));
+
idp = silc_id_payload_encode(client_id, SILC_ID_CLIENT);
silc_client_send_command(client, conn, SILC_COMMAND_WHOIS,
++conn->cmd_ident,
SilcClientEntry client_entry;
char *nick = NULL;
+ SILC_LOG_DEBUG(("Start"));
+
/* Save the client infos */
client_entry = silc_calloc(1, sizeof(*client_entry));
client_entry->id = id;
+ client_entry->valid = TRUE;
silc_parse_userfqdn(nickname, &nick, &client_entry->server);
silc_parse_userfqdn(username, &client_entry->username,
&client_entry->hostname);
{
char *nick = NULL;
+ SILC_LOG_DEBUG(("Start"));
+
if (!client_entry->username && username)
silc_parse_userfqdn(username, &client_entry->username,
&client_entry->hostname);
/* Deletes the client entry and frees all memory. */
void silc_client_del_client_entry(SilcClient client,
+ SilcClientConnection conn,
SilcClientEntry client_entry)
{
+ SILC_LOG_DEBUG(("Start"));
+
silc_free(client_entry->nickname);
silc_free(client_entry->username);
silc_free(client_entry->realname);
silc_free(client_entry->server);
silc_free(client_entry->id);
+ silc_free(client_entry->fingerprint);
if (client_entry->send_key)
silc_cipher_free(client_entry->send_key);
if (client_entry->receive_key)
silc_cipher_free(client_entry->receive_key);
silc_free(client_entry->key);
+ silc_client_ftp_session_free_client(conn, client_entry);
silc_free(client_entry);
}
SilcClientEntry client_entry)
{
bool ret = silc_idcache_del_by_context(conn->client_cache, client_entry);
- silc_client_del_client_entry(client, client_entry);
+ silc_client_del_client_entry(client, conn, client_entry);
return ret;
}
silc_cipher_free(channel->channel_key);
if (channel->hmac)
silc_hmac_free(channel->hmac);
+ if (channel->old_channel_key)
+ silc_cipher_free(channel->old_channel_key);
+ if (channel->old_hmac)
+ silc_hmac_free(channel->old_hmac);
+ if (channel->rekey_task)
+ silc_schedule_task_del(conn->client->schedule, channel->rekey_task);
silc_client_del_channel_private_keys(client, conn, channel);
silc_free(channel);
return ret;
SilcIDCacheEntry id_cache;
SilcChannelEntry entry;
+ SILC_LOG_DEBUG(("Start"));
+
if (!silc_idcache_find_by_name_one(conn->channel_cache, channel,
&id_cache))
return NULL;
SilcIDCacheEntry id_cache;
SilcChannelEntry entry;
+ SILC_LOG_DEBUG(("Start"));
+
if (!silc_idcache_find_by_id_one(conn->channel_cache, channel_id,
&id_cache))
return NULL;
GetChannelByIDInternal i = (GetChannelByIDInternal)context;
SilcChannelEntry entry;
+ SILC_LOG_DEBUG(("Start"));
+
/* Get the channel */
entry = silc_client_get_channel_by_id(i->client, i->conn,
i->channel_id);
SilcBuffer idp;
GetChannelByIDInternal i = silc_calloc(1, sizeof(*i));
+ SILC_LOG_DEBUG(("Start"));
+
idp = silc_id_payload_encode(channel_id, SILC_ID_CHANNEL);
silc_client_send_command(client, conn, SILC_COMMAND_IDENTIFY,
++conn->cmd_ident,
SilcBuffer idp;
SilcChannelEntry channel;
+ SILC_LOG_DEBUG(("Start"));
+
channel = silc_client_get_channel_by_id(client, conn, channel_id);
if (channel)
return channel;
SilcIDCacheEntry id_cache;
SilcServerEntry entry;
+ SILC_LOG_DEBUG(("Start"));
+
if (!silc_idcache_find_by_name_one(conn->server_cache, server_name,
&id_cache))
return NULL;
SilcIDCacheEntry id_cache;
SilcServerEntry entry;
+ SILC_LOG_DEBUG(("Start"));
+
if (!silc_idcache_find_by_id_one(conn->server_cache, (void *)server_id,
&id_cache))
return NULL;
char *newnick = NULL;
int i, off = 0, len;
SilcClientEntry *clients;
- uint32 clients_count;
+ uint32 clients_count = 0;
+
+ SILC_LOG_DEBUG(("Start"));
if (!client->params->nickname_format[0])
return;
if (!clients && !client->params->nickname_force_format)
return;
+ len = 0;
+ for (i = 0; i < clients_count; i++)
+ if (clients[i]->valid)
+ len++;
+ if (!len)
+ return;
+
cp = client->params->nickname_format;
while (*cp) {
if (*cp == '%') {
break;
for (i = 0; i < clients_count; i++) {
- if (strncmp(clients[i]->nickname, newnick, off))
+ if (strncasecmp(clients[i]->nickname, newnick, off))
continue;
if (strlen(clients[i]->nickname) <= off)
continue;