COM-29: Adapt to new interface changes in the engine. keysync
authorMarkus Schaber <markus@pep-security.net>
Tue, 04 Oct 2016 21:50:26 +0200
branchkeysync
changeset 1759aabb2c9df08
parent 174 1fa1296363f9
child 176 b46cc11e1ba8
COM-29: Adapt to new interface changes in the engine.
CpEpEngine.cpp
CpEpEngine.h
     1.1 --- a/CpEpEngine.cpp	Tue Oct 04 12:31:52 2016 +0200
     1.2 +++ b/CpEpEngine.cpp	Tue Oct 04 21:50:26 2016 +0200
     1.3 @@ -1313,8 +1313,10 @@
     1.4  
     1.5  	// Init our keysync session
     1.6  	PEP_STATUS status = ::init(&keysync_session);
     1.7 -	::register_sync_callbacks(m_session, (void*)this, messageToSend, showHandshake, inject_sync_msg, retreive_next_sync_msg);
     1.8 -	assert(status = PEP_STATUS_OK);
     1.9 +	::register_sync_callbacks(keysync_session, (void*)this, messageToSend, showHandshake, inject_sync_msg, retreive_next_sync_msg);
    1.10 +	assert(status = PEP_STATUS_OK, "");
    1.11 +
    1.12 +    attach_sync_session(get_session(), keysync_session);
    1.13  
    1.14  	// Star the keysync thread
    1.15  	keysync_thread = new thread(::do_sync_protocol, keysync_session, this);
    1.16 @@ -1345,6 +1347,8 @@
    1.17  	if (!keysync_abort_requested)
    1.18  		return; // someone called start_keysync() while we were trying to stop it...
    1.19  
    1.20 +    detach_sync_session(get_session());
    1.21 +
    1.22  	// wait for the thread to end
    1.23  	keysync_thread->join();
    1.24  
     2.1 --- a/CpEpEngine.h	Tue Oct 04 12:31:52 2016 +0200
     2.2 +++ b/CpEpEngine.h	Tue Oct 04 21:50:26 2016 +0200
     2.3 @@ -86,7 +86,6 @@
     2.4          PEP_STATUS status = ::init(&m_session);
     2.5          assert(status == PEP_STATUS_OK);
     2.6          ::register_examine_function(m_session, CpEpEngine::examine_identity, (void *)this);
     2.7 -        ::register_sync_callbacks(m_session, (void*)this, messageToSend, showHandshake, inject_sync_msg, retreive_next_sync_msg);
     2.8          ::log_event(m_session, "Startup", "pEp COM Adapter", NULL, NULL);
     2.9      }
    2.10  
    2.11 @@ -94,7 +93,6 @@
    2.12      {
    2.13          stop_keysync();
    2.14          StopKeyserverLookup();
    2.15 -        ::unregister_sync_callbacks(m_session);
    2.16          ::log_event(m_session, "Shutdown", "pEp COM Adapter", NULL, NULL);
    2.17          ::release(m_session);
    2.18      }