Browse Source

adapt to new JSON adapter

unblock Startup(), see code comment why
COM-121
Volker Birk 10 months ago
parent
commit
d93891db60
3 changed files with 14 additions and 1 deletions
  1. +7
    -1
      CpEpEngine.cpp
  2. +6
    -0
      LocalJSONAdapter.cpp
  3. +1
    -0
      LocalJSONAdapter.h

+ 7
- 1
CpEpEngine.cpp View File

@ -1835,7 +1835,13 @@ STDMETHODIMP CpEpEngine::Startup()
{
try
{
pEp::CallbackDispatcher::start_sync();
// this must be unblocked, because it's not possible to have two API calls in parallel
// start_sync() may send notifyHandshake() to ask for a passphrase; when this happens
// the client needs to call ConfigPassphrase() while the startup process is being executed
// so we need to return from Startup() immediately to make this possible
auto sync_starter_thread = std::thread(pEp::CallbackDispatcher::start_sync);
sync_starter_thread.detach();
}
catch (bad_alloc&) {
return E_OUTOFMEMORY;


+ 6
- 0
LocalJSONAdapter.cpp View File

@ -1,9 +1,15 @@
#include "stdafx.h"
#include "LocalJSONAdapter.h"
#include <pEp/Adapter.hh>
void startSync() { }
void stopSync() { }
std::thread::id LocalJSONAdapter::get_sync_thread_id() const
{
return pEp::Adapter::sync_thread_id();
}
LocalJSONAdapter& LocalJSONAdapter::createInstance()
{
return dynamic_cast<LocalJSONAdapter&>(JsonAdapter::createInstance(new LocalJSONAdapter()));


+ 1
- 0
LocalJSONAdapter.h View File

@ -7,6 +7,7 @@ class LocalJSONAdapter :
{
public:
static LocalJSONAdapter& createInstance();
std::thread::id get_sync_thread_id() const;
protected:
virtual inject_sync_event_t getInjectSyncEvent() const override


Loading…
Cancel
Save