|
|
|
@ -133,7 +133,6 @@ static void keepalive_timer_cb(void* arg) { |
|
|
|
* (topo_recovery → ncd_revive_entry) — link может быть освобождён. */ |
|
|
|
* (topo_recovery → ncd_revive_entry) — link может быть освобождён. */ |
|
|
|
struct ETCP_CONN *etcp = link->etcp; |
|
|
|
struct ETCP_CONN *etcp = link->etcp; |
|
|
|
int is_tcp = link->is_tcp; |
|
|
|
int is_tcp = link->is_tcp; |
|
|
|
struct stcp_link *tcp_link = link->tcp_link; |
|
|
|
|
|
|
|
int local_link_id = link->local_link_id; |
|
|
|
int local_link_id = link->local_link_id; |
|
|
|
struct sockaddr_storage raddr = link->remote_addr; |
|
|
|
struct sockaddr_storage raddr = link->remote_addr; |
|
|
|
uint8_t remote_ka = link->remote_keepalive; |
|
|
|
uint8_t remote_ka = link->remote_keepalive; |
|
|
|
@ -144,7 +143,7 @@ static void keepalive_timer_cb(void* arg) { |
|
|
|
int alive = 0; |
|
|
|
int alive = 0; |
|
|
|
for (struct ETCP_LINK *x = etcp->links; x; x = x->next) if (x == link) { alive = 1; break; } |
|
|
|
for (struct ETCP_LINK *x = etcp->links; x; x = x->next) if (x == link) { alive = 1; break; } |
|
|
|
if (!alive) return; |
|
|
|
if (!alive) return; |
|
|
|
if (is_tcp && tcp_link) stcp_link_close(tcp_link); |
|
|
|
if (is_tcp && link->tcp_link) { stcp_link_close(link->tcp_link); link->tcp_link = NULL; } |
|
|
|
if (old_link_status) { |
|
|
|
if (old_link_status) { |
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_CONNECTION, "[%s] Link %d down: addr=%s ka=%d remote_ka=%d state=%d init=%d tmo: %llu>%llu els=%llums", etcp->log_name, local_link_id, sockaddr_storage_to_str(&raddr).str, 0, remote_ka, link_state, initialized, (unsigned long long)timeout_units, (unsigned long long)elapsed, (unsigned long long)(elapsed/10)); |
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_CONNECTION, "[%s] Link %d down: addr=%s ka=%d remote_ka=%d state=%d init=%d tmo: %llu>%llu els=%llums", etcp->log_name, local_link_id, sockaddr_storage_to_str(&raddr).str, 0, remote_ka, link_state, initialized, (unsigned long long)timeout_units, (unsigned long long)elapsed, (unsigned long long)(elapsed/10)); |
|
|
|
} |
|
|
|
} |
|
|
|
|