Preserve active owners and paths when an incoming TCP link is cancelled
This commit is contained in:
1 parent
d5d103148f
commit
e51badebcb
2 files changed
+8
-1
No files matched your search
@@ -149,7 +149,12 @@ void tcp_server_on_link(struct stcp_link *link, struct ETCP_SOCKET *tcp_sock) {
|
||||
if (!tlink) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_ETCP, "tcp_server_on_link: link creation failed/cancelled peer=%016llx", (unsigned long long)node_id);
|
||||
stcp_link_close(link);
|
||||
if (new_conn) etcp_connection_close(conn);
|
||||
if (new_conn) {
|
||||
int owners = node_conn_direct_handle_count(conn);
|
||||
if (!conn->links && !owners) etcp_connection_close(conn);
|
||||
else DEBUG_DEBUG(DEBUG_CATEGORY_ETCP, "[%s] cancelled TCP accept preserves connection: other_links=%u owners=%d closing=%u",
|
||||
conn->log_name, conn->links != NULL, owners, conn->close_requested);
|
||||
}
|
||||
return;
|
||||
}
|
||||
tlink->tcp_link = link;
|
||||
|
||||
@@ -403,6 +403,8 @@ int etcp_create_server_socket(struct UTUN_INSTANCE* instance, struct CFG_SERVER*
|
||||
|
||||
struct stcp_link;
|
||||
struct stcp_client;
|
||||
/* Присоединить принятый STCP к ETCP. При отказе закрывает адаптер; новый conn удаляет только без других линков и NCD handles.
|
||||
* Callbacks могут передать conn другому владельцу или создать путь: отмена этого линка их не закрывает. */
|
||||
void tcp_server_on_link(struct stcp_link *link, struct ETCP_SOCKET *tcp_sock);
|
||||
|
||||
// ── Создание, поиск и закрытие линков ──
|
||||
|
||||
Reference in new issue
Block a user