diff --git a/Adapter.cc b/Adapter.cc index e71170f..a628201 100644 --- a/Adapter.cc +++ b/Adapter.cc @@ -34,8 +34,6 @@ namespace pEp { namespace Adapter { messageToSend_t _messageToSend = nullptr; notifyHandshake_t _notifyHandshake = nullptr; - messageToSend_t _messageToSend_sync = nullptr; - notifyHandshake_t _notifyHandshake_sync = nullptr; std::thread *_sync_thread = nullptr; ::utility::locked_queue< SYNC_EVENT > q; @@ -89,12 +87,8 @@ namespace pEp { break; case init: - if (!_session) { - if (in_sync && _messageToSend_sync) - status = ::init(&_session, _messageToSend_sync, _inject_sync_event); - else - status = ::init(&_session, _messageToSend, _inject_sync_event); - } + if (!_session) + status = ::init(&_session, _messageToSend, _inject_sync_event); break; default: diff --git a/Adapter.hxx b/Adapter.hxx index 53b7bb4..429cf82 100644 --- a/Adapter.hxx +++ b/Adapter.hxx @@ -19,12 +19,16 @@ namespace pEp { template< class T > void sync_thread(T *obj, function< void(T *) > _startup, function< void(T *) > _shutdown) { + assert(_messageToSend); + assert(_notifyHandshake); if (obj && _startup) _startup(obj); + session(); + PEP_STATUS status = register_sync_callbacks(session(), nullptr, _notifyHandshake, _retrieve_next_sync_event); - throw_status(status); +// throw_status(status); do_sync_protocol(session(), (void *)obj); unregister_sync_callbacks(session()); diff --git a/status_to_string.cc b/status_to_string.cc index 0331319..123ed9e 100644 --- a/status_to_string.cc +++ b/status_to_string.cc @@ -16,7 +16,7 @@ std::string status_to_string(PEP_STATUS status) }else{ ss << status; } - return ss.str() + " \"" + pep_status_to_string(status) + '"'; + return ss.str() + " \"" + pEp_status_to_string(status) + '"'; } } // end of namespace pEp diff --git a/status_to_string.hh b/status_to_string.hh index 6c859ce..e9ae835 100644 --- a/status_to_string.hh +++ b/status_to_string.hh @@ -1,6 +1,7 @@ #pragma once #include +#include #include namespace pEp