From: Pekka Riikonen Date: Mon, 29 Apr 2002 07:48:09 +0000 (+0000) Subject: updates X-Git-Tag: silc.toolkit.0.9~23 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=d2df72d197b1fde98ef7a07027f8d40f3f801096 updates --- diff --git a/CHANGES b/CHANGES index be5fbcd1..a04b9bab 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +Mon Apr 29 09:48:12 CEST 2002 Pekka Riikonen + + * 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 * Added new QUIET channel user mode that can be used to diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index 7b0f1ca7..ac05ae50 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -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); }