Merge branch 'master' of git://valera-ext.nynaeve.net/silc into silc.1.1.branch
[silc.git] / apps / irssi / src / silc / core / silc-servers.c
index e763b8eef2f9c6792738b275458709ab38de4224..9dd1c8e25030a81b18c99fcef6c70540e3c327fd 100644 (file)
@@ -1,7 +1,7 @@
 /*
   silc-server.c : irssi
 
-  Copyright (C) 2000 - 2007 Timo Sirainen
+  Copyright (C) 2000 - 2008 Timo Sirainen
                             Pekka Riikonen <priikone@silcnet.org>
 
   This program is free software; you can redistribute it and/or modify
@@ -415,6 +415,7 @@ static void sig_connected_stream_created(SilcSocketStreamStatus status,
   params.timeout_secs = settings_get_int("key_exchange_timeout_secs");
   params.rekey_secs = settings_get_int("key_exchange_rekey_secs");
   params.pfs = settings_get_bool("key_exchange_rekey_pfs");
+  params.context = server;
 
   /* Try to read detached session data and use it if found. */
   file = silc_get_session_filename(server);
@@ -426,22 +427,6 @@ static void sig_connected_stream_created(SilcSocketStreamStatus status,
                        SILCTXT_REATTACH, server->tag);
   silc_free(file);
 
-  /*
-       * Store the SILC_SERVER_REC in the stream context so that we can fetch it
-       * from the verify key exchange prompt.  There should have been an initial
-       * user parameter value for the SilcClientConnection that could have been
-       * passed to SilcClientConnectionParams, but because there's no version
-       * number or size field in SilcClientConnectionParams, it is fixed for all
-       * time and not extendable.
-       *
-       * Instead, we must revert to pulling the SilcStream out of the
-       * SilcPacketStream associated with the SilcClientConnection object in the
-       * verify key exchange prompt callback in order to get our per-connection
-       * context.  Hence, the extra levels of indirection.
-       */
-
-  silc_socket_stream_set_context(stream, server);
-
   /* Start key exchange */
   server->op = silc_client_key_exchange(silc_client, &params,
                                        irssi_pubkey, irssi_privkey,
@@ -485,7 +470,7 @@ static void sig_disconnected(SILC_SERVER_REC *server)
   /* If we have a prompt in progress, then abort it. */
   if (server->prompt_op) {
     silc_async_abort(server->prompt_op, NULL, NULL);
-        server->prompt_op = NULL;
+    server->prompt_op = NULL;
   }
 
   if (server->conn) {