@ -1727,14 +1727,14 @@ void etcp_connections_read_callback_socket(socket_t sock, void* arg) {
// For CHANNEL_INIT (0x04): if link already initialized - no reset, otherwise reset
// For INIT_REQUEST (0x02): always reset
// Check session_id: if same - no reinit, if different - client restarted, do reinit
if ( conn - > session_id = = session_id ) {
send_reset = 0 ; // Same session, no reinit needed
DEBUG_TRACE ( DEBUG_CATEGORY_CONNECTION , " same session_id, skip reinit " ) ;
} else {
send_reset = 1 ; // New session or uninitialized link - send reset
DEBUG_TRACE ( DEBUG_CATEGORY_CONNECTION , " new session_id %08x (was %08x), do reinit " , session_id , conn - > session_id ) ;
if ( code = = ETCP_INIT_REQUEST | | conn - > session_id ! = session_id ) {
send_reset = 1 ; // Client explicitly requested reset, or new session
DEBUG_TRACE ( DEBUG_CATEGORY_CONNECTION , " do reinit (code=%02x session was %08x now %08x) " , code , conn - > session_id , session_id ) ;
conn - > session_id = session_id ;
etcp_conn_reinit ( conn ) ;
} else {
send_reset = 0 ; // Same session, no reinit needed
DEBUG_TRACE ( DEBUG_CATEGORY_CONNECTION , " same session_id, skip reinit " ) ;
}
// Cancel existing timers
@ -1752,10 +1752,10 @@ void etcp_connections_read_callback_socket(socket_t sock, void* arg) {
link - > remote_only_local = req - > only_local ;
link - > remote_type = req - > type ;
// For new links: check session_id to avoid false reinit
if ( conn - > session_id ! = session_id ) {
send_reset = 1 ; // New session or uninitialized link - send reset
DEBUG_TRACE ( DEBUG_CATEGORY_CONNECTION , " new session_id %08x (was %08x) for new link, do reinit " , session_id , conn - > session_id ) ;
// For new links: reset if client requested or session changed
if ( code = = ETCP_INIT_REQUEST | | co nn - > session_id ! = session_id ) {
send_reset = 1 ;
DEBUG_TRACE ( DEBUG_CATEGORY_CONNECTION , " do reinit for new link (code=%02x session was %08x now %08x) " , code , conn - > session_id , session_id ) ;
conn - > session_id = session_id ;
etcp_conn_reinit ( conn ) ;
}