X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient_prvmsg.c;h=d0b72c97ccda970a3aaa20306794a02b99c0afb5;hb=413da0f8686910f5e627393157566ae729ca99c4;hp=36d7bbe43a7eaffd76fe308eb7980b50da6a9867;hpb=382d15d447b7a95390decfa783836ae4fe255b3d;p=silc.git diff --git a/lib/silcclient/client_prvmsg.c b/lib/silcclient/client_prvmsg.c index 36d7bbe4..d0b72c97 100644 --- a/lib/silcclient/client_prvmsg.c +++ b/lib/silcclient/client_prvmsg.c @@ -32,7 +32,7 @@ message. The `data' is the private message. If the `force_send' is TRUE the packet is sent immediately. */ -void silc_client_send_private_message(SilcClient client, +bool silc_client_send_private_message(SilcClient client, SilcClientConnection conn, SilcClientEntry client_entry, SilcMessageFlags flags, @@ -47,6 +47,7 @@ void silc_client_send_private_message(SilcClient client, SilcCipher cipher; SilcHmac hmac; int block_len; + bool ret = FALSE; assert(client && conn && client_entry); sock = conn->sock; @@ -60,6 +61,10 @@ void silc_client_send_private_message(SilcClient client, client_entry->hmac_send, client->rng, NULL, client->private_key, client->sha1hash); + if (!buffer) { + SILC_LOG_ERROR(("Error encoding private message")); + return FALSE; + } /* If we don't have private message specific key then private messages are just as any normal packet thus call normal packet sending. If @@ -126,8 +131,12 @@ void silc_client_send_private_message(SilcClient client, silc_free(packetdata.dst_id); + ret = TRUE; + out: silc_buffer_free(buffer); + + return ret; } static void silc_client_private_message_cb(SilcClient client,