Clarify constructor admission requirements and keep helper below includes

This commit is contained in:
evgeny committed 2026-10-30 22:42:50 +01:00
1 parent 14fa3acf32
commit a2452cf1b1
3 files changed
+11 -9

No files matched your search

+1
View File
@@ -268,6 +268,7 @@ struct ETCP_CONN {
#define RTT_CB_PERIOD_TB 600000 // 1 минута в 0.1ms
/* Создать транспортный объект в instance, name копируется (может быть NULL).
* require_known_node=1 требует точный ключ участника своей CHAT-группы при аутентифицированном handshake; 0 — обычная политика.
* Жизненным циклом прикладного соединения управляет NCD. Возвращает объект либо NULL при ошибке/отмене из callback.
* New-connection/NEW callbacks могут закрыть объект; после отмены конструктор завершает закрытие и не возвращает handle. */
struct ETCP_CONN* etcp_connection_create(struct UTUN_INSTANCE* instance, char* name, int require_known_node);
+9 -8
View File
@@ -31,6 +31,15 @@
#include "../lib/debug_config.h"
#include "etcp_loadbalancer.h"
#include "etcp_keepalive.h"
#ifdef UTUN_HAVE_STANDBY
#include "standby.h"
#endif
#include <stdlib.h>
#include <time.h>
#include "../lib/mem.h"
#include "etcp.h"
/* Вызывать только после аутентификации ciphertext/STCP, под active_users/callbacks_running.
* Новый handshake перепроверяет членство; обычные DATA используют положительный кэш этого линка. */
static int admit_peer(struct ETCP_LINK* link, int handshake) {
@@ -46,14 +55,6 @@ static int admit_peer(struct ETCP_LINK* link, int handshake) {
DEBUG_INFO(DEBUG_CATEGORY_ETCP, "[%s] authenticated known peer admitted path=%u", c->log_name, link->local_link_id);
return 1;
}
#include "etcp_keepalive.h"
#ifdef UTUN_HAVE_STANDBY
#include "standby.h"
#endif
#include <stdlib.h>
#include <time.h>
#include "../lib/mem.h"
#include "etcp.h"
// Читаемое имя типа сокета (CFG_SERVER_TYPE_*) для логов.
static const char* server_type_str(uint8_t type) {