updates
authorPekka Riikonen <priikone@silcnet.org>
Mon, 29 Apr 2002 07:48:09 +0000 (07:48 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 29 Apr 2002 07:48:09 +0000 (07:48 +0000)
CHANGES
lib/silcclient/client.c

diff --git a/CHANGES b/CHANGES
index be5fbcd18b71e5d56252ccebf2b5b8f580c52965..a04b9bab3825b92606d89f1ef667563b7d0bfa12 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+Mon Apr 29 09:48:12 CEST 2002  Pekka Riikonen <priikone@silcnet.org>
+
+       * Remove pending command callbacks also if the connection
+         to the server is destroyed.  Affected file is
+         lib/silcclient/client.c.
+
 Sat Apr 27 19:52:32 EEST 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * Added new QUIET channel user mode that can be used to
index 7b0f1ca70531de22b38d2b7add43fda0508c9b6e..ac05ae50e943594545bc50f60a70029a9a185209 100644 (file)
@@ -1378,6 +1378,7 @@ void silc_client_close_connection_real(SilcClient client,
     /* Free all cache entries */
     SilcIDCacheList list;
     SilcIDCacheEntry entry;
+    SilcClientCommandPending *r;
     bool ret;
 
     if (silc_idcache_get_all(conn->client_cache, &list)) {
@@ -1429,8 +1430,6 @@ void silc_client_close_connection_real(SilcClient client,
       silc_hmac_free(conn->hmac_send);
     if (conn->hmac_receive)
       silc_hmac_free(conn->hmac_receive);
-    if (conn->pending_commands)
-      silc_dlist_uninit(conn->pending_commands);
     if (conn->rekey)
       silc_free(conn->rekey);
 
@@ -1442,6 +1441,12 @@ void silc_client_close_connection_real(SilcClient client,
 
     silc_client_ftp_free_sessions(client, conn);
 
+    silc_dlist_start(conn->pending_commands);
+    while ((r = silc_dlist_get(conn->pending_commands)) != SILC_LIST_END)
+      silc_dlist_del(conn->pending_commands, r);
+    if (conn->pending_commands)
+      silc_dlist_uninit(conn->pending_commands);
+
     memset(conn, 0, sizeof(*conn));
     silc_client_del_connection(client, conn);
   }