|
|
|
@ -1,6 +1,7 @@ |
|
|
|
// utun_node.cpp — embedded uTun node running in a dedicated thread
|
|
|
|
// utun_node.cpp — embedded uTun node running in a dedicated thread
|
|
|
|
#include "utun_node.h" |
|
|
|
#include "utun_node.h" |
|
|
|
#include <cinttypes> |
|
|
|
#include <cinttypes> |
|
|
|
|
|
|
|
#include <QDir> |
|
|
|
#include "../../lib/socket_compat.h" |
|
|
|
#include "../../lib/socket_compat.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "../db/db_manager.h" |
|
|
|
#include "../db/db_manager.h" |
|
|
|
@ -62,6 +63,7 @@ void UtunNode::setDebugFile(const QString& path) { |
|
|
|
|
|
|
|
|
|
|
|
void UtunNode::setDbPath(const QString& path) { |
|
|
|
void UtunNode::setDbPath(const QString& path) { |
|
|
|
m_dbPath = path; |
|
|
|
m_dbPath = path; |
|
|
|
|
|
|
|
QDir(path).mkpath("."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UtunNode::setDebugLevel(const QString& level) { |
|
|
|
void UtunNode::setDebugLevel(const QString& level) { |
|
|
|
@ -245,7 +247,7 @@ void UtunNode::runLoop() { |
|
|
|
etcp_router_bind(m_instance, ETCP_RT_ID_CHAT, recvCallback); |
|
|
|
etcp_router_bind(m_instance, ETCP_RT_ID_CHAT, recvCallback); |
|
|
|
|
|
|
|
|
|
|
|
/* Initialize chat_core (DB) and chat_sync (channel/message P2P sync) */ |
|
|
|
/* Initialize chat_core (DB) and chat_sync (channel/message P2P sync) */ |
|
|
|
chat_core_init(m_instance, m_dbPath.toUtf8().constData()); |
|
|
|
chat_core_init(m_instance, QString(m_dbPath + "/chats.db").toUtf8().constData()); |
|
|
|
chat_sync_init(m_instance, nullptr); |
|
|
|
chat_sync_init(m_instance, nullptr); |
|
|
|
chat_sync_auto_connect_start(m_instance); |
|
|
|
chat_sync_auto_connect_start(m_instance); |
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "chat_core + chat_sync + auto_connect initialized"); |
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "chat_core + chat_sync + auto_connect initialized"); |
|
|
|
|