X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=blobdiff_plain;f=lib%2Fsilcclient%2Fclient.c;h=449fc375ce152b33bca4e0c3bbd06ce53870766d;hp=3ab7ba17b4aa96fc872496dce38c17ae078227d7;hb=HEAD;hpb=e9374395ec9747bddd3ea0bfd3e5a17717e97b31 diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index 3ab7ba17..449fc375 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2007 Pekka Riikonen + Copyright (C) 1997 - 2008 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,6 @@ GNU General Public License for more details. */ -/* $Id$ */ #include "silc.h" #include "silcclient.h" @@ -149,7 +148,15 @@ static void silc_client_packet_error(SilcPacketEngine engine, void *callback_context, void *stream_context) { - /* Nothing */ + SilcClient client = callback_context; + SilcClientConnection conn = stream_context; + + /* Read and write errors are silent */ + if (error == SILC_PACKET_ERR_READ || error == SILC_PACKET_ERR_WRITE) + return; + + client->internal->ops->say(client, conn, SILC_CLIENT_MESSAGE_ERROR, + (char *)silc_packet_error_string(error)); } /* Packet stream callbacks */ @@ -953,12 +960,8 @@ void silc_client_free(SilcClient client) if (client->rng) silc_rng_free(client->rng); - if (!client->internal->params->dont_register_crypto_library) { - silc_cipher_unregister_all(); - silc_pkcs_unregister_all(); - silc_hash_unregister_all(); - silc_hmac_unregister_all(); - } + if (!client->internal->params->dont_register_crypto_library) + silc_crypto_uninit(); if (client->internal->packet_engine) silc_packet_engine_stop(client->internal->packet_engine); @@ -1027,15 +1030,10 @@ SilcBool silc_client_init(SilcClient client, const char *username, if (!client->internal->ftp_sessions) return FALSE; - if (!client->internal->params->dont_register_crypto_library) { + if (!client->internal->params->dont_register_crypto_library) /* Initialize the crypto library. If application has done this already - this has no effect. Also, we will not be overriding something - application might have registered earlier. */ - silc_cipher_register_default(); - silc_pkcs_register_default(); - silc_hash_register_default(); - silc_hmac_register_default(); - } + this has no effect. */ + silc_crypto_init(NULL); /* Initialize random number generator */ client->rng = silc_rng_alloc(); @@ -1045,7 +1043,7 @@ SilcBool silc_client_init(SilcClient client, const char *username, silc_rng_global_init(client->rng); /* Initialize the scheduler */ - client->schedule = silc_schedule_init(0, client); + client->schedule = silc_schedule_init(0, client, NULL, NULL); if (!client->schedule) return FALSE;