From 80bb7b35c2a1f44702631f1a5cf5685d5ce4b2c7 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 25 Sep 2009 12:06:45 +0300 Subject: [PATCH] clientlib: Close connection after failed rekey --- lib/silcclient/client_connect.c | 3 +++ lib/silccore/silcpacket.h | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/silcclient/client_connect.c b/lib/silcclient/client_connect.c index de87143f..145f398f 100644 --- a/lib/silcclient/client_connect.c +++ b/lib/silcclient/client_connect.c @@ -262,6 +262,9 @@ static void silc_client_rekey_completion(SilcSKE ske, silc_ske_free(conn->internal->ske); conn->internal->ske = NULL; silc_fsm_finish(fsm); + + /* Close connection */ + silc_client_close_connection(client, conn); return; } diff --git a/lib/silccore/silcpacket.h b/lib/silccore/silcpacket.h index 0caf10d8..72046d76 100644 --- a/lib/silccore/silcpacket.h +++ b/lib/silccore/silcpacket.h @@ -4,7 +4,7 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2007 Pekka Riikonen + Copyright (C) 1997 - 2009 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 @@ -439,6 +439,10 @@ void silc_packet_engine_free_streams_list(SilcDList streams); * stream. After this function returns, packets can immediately be * sent to and received from the stream. * + * The `stream' will be owned by the packet stream and will be closed + * and destroyed when the packet stream is destroyed. If the packet + * stream creation fails the `stream' is left intact. + * * NOTES * * SilcPacketStream cannot be used with silc_stream_* routines (such as -- 2.24.0