goto failed;
ctx->app_session_handle = session_handle (app_session);
- ctx->c_s_index = app_session->session_index;
app_session->session_state = SESSION_STATE_CONNECTING;
if (cb_fn (ctx->parent_app_index, ctx->parent_app_api_context,
app_session, 0 /* not failed */ ))
return -1;
}
+ /* parent_app_api_context should not be overwitten before used,
+ * so defer setting c_s_index */
+ ctx->c_s_index = app_session->session_index;
app_session->session_state = SESSION_STATE_READY;
session_lookup_add_connection (&ctx->connection,
session_handle (app_session));