X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient_register.c;h=8ff3fb4c54d9d58fe369df488a239daf0d585653;hb=167f333f9382922ef617147de238339c98792844;hp=5d12f79bfff7671e31f6122b1fbd4d4fa63d170f;hpb=9f58e46226c1d1b8772fd1fb9b7c137c1c8f12e0;p=silc.git diff --git a/lib/silcclient/client_register.c b/lib/silcclient/client_register.c index 5d12f79b..8ff3fb4c 100644 --- a/lib/silcclient/client_register.c +++ b/lib/silcclient/client_register.c @@ -60,6 +60,9 @@ SILC_FSM_STATE(silc_client_new_id) silc_buffer_len(&packet->buffer), &id)) goto out; + SILC_LOG_DEBUG(("New ID %s", silc_id_render(&id.u.client_id, + SILC_ID_CLIENT))); + /* Create local client entry */ conn->local_entry = silc_client_add_client(client, conn, client->username, @@ -74,8 +77,10 @@ SILC_FSM_STATE(silc_client_new_id) conn->internal->local_idp = silc_buffer_copy(&packet->buffer); /* Save cache entry */ - silc_idcache_find_by_id_one(conn->internal->client_cache, conn->local_id, - &conn->internal->local_entry); + if (!silc_idcache_find_by_id_one(conn->internal->client_cache, + conn->local_id, + &conn->internal->local_entry)) + goto out; /* Save remote ID */ if (packet->src_id_len) { @@ -90,6 +95,10 @@ SILC_FSM_STATE(silc_client_new_id) &conn->remote_id); } + /* Set IDs to the packet stream */ + silc_packet_set_ids(conn->stream, SILC_ID_CLIENT, conn->local_id, + conn->remote_id.type, SILC_ID_GET_ID(conn->remote_id)); + /* Signal connection that new ID was received so it can continue with the registering. */ if (conn->internal->registering)