Resolved local info with IDENTIFY in connecting. silc.client.0.9.5.1
authorPekka Riikonen <priikone@silcnet.org>
Sat, 7 Sep 2002 17:02:40 +0000 (17:02 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 7 Sep 2002 17:02:40 +0000 (17:02 +0000)
CHANGES
lib/silcclient/client.c

diff --git a/CHANGES b/CHANGES
index ec4a273570a1fe90a233c30b6c6951141661ec71..7f37de795d86f6e3bf8cf6f2dd043b0699b8a0c6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -14,6 +14,8 @@ Sat Sep  7 16:02:09 EEST 2002  Pekka Riikonen <priikone@silcnet.org>
          is showed in WHOIS for yourself.  Affected file is
          lib/silcclient/idlist.c and lib/silcclient/client.c.
 
+       * Resolve local info with IDENTIFY when connecting to server.y
+
 Sat Sep  7 14:22:43 CEST 2002 Lubomir Sedlacik <salo@silcnet.org>
 
        * Rewritten check for POSIX threads.  Use --with-pthreads[=DIR]
index 5c94551db4f68dab47d5482cf3815e825ff0a802..b3835a150ed94e1bed4e4f9289480d0964f5ac9a 100644 (file)
@@ -1633,9 +1633,19 @@ void silc_client_receive_new_id(SilcClient client,
                   (void *)conn->local_entry, 0, NULL);
 
   if (connecting) {
-    if (!conn->params.detach_data) {
-      SilcBuffer sidp;
+    SilcBuffer sidp;
 
+    /* Issue IDENTIFY command for itself to get resolved hostname
+       correctly from server. */
+    silc_client_command_register(client, SILC_COMMAND_IDENTIFY, NULL, NULL,
+                                silc_client_command_reply_identify_i, 0, 
+                                ++conn->cmd_ident);
+    sidp = silc_id_payload_encode(conn->local_entry->id, SILC_ID_CLIENT);
+    silc_client_command_send(client, conn, SILC_COMMAND_IDENTIFY,
+                            conn->cmd_ident, 1, 5, sidp->data, sidp->len);
+    silc_buffer_free(sidp);
+
+    if (!conn->params.detach_data) {
       /* Send NICK command if the nickname was set by the application (and is
         not same as the username). Send this with little timeout. */
       if (client->nickname && strcmp(client->nickname, client->username))