Volker Birk 3 years ago
parent
commit
3ee86779f0
4 changed files with 9 additions and 10 deletions
  1. +2
    -8
      Adapter.cc
  2. +5
    -1
      Adapter.hxx
  3. +1
    -1
      status_to_string.cc
  4. +1
    -0
      status_to_string.hh

+ 2
- 8
Adapter.cc View File

@ -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:


+ 5
- 1
Adapter.hxx View File

@ -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());


+ 1
- 1
status_to_string.cc View File

@ -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

+ 1
- 0
status_to_string.hh View File

@ -1,6 +1,7 @@
#pragma once
#include <pEp/pEpEngine.h>
#include <pEp/status_to_string.h>
#include <string>
namespace pEp


Loading…
Cancel
Save