* Move dgram session to the right thread
*/
int
-session_dgram_connect_notify (transport_connection_t * tc,
- u32 old_thread_index, session_t ** new_session)
+session_dgram_connect_notify (transport_connection_t *tc,
+ session_handle_tu_t osh, session_t **new_session)
{
session_t *new_s;
session_switch_pool_args_t *rpc_args;
/*
* Clone half-open session to the right thread.
*/
- new_s = session_clone_safe (tc->s_index, old_thread_index);
+ new_s = session_clone_safe (tc->s_index, osh.thread_index);
new_s->connection_index = tc->c_index;
session_set_state (new_s, SESSION_STATE_READY);
new_s->flags |= SESSION_F_IS_MIGRATING;
rpc_args->new_session_index = new_s->session_index;
rpc_args->new_thread_index = new_s->thread_index;
rpc_args->session_index = tc->s_index;
- rpc_args->thread_index = old_thread_index;
+ rpc_args->thread_index = osh.thread_index;
session_send_rpc_evt_to_thread (rpc_args->thread_index, session_switch_pool,
rpc_args);
int session_stream_connect_notify (transport_connection_t * tc,
session_error_t err);
-int session_dgram_connect_notify (transport_connection_t * tc,
- u32 old_thread_index,
- session_t ** new_session);
+int session_dgram_connect_notify (transport_connection_t *tc,
+ session_handle_tu_t osh,
+ session_t **new_session);
int session_stream_accept_notify (transport_connection_t * tc);
void session_transport_closing_notify (transport_connection_t * tc);
void session_transport_delete_notify (transport_connection_t * tc);
error0 = UDP_ERROR_CONNECTED;
if (s0->thread_index != thread_index)
{
+ /* uc0 clone may allow owner of s0 to grow its pool */
+ session_handle_t osh = session_handle (s0);
/*
* Clone the transport. It will be cleaned up with the
* session once we notify the session layer.
*/
uc0 = udp_connection_clone_safe (s0->connection_index,
s0->thread_index);
- ASSERT (s0->session_index == uc0->c_s_index);
-
+ ASSERT (session_index_from_handle (osh) == uc0->c_s_index);
/*
* Ask session layer for a new session.
*/
- session_dgram_connect_notify (&uc0->connection,
- s0->thread_index, &s0);
+ session_dgram_connect_notify (&uc0->connection, osh, &s0);
queue_event = 0;
}
else