Detach ETCP core from obsolete connect contexts
This commit is contained in:
1 parent
008f499367
commit
fc5b3911f3
3 files changed
-30
No files matched your search
@@ -3,7 +3,6 @@
|
||||
#include "etcp.h"
|
||||
#include "etcp_api.h"
|
||||
#include "etcp_session.h"
|
||||
#include "etcp_connect.h"
|
||||
#include "node_conn_direct.h"
|
||||
#include "etcp_debug.h"
|
||||
#include "call_ring.h"
|
||||
@@ -443,8 +442,6 @@ static void etcp_connection_free_resources(struct ETCP_CONN* etcp) {
|
||||
if (etcp->inflight_pool) { memory_pool_destroy(etcp->inflight_pool); etcp->inflight_pool = NULL; }
|
||||
if (etcp->io_pool) { memory_pool_destroy(etcp->io_pool); etcp->io_pool = NULL; }
|
||||
|
||||
etcp_connect_cancel_for_conn(etcp->instance, etcp);
|
||||
|
||||
u_free(etcp->name);
|
||||
u_free(etcp);
|
||||
}
|
||||
|
||||
@@ -248,30 +248,6 @@ void etcp_remove_link_status_cbk(struct UTUN_INSTANCE* inst, etcp_link_status_cb
|
||||
*/
|
||||
void etcp_fire_link_status_cbk(struct ETCP_LINK* link, int old_state, int old_status);
|
||||
|
||||
// ---- Background connection initialization ----
|
||||
#define ETCP_CONNECT_EARLY 1
|
||||
#define ETCP_CONNECT_LATE 2
|
||||
|
||||
typedef void (*etcp_connect_callback_t)(void* arg, struct ETCP_CONN* conn, int type);
|
||||
|
||||
/**
|
||||
* @brief Фоновая инициализация соединения к узлу
|
||||
*
|
||||
* @param instance UTUN instance
|
||||
* @param node Узел из node registry (TOPO_GROUP_NODE)
|
||||
* @param cb Коллбэк завершения (сигнатура etcp_connect_callback_t)
|
||||
* @param arg Пользовательский аргумент
|
||||
* @param flags Битовая маска этапов (ETCP_CONNECT_EARLY / LATE)
|
||||
* @return 0 при успехе, -1 при ошибке
|
||||
*
|
||||
* @note Коллбэк вызывается на каждом запрошенном этапе с параметром
|
||||
* type = ETCP_CONNECT_EARLY / ETCP_CONNECT_LATE
|
||||
* (или 0 при таймауте/неудаче). При уже готовом соединении EARLY+LATE
|
||||
* доставляются немедленно.
|
||||
*/
|
||||
int etcp_connect(struct UTUN_INSTANCE* instance, struct TOPO_GROUP_NODE* node,
|
||||
etcp_connect_callback_t cb, void* arg, uint8_t flags);
|
||||
|
||||
/**
|
||||
* @brief Структура bindings для ETCP API (per-instance)
|
||||
*/
|
||||
|
||||
@@ -70,7 +70,6 @@ struct control_server;
|
||||
|
||||
struct PING_CONTEXT;
|
||||
struct CONN_MGR;
|
||||
struct ETCP_CONNECT;
|
||||
struct DB_SYNC;
|
||||
struct NAT_DETECTION;
|
||||
struct STUN_NAT;
|
||||
@@ -276,8 +275,6 @@ struct UTUN_INSTANCE {
|
||||
// Networks (queue of NETWORK_ENTRY, indexed by 56-bit id)
|
||||
struct ll_queue* networks;
|
||||
|
||||
// Pending background connections (etcp_connect API)
|
||||
struct ETCP_CONNECT* pending_connects;
|
||||
uint32_t etcp_connect_timeout_tb; // Initial timeout in 0.1ms units, default 20000 (2s)
|
||||
|
||||
// NTP time synchronization
|
||||
|
||||
Reference in new issue
Block a user