X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Firssi%2Fsrc%2Fsilc%2Fcore%2Fsilc-servers.c;h=e763b8eef2f9c6792738b275458709ab38de4224;hb=9747251aea338d4c29ffbb6bff45f81ea4a493a6;hp=e16fb02cdc056fef1116a982f49259c3bf0d7483;hpb=8ad07bf7fa3f4a579935e59c8832315e19d75908;p=silc.git diff --git a/apps/irssi/src/silc/core/silc-servers.c b/apps/irssi/src/silc/core/silc-servers.c index e16fb02c..e763b8ee 100644 --- a/apps/irssi/src/silc/core/silc-servers.c +++ b/apps/irssi/src/silc/core/silc-servers.c @@ -426,6 +426,22 @@ 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, ¶ms, irssi_pubkey, irssi_privkey, @@ -466,6 +482,12 @@ static void sig_disconnected(SILC_SERVER_REC *server) if (!IS_SILC_SERVER(server)) return; + /* 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; + } + if (server->conn) { /* Close connection */ silc_client_close_connection(silc_client, server->conn);