From d2d17c1903928b8cf1ad5a7d5be2b83946a68a42 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Tue, 6 Nov 2007 10:17:49 +0000 Subject: [PATCH] Added debugs. --- lib/silcclient/client_channel.c | 5 ++++- lib/silcclient/client_entry.c | 2 +- lib/silcclient/client_keyagr.c | 3 +++ lib/silcclient/client_prvmsg.c | 5 ++++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/silcclient/client_channel.c b/lib/silcclient/client_channel.c index 4fcfb08c..2075d807 100644 --- a/lib/silcclient/client_channel.c +++ b/lib/silcclient/client_channel.c @@ -68,8 +68,11 @@ SilcBool silc_client_send_channel_message(SilcClient client, if (silc_unlikely(!client || !conn || !channel)) return FALSE; - if (silc_unlikely(flags & SILC_MESSAGE_FLAG_SIGNED && !hash)) + if (silc_unlikely(flags & SILC_MESSAGE_FLAG_SIGNED && !hash)) { + SILC_LOG_ERROR(("Cannot send signed message without hash, missing " + "arguments")); return FALSE; + } if (silc_unlikely(conn->internal->disconnected)) return FALSE; diff --git a/lib/silcclient/client_entry.c b/lib/silcclient/client_entry.c index 2a26931a..9510b404 100644 --- a/lib/silcclient/client_entry.c +++ b/lib/silcclient/client_entry.c @@ -1720,6 +1720,7 @@ SilcBool silc_client_del_channel(SilcClient client, SilcClientConnection conn, return FALSE; silc_client_empty_channel(client, conn, channel); + silc_client_del_channel_private_keys(client, conn, channel); silc_hash_table_free(channel->user_list); silc_free(channel->channel_name); silc_free(channel->topic); @@ -1746,7 +1747,6 @@ SilcBool silc_client_del_channel(SilcClient client, SilcClientConnection conn, if (channel->channel_pubkeys) silc_argument_list_free(channel->channel_pubkeys, SILC_ARGUMENT_PUBLIC_KEY); - silc_client_del_channel_private_keys(client, conn, channel); silc_atomic_uninit16(&channel->internal.refcnt); silc_rwlock_free(channel->internal.lock); silc_schedule_task_del_by_context(conn->client->schedule, channel); diff --git a/lib/silcclient/client_keyagr.c b/lib/silcclient/client_keyagr.c index 221bd8a3..6a93b061 100644 --- a/lib/silcclient/client_keyagr.c +++ b/lib/silcclient/client_keyagr.c @@ -60,6 +60,9 @@ SILC_TASK_CALLBACK(silc_client_keyagr_timeout) SilcClientEntry client_entry = context; SilcClientKeyAgreement ke = client_entry->internal.ke; + if (!ke) + return; + SILC_LOG_DEBUG(("Key agreement %p timeout", ke)); ke->completion(ke->client, ke->conn, client_entry, diff --git a/lib/silcclient/client_prvmsg.c b/lib/silcclient/client_prvmsg.c index a29ad586..1f7eaf01 100644 --- a/lib/silcclient/client_prvmsg.c +++ b/lib/silcclient/client_prvmsg.c @@ -64,8 +64,11 @@ SilcBool silc_client_send_private_message(SilcClient client, if (silc_unlikely(!client || !conn || !client_entry)) return FALSE; - if (silc_unlikely(flags & SILC_MESSAGE_FLAG_SIGNED && !hash)) + if (silc_unlikely(flags & SILC_MESSAGE_FLAG_SIGNED && !hash)) { + SILC_LOG_ERROR(("Cannot send signed message without hash, missing " + "arguments")); return FALSE; + } if (silc_unlikely(conn->internal->disconnected)) return FALSE; -- 2.24.0