Skip to content
Snippets Groups Projects
Commit d733d378 authored by Fredrik Thulin's avatar Fredrik Thulin
Browse files

Call C_Finalize when client disconnects.

Necessary to close all ongoing sessions.
parent ad8bf1a8
No related branches found
No related tags found
No related merge requests found
......@@ -80,6 +80,9 @@ static DispatchState *pkcs11_dispatchers = NULL;
/* A mutex to protect the dispatcher list */
static pthread_mutex_t pkcs11_dispatchers_mutex = PTHREAD_MUTEX_INITIALIZER;
/* To be able to call C_Finalize from call_uninit. */
static CK_RV rpc_C_Finalize(CallState *);
/* -----------------------------------------------------------------------------
* LOGGING and DEBUGGING
*/
......@@ -180,6 +183,12 @@ static void call_uninit(CallState * cs)
{
assert(cs);
/* Close any open sessions. Without this, the application won't be able
* to reconnect (possibly after a crash).
*/
if (cs->req)
rpc_C_Finalize(cs);
call_reset(cs);
gck_rpc_message_free(cs->req);
......@@ -433,7 +442,7 @@ proto_read_attribute_array(CallState * cs, CK_ATTRIBUTE_PTR * result,
msg = cs->req;
/* Make sure this is in the rigth order */
/* Make sure this is in the right order */
assert(!msg->signature || gck_rpc_message_verify_part(msg, "aA"));
/* Read the number of attributes */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment