|
@ -6,26 +6,9 @@ |
|
|
#include <iomanip> |
|
|
#include <iomanip> |
|
|
#include <assert.h> |
|
|
#include <assert.h> |
|
|
|
|
|
|
|
|
namespace pEp { |
|
|
|
|
|
namespace Adapter { |
|
|
|
|
|
using namespace std; |
|
|
using namespace std; |
|
|
|
|
|
|
|
|
static messageToSend_t _messageToSend = nullptr; |
|
|
namespace pEp { |
|
|
static notifyHandshake_t _notifyHandshake = nullptr; |
|
|
|
|
|
static std::thread *_sync_thread = nullptr; |
|
|
|
|
|
|
|
|
|
|
|
static ::utility::locked_queue< SYNC_EVENT >& queue() |
|
|
|
|
|
{ |
|
|
|
|
|
static ::utility::locked_queue< SYNC_EVENT > q; |
|
|
|
|
|
return q; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static std::mutex& mtx() |
|
|
|
|
|
{ |
|
|
|
|
|
static std::mutex m; |
|
|
|
|
|
return m; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void throw_status(PEP_STATUS status) |
|
|
void throw_status(PEP_STATUS status) |
|
|
{ |
|
|
{ |
|
|
if (status == PEP_STATUS_OK) |
|
|
if (status == PEP_STATUS_OK) |
|
@ -42,6 +25,23 @@ namespace pEp { |
|
|
throw runtime_error(build.str()); |
|
|
throw runtime_error(build.str()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
namespace Adapter { |
|
|
|
|
|
static messageToSend_t _messageToSend = nullptr; |
|
|
|
|
|
static notifyHandshake_t _notifyHandshake = nullptr; |
|
|
|
|
|
static std::thread *_sync_thread = nullptr; |
|
|
|
|
|
|
|
|
|
|
|
static ::utility::locked_queue< SYNC_EVENT >& queue() |
|
|
|
|
|
{ |
|
|
|
|
|
static ::utility::locked_queue< SYNC_EVENT > q; |
|
|
|
|
|
return q; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static std::mutex& mtx() |
|
|
|
|
|
{ |
|
|
|
|
|
static std::mutex m; |
|
|
|
|
|
return m; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static int _inject_sync_event(SYNC_EVENT ev, void *management) |
|
|
static int _inject_sync_event(SYNC_EVENT ev, void *management) |
|
|
{ |
|
|
{ |
|
|
if (is_sync_thread(session())) { |
|
|
if (is_sync_thread(session())) { |
|
|