make sure session->hostname and session->port are valid before the
authorPatrik Weiskircher <pat@silcnet.org>
Thu, 5 Jan 2006 19:10:36 +0000 (19:10 +0000)
committerPatrik Weiskircher <pat@silcnet.org>
Thu, 5 Jan 2006 19:10:36 +0000 (19:10 +0000)
application callback is done, since things will go wrong if the
application immediately calls silc_client_file_receive.

CHANGES
lib/silcclient/client_ftp.c

diff --git a/CHANGES b/CHANGES
index ca3d904432f7371b3b0299912679bcbcff9a03bb..862cb32f89f431e46e27497f140b08093687511f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,12 @@
-Wed Dec 14 19:21:42 CET 2005 Jochen Eisinger <coffee@silcnet.org>
+Thu Jan  5 20:02:31 CET 2006 Patrik Weiskircher <pat@icore.at>
 
+       * make sure session->hostname and session->port are valid before the
+         application callback is done, since things will go wrong if the
+         application immediately calls silc_client_file_receive. Affected
+         file lib/silcclient/client_ftp.c.
+         Patch received from Stefan Siegel <stesie@brokenpipe.de>, thanks!
+
+Wed Dec 14 19:21:42 CET 2005 Jochen Eisinger <coffee@silcnet.org> 
        * Fixed autodist configuration for silc-client.  Affected file
          configure.ad
        * Honor user set hostname.  Also give the user a chance to
index 3e71b5ab07eb55ee11754aacfc84fddd5adb1a3e..6081fac6992a6193e51d4ec89164a3da90011239 100644 (file)
@@ -1155,15 +1155,15 @@ static void silc_client_ftp_resolve_cb(SilcClient client,
     session->client_entry = client_entry;
     silc_dlist_add(conn->internal->ftp_sessions, session);
 
-    /* Let the application know */
-    client->internal->ops->ftp(client, conn, client_entry,
-                              session->session_id, hostname, port);
-
     if (hostname && port) {
       session->hostname = strdup(hostname);
       session->port = port;
     }
 
+    /* Let the application know */
+    client->internal->ops->ftp(client, conn, client_entry,
+                              session->session_id, hostname, port);
+
     goto out;
   }