Index: src/orb/orb-core/orbit-small.c =================================================================== --- src/orb/orb-core/orbit-small.c (revision 2024) +++ src/orb/orb-core/orbit-small.c (working copy) @@ -1149,6 +1149,11 @@ CORBA_exception_set_system (ev, ex_CORBA_COMM_FAILURE, aqe->completion_status); + if (aqe->mqe.cnx && + aqe->mqe.cnx->parent.status == LINK_TIMEOUT) + CORBA_exception_set_system (ev, ex_CORBA_TIMEOUT, + aqe->completion_status); + if (aqe->fn) aqe->fn (aqe->obj, aqe->m_data, aqe, aqe->user_data, ev); Index: src/orb/GIOP/giop-recv-buffer.c =================================================================== --- src/orb/GIOP/giop-recv-buffer.c (revision 2024) +++ src/orb/GIOP/giop-recv-buffer.c (working copy) @@ -739,7 +739,7 @@ link_io_thread_remove_timeout (ent->cnx->parent.timeout_source_id); ent->cnx->parent.timeout_source_id = 0; ent->cnx->parent.timeout_status = LINK_TIMEOUT_NO; - link_connection_unref (&ent->cnx->parent); // we remove the source so we must unref the connection + giop_connection_unref (&ent->cnx); // we remove the source so we must unref the connection } else if (ent->cnx->parent.timeout_status == LINK_TIMEOUT_YES) *timeout = TRUE; g_mutex_unlock (ent->cnx->parent.timeout_mutex); @@ -1363,11 +1363,17 @@ giop_timeout (gpointer data) { gboolean retv = FALSE; - LinkConnection *lcnx = (LinkConnection*)data; + GIOPConnection *cnx = (GIOPConnection*)data; + LinkConnection *lcnx = LINK_CONNECTION (cnx); GIOPThread *tdata = (GIOPThread *)lcnx->tdata; g_assert (lcnx->timeout_mutex); + if (lcnx->status == LINK_DISCONNECTED) { + giop_connection_unref (cnx); // we remove the source so we must unref cnx + goto out; + } + g_mutex_lock (lcnx->timeout_mutex); if (lcnx->timeout_status == LINK_TIMEOUT_UNKNOWN) { lcnx->timeout_source_id = 0; @@ -1385,7 +1391,7 @@ giop_incoming_signal_T (tdata, GIOP_CLOSECONNECTION); g_mutex_unlock (tdata->lock); /* ent_lock */ - link_connection_unref (lcnx); // we remove the source so we must unref lcnx + giop_connection_unref (cnx); // we remove the source so we must unref cnx out: return retv; @@ -1406,7 +1412,7 @@ if (lcnx->timeout_source_id) goto out; - link_connection_ref (lcnx); // to be unref'ed by the one who removes the timeout source + giop_connection_ref (cnx); // to be unref'ed by the one who removes the timeout source if (!lcnx->timeout_mutex) lcnx->timeout_mutex = g_mutex_new (); @@ -1417,7 +1423,7 @@ lcnx->tdata = giop_thread_self (); - lcnx->timeout_source_id = link_io_thread_add_timeout (lcnx->timeout_msec, giop_timeout, (gpointer)lcnx); + lcnx->timeout_source_id = link_io_thread_add_timeout (lcnx->timeout_msec, giop_timeout, (gpointer)cnx); out: g_static_mutex_unlock (&static_mutex); Index: src/orb/GIOP/giop-connection.c =================================================================== --- src/orb/GIOP/giop-connection.c (revision 2024) +++ src/orb/GIOP/giop-connection.c (working copy) @@ -38,7 +38,8 @@ void giop_connection_close (GIOPConnection *cnx) { - if (cnx->parent.status == LINK_DISCONNECTED) + if ((cnx->parent.status == LINK_DISCONNECTED) + || (cnx->parent.status == LINK_TIMEOUT)) return; if (cnx->parent.status == LINK_CONNECTED && Index: linc2/ChangeLog =================================================================== --- linc2/ChangeLog (revision 2024) +++ linc2/ChangeLog (working copy) @@ -1,3 +1,9 @@ +2007-09-22 Jules Colding + + * src/linc-connection.c (link_connection_finalize): + Remove g_assert() on the non-presence of cnx in cnx_list. The + cnx might not yet have gone. + ======================== ORBit2-2.14.9 ==================== 2007-08-14 Jules Colding Index: linc2/src/linc-connection.c =================================================================== --- linc2/src/linc-connection.c (revision 2024) +++ linc2/src/linc-connection.c (working copy) @@ -1272,10 +1272,6 @@ if (cnx->timeout_source_id) link_io_thread_remove_timeout (cnx->timeout_source_id); -#ifdef G_ENABLE_DEBUG - g_assert (g_list_find(cnx_list, cnx) == NULL); -#endif - parent_class->finalize (obj); } Index: configure.in =================================================================== --- configure.in (revision 2024) +++ configure.in (working copy) @@ -104,7 +104,7 @@ dnl --enable-debug=(yes|minimum|no) AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging [default=no]],,enable_debug=minimum) if test "x$enable_debug" = "xyes"; then - ORBIT_DEBUG_CFLAGS="-ggdb -DG_ENABLE_DEBUG" + ORBIT_DEBUG_CFLAGS="-ggdb -O0 -DG_ENABLE_DEBUG" else if test "x$enable_debug" = "xno"; then ORBIT_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS" Index: ChangeLog =================================================================== --- ChangeLog (revision 2024) +++ ChangeLog (working copy) @@ -1,3 +1,28 @@ +2007-09-24 Jules Colding + + * src/orb/orb-core/orbit-small.c (async_recv_cb): + Set CORBA_TIMEOUT exception if state is LINK_TIMEOUT + +2007-09-22 Jules Colding + + * configure.in: Added -O0 to ORBIT_DEBUG_CFLAGS. + TODO: Still need to fix the debug CFLAGS so that they are + effective in the Makefile.am's. + + * src/orb/GIOP/giop-connection.c (giop_connection_close): + Added a check for the link being in LINK_TIMEOUT state. Not + doing this would result in link_connection_finalize() being + invoked twice for the same link. We can not have that... + + * src/orb/GIOP/giop-recv-buffer.c (giop_recv_buffer_get): + Use giop_connection_unref() instead of linc_connection_unref() + as we really are manipulating a GIOPConnection not a LinkConnection. + (giop_timeout): Use the giop_connection_(un)ref() functions. Same + reasoning as above. + Do not call link_connection_state_changed() or giop_incoming_signal_T() + if the link is in the LINK_DISCONNECTED state. Doing so would make + link_connection_state_changed() very unhappy (invalid read of size 1). + ==================== ORBit2-2.14.9 ===================== 2007-09-17 Kjartan Maraas