@ -470,8 +470,10 @@ static void ncd_recv_control_handler(struct ETCP_CONN* conn, struct ll_entry* e)
{ struct ncd_control_msg resp ; resp . cmd = ETCP_RT_ID_NCD_CONTROL ; resp . subcmd = NCD_SUBCMD_KEEP_ALIVE ;
{ struct ncd_control_msg resp ; resp . cmd = ETCP_RT_ID_NCD_CONTROL ; resp . subcmd = NCD_SUBCMD_KEEP_ALIVE ;
resp . node_id = conn - > instance - > node_id ;
resp . node_id = conn - > instance - > node_id ;
struct ll_entry * qe = queue_entry_new ( 0 ) ;
struct ll_entry * qe = queue_entry_new ( 0 ) ;
if ( qe ) { qe - > dgram = u_malloc ( sizeof ( resp ) ) ; memcpy ( qe - > dgram , & resp , sizeof ( resp ) ) ; qe - > len = sizeof ( resp ) ;
if ( qe ) { qe - > dgram = u_malloc ( sizeof ( resp ) ) ;
etcp_send ( conn , qe ) ; }
if ( qe - > dgram ) { memcpy ( qe - > dgram , & resp , sizeof ( resp ) ) ; qe - > len = sizeof ( resp ) ;
if ( etcp_send ( conn , qe ) ! = 0 ) { queue_dgram_free ( qe ) ; queue_entry_free ( qe ) ; } }
else queue_entry_free ( qe ) ; }
}
}
} else {
} else {
DEBUG_INFO ( DEBUG_CATEGORY_NCD , " [ncd] deferred close entry for CLOSE from 0x%016llx " , ( unsigned long long ) sender_id ) ;
DEBUG_INFO ( DEBUG_CATEGORY_NCD , " [ncd] deferred close entry for CLOSE from 0x%016llx " , ( unsigned long long ) sender_id ) ;
@ -915,9 +917,11 @@ void node_conn_direct_close(struct NODE_CONN_DIRECT* h) {
{ struct ncd_control_msg msg ; msg . cmd = ETCP_RT_ID_NCD_CONTROL ; msg . subcmd = NCD_SUBCMD_CLOSE ;
{ struct ncd_control_msg msg ; msg . cmd = ETCP_RT_ID_NCD_CONTROL ; msg . subcmd = NCD_SUBCMD_CLOSE ;
msg . node_id = conn - > instance - > node_id ;
msg . node_id = conn - > instance - > node_id ;
struct ll_entry * qe = queue_entry_new ( 0 ) ;
struct ll_entry * qe = queue_entry_new ( 0 ) ;
if ( qe ) { qe - > dgram = u_malloc ( sizeof ( msg ) ) ; memcpy ( qe - > dgram , & msg , sizeof ( msg ) ) ; qe - > len = sizeof ( msg ) ;
if ( qe ) { qe - > dgram = u_malloc ( sizeof ( msg ) ) ;
etcp_send ( conn , qe ) ;
if ( qe - > dgram ) { memcpy ( qe - > dgram , & msg , sizeof ( msg ) ) ; qe - > len = sizeof ( msg ) ;
DEBUG_INFO ( DEBUG_CATEGORY_NCD , " [ncd] sent CLOSE to 0x%016llx " , ( unsigned long long ) node_id ) ; }
if ( etcp_send ( conn , qe ) ! = 0 ) { queue_dgram_free ( qe ) ; queue_entry_free ( qe ) ; }
else DEBUG_INFO ( DEBUG_CATEGORY_NCD , " [ncd] sent CLOSE to 0x%016llx " , ( unsigned long long ) node_id ) ; }
else queue_entry_free ( qe ) ; }
}
}
entry - > fin_wait_timer = uasync_set_timeout ( entry - > ua , NCD_FIN_WAIT_TIMEOUT_TB , entry , ncd_fin_wait_timeout_cb , " ncd_fin_wait " ) ;
entry - > fin_wait_timer = uasync_set_timeout ( entry - > ua , NCD_FIN_WAIT_TIMEOUT_TB , entry , ncd_fin_wait_timeout_cb , " ncd_fin_wait " ) ;
DEBUG_INFO ( DEBUG_CATEGORY_NCD , " [ncd] fin_wait started node=0x%016llx " , ( unsigned long long ) node_id ) ;
DEBUG_INFO ( DEBUG_CATEGORY_NCD , " [ncd] fin_wait started node=0x%016llx " , ( unsigned long long ) node_id ) ;