{
SilcClientConnection conn = fsm_context;
SilcClientCommandContext cmd;
+ SilcList list;
+ SilcIDCacheEntry entry;
+ SilcClientEntry client_entry;
/* Finish running command threads. This will also finish waiting packet
thread, as they are always waiting for some command. If any thread is
conn->internal->op = NULL;
}
+ /* Abort ongoing client entry operations */
+ if (conn->internal->client_cache) {
+ if (silc_idcache_get_all(conn->internal->client_cache, &list)) {
+ silc_list_start(list);
+ while ((entry = silc_list_get(list))) {
+ client_entry = entry->context;
+ if (client_entry->internal.op) {
+ silc_async_abort(client_entry->internal.op, NULL, NULL);
+ client_entry->internal.op = NULL;
+ }
+ }
+ }
+ }
+
/* If event thread is running, finish it. */
if (silc_fsm_is_started(&conn->internal->event_thread)) {
SILC_LOG_DEBUG(("Finish event thread"));
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 - 2008 Pekka Riikonen
+ Copyright (C) 2001 - 2014 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
if (client_entry->internal.hmac_receive)
silc_hmac_free(client_entry->internal.hmac_receive);
silc_client_ftp_session_free_client(client, client_entry);
+ if (client_entry->internal.op)
+ silc_async_abort(client_entry->internal.op, NULL, NULL);
+ client_entry->internal.op = NULL;
if (client_entry->internal.ke)
silc_client_abort_key_agreement(client, conn, client_entry);
silc_atomic_uninit32(&client_entry->internal.deleted);
return FALSE;
}
+ /* Abort ongoing operation */
+ if (client_entry->internal.op) {
+ SILC_LOG_DEBUG(("Aborting ongoing operation %p",
+ client_entry->internal.op));
+ silc_async_abort(client_entry->internal.op, NULL, NULL);
+ client_entry->internal.op = NULL;
+ }
+
silc_client_unref_client(client, conn, client_entry);
return TRUE;
}
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 2001 - 2007 Pekka Riikonen
+ Copyright (C) 2001 - 2014 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
SilcClientListener listener; /* Listener */
SilcKeyAgreementCallback completion; /* Key agreement completion */
void *context; /* User context */
- SilcAsyncOperation op; /* Async operation, initiator */
};
/************************ Static utility functions **************************/
silc_client_listener_free(ke->listener);
silc_schedule_task_del_by_context(conn->internal->schedule, client_entry);
- if (ke->op)
- silc_async_abort(ke->op, NULL, NULL);
+ if (client_entry->internal.op)
+ silc_async_abort(client_entry->internal.op, NULL, NULL);
+ client_entry->internal.op = NULL;
client_entry->internal.ke = NULL;
client_entry->internal.prv_resp = FALSE;
silc_client_unref_client(client, conn, client_entry);
SilcClientKeyAgreement ke = client_entry->internal.ke;
SilcSKEKeyMaterial keymat;
- ke->op = NULL;
+ client_entry->internal.op = NULL;
switch (status) {
case SILC_CLIENT_CONN_SUCCESS:
params->no_authentication = TRUE;
/* Connect to the remote client. Performs key exchange automatically. */
- ke->op = silc_client_connect_to_client(client, params, public_key,
- private_key, hostname, port,
- silc_client_keyagr_completion,
- client_entry);
- if (!ke->op) {
+ client_entry->internal.op =
+ silc_client_connect_to_client(client, params, public_key,
+ private_key, hostname, port,
+ silc_client_keyagr_completion,
+ client_entry);
+ if (!client_entry->internal.op) {
completion(client, conn, client_entry, SILC_KEY_AGREEMENT_ERROR,
NULL, context);
silc_client_keyagr_free(client, conn, client_entry);
params->no_authentication = TRUE;
/* Perform key exchange protocol */
- ke->op = silc_client_key_exchange(client, params, public_key,
- private_key, stream, SILC_CONN_CLIENT,
- silc_client_keyagr_completion,
- client_entry);
- if (!ke->op) {
+ client_entry->internal.op =
+ silc_client_key_exchange(client, params, public_key,
+ private_key, stream, SILC_CONN_CLIENT,
+ silc_client_keyagr_completion,
+ client_entry);
+ if (!client_entry->internal.op) {
completion(client, conn, client_entry, SILC_KEY_AGREEMENT_ERROR,
NULL, context);
silc_client_keyagr_free(client, conn, client_entry);