@ -398,7 +398,14 @@ static int insert_link(struct ETCP_SOCKET* e_sock, struct ETCP_LINK* link) {
}
int idx = find_link_index ( e_sock , link - > ip_port_hash ) ;
if ( idx > = 0 ) return - 1 ;
if ( idx > = 0 ) {
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " insert_link DUP: hash=0x%08x idx=%d existing_conn=%s existing_etcp=%s num_channels=%zu sock=%s " ,
link - > ip_port_hash , idx ,
e_sock - > links [ idx ] - > etcp ? e_sock - > links [ idx ] - > etcp - > log_name : " ? " ,
e_sock - > links [ idx ] - > etcp ? " [...] " : " ? " ,
e_sock - > num_channels , e_sock - > name ) ;
return - 1 ;
}
idx = - ( idx + 1 ) ;
@ -1525,6 +1532,8 @@ void etcp_connections_read_callback_socket(socket_t sock, void* arg) {
return ;
}
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " raw_recv on %s from=%s len=%zd " , e_sock - > name , sockaddr_storage_to_str ( & addr ) . str , recv_len ) ;
// DUMP: Show received packet content
if ( debug_should_output ( DEBUG_LEVEL_DEBUG , DEBUG_CATEGORY_CRYPTO ) ) log_dump ( DEBUG_LEVEL_DEBUG , DEBUG_CATEGORY_CRYPTO , " RECV in: " , data , recv_len ) ;
@ -1705,6 +1714,8 @@ void etcp_connections_read_callback_socket(socket_t sock, void* arg) {
if ( memcmp ( conn - > crypto_ctx . peer_public_key , sc . peer_public_key , SC_PUBKEY_SIZE ) ) { errorcode = 5 ; DEBUG_ERROR ( DEBUG_CATEGORY_CRYPTO , " peer key mismatch for node %016llx " , ( unsigned long long ) peer_id ) ; goto ec_fr ; } // коллизия - peer id совпал а ключи разные.
}
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " INIT conn=%s new_conn=%d peer=0x%016llx state=%d links_up=%d links=%p " , conn - > log_name , new_conn , ( unsigned long long ) peer_id , conn - > state , conn - > links_up , ( void * ) conn - > links ) ;
// Check if link already exists (for CHANNEL_INIT recovery)
struct ETCP_LINK * existing_link = etcp_link_find_by_remote_id ( conn , req - > link_id ) ;