@ -581,6 +581,8 @@ void etcp_conn_queue_set_ready(struct ETCP_CONN* conn) {
if ( ! conn | | conn - > state ! = 0 ) return ;
// Reindex: remove old entry (key=0), add new entry with real peer_node_id
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " [%s] queue_set_ready: removing old entry=%p key=0 -> new key=0x%llx " ,
conn - > log_name , ( void * ) conn - > conn_queue_entry , ( unsigned long long ) conn - > peer_node_id ) ;
if ( conn - > conn_queue & & conn - > conn_queue_entry ) {
queue_remove_data ( conn - > conn_queue , conn - > conn_queue_entry ) ;
queue_entry_free ( conn - > conn_queue_entry ) ;
@ -595,6 +597,8 @@ void etcp_conn_queue_set_ready(struct ETCP_CONN* conn) {
conn - > conn_queue = conn - > instance - > connections ;
conn - > state = 1 ;
queue_data_put_with_index ( conn - > instance - > connections , qe ) ;
DEBUG_DEBUG ( DEBUG_CATEGORY_DEBUG , " [%s] queue_set_ready: new entry=%p put in queue, count=%d " ,
conn - > log_name , ( void * ) qe , queue_entry_count ( conn - > instance - > connections ) ) ;
DEBUG_INFO ( DEBUG_CATEGORY_ETCP , " [%s] moved to ready queue, state=%d peer_node_id=0x%llx " ,
conn - > log_name , conn - > state , ( unsigned long long ) conn - > peer_node_id ) ;
@ -634,7 +638,8 @@ void etcp_conn_set_peer_node_id(struct ETCP_CONN* conn, uint64_t peer_node_id) {
conn - > peer_node_id = peer_node_id ;
etcp_update_log_name ( conn ) ;
DEBUG_INFO ( DEBUG_CATEGORY_ETCP , " [%s] peer_node_id set to 0x%llx " , conn - > log_name , ( unsigned long long ) peer_node_id ) ;
DEBUG_INFO ( DEBUG_CATEGORY_ETCP , " [%s] peer_node_id set to 0x%llx (state=%d reindexed=%d) " ,
conn - > log_name , ( unsigned long long ) peer_node_id , conn - > state , conn - > state = = 1 ) ;
}