Ignore error notify for local client entry.
#include "silcclient.h"
#include "client_internal.h"
-/************************** Types and definitions ***************************/
-
-
/************************ Static utility functions **************************/
/* Connection machine FSM destructor. This will finish the thread where
/* Delete connection */
silc_client_del_connection(conn->client, conn);
- /* Finish the thread were this machine was running */
+ /* Finish the thread were this machine was running. Its destructor is the
+ silc_client_connection_finished. */
silc_fsm_finish(thread);
}
conn->remote_host,
silc_ske_map_status(status));
+ silc_ske_free(conn->internal->ske);
+ conn->internal->ske = NULL;
silc_fsm_finish(fsm);
return;
}
SILC_FSM_CALL(conn->internal->op = silc_ske_rekey_responder(
conn->internal->ske,
conn->stream,
- conn->internal->rekey));
+ conn->internal->rekey,
+ NULL));
}
return NULL;
}
+ SILC_LOG_DEBUG(("Found %d clients", silc_dlist_count(clients)));
+
silc_dlist_start(clients);
return clients;
}
if (!silc_argument_get_decoded(args, 2, SILC_ARGUMENT_ID, &id, NULL))
goto out;
client_entry = silc_client_get_client_by_id(client, conn, &id.u.client_id);
- if (client_entry) {
+ if (client_entry && client_entry != conn->local_entry) {
silc_client_remove_from_channels(client, conn, client_entry);
silc_client_del_client(client, conn, client_entry);
silc_client_unref_client(client, conn, client_entry);
SilcClientConnection conn = fsm_context;
SilcClient client = conn->client;
SilcPacket packet = state_context;
+ char *nick;
SilcID id;
if (conn->local_id)
SILC_LOG_DEBUG(("New ID %s", silc_id_render(&id.u.client_id,
SILC_ID_CLIENT)));
+ /* From SILC protocol version 1.3, nickname is in NEW_CLIENT packet */
+ if (conn->internal->remote_version >= 13)
+ nick = (conn->internal->params.nickname ?
+ conn->internal->params.nickname : client->username);
+ else
+ nick = client->username;
+
/* Create local client entry */
- conn->local_entry = silc_client_add_client(client, conn,
- client->username,
+ conn->local_entry = silc_client_add_client(client, conn, nick,
client->username,
client->realname,
&id.u.client_id, 0);