sim-auth: Remove watch if open_channel fails
PATCH 1/2 sim-auth: Remove watch if open_channel fails
Otherwise open_channel won't be called again after a failure.
--- src/sim-auth.c | 2 ++ 1 file changed, 2 insertions(+)
src/sim-auth.c +2 -0
@@ -367,6 +367,8 @@ static void get_session_cb(ofono_bool_t active, int session_id, error:__ofono_dbus_pending_reply (&sa->pending->msg,__ofono_error_failed (sa->pending->msg)); +__ofono_sim_remove_session_watch (sa->pending->session, + sa->pending->watch_id);g_free (sa->pending); sa->pending =NULL ; }
Signature · 1 line
2.25.1
PATCH 2/2 sim-auth: Only close open sessions
Session has to be open in order to have a valid session_id
--- src/sim.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
src/sim.c +2 -1
@@ -3805,7 +3805,8 @@ void __ofono_sim_remove_session_watch(struct ofono_sim_aid_session *session, {__ofono_watchlist_remove_item (session->watches, id); -if (g_slist_length (session->watches->items) ==0 ) { +if (g_slist_length (session->watches->items) ==0 && + session->state ==SESSION_STATE_OPEN ) {/* last watcher, close session */ session->state =SESSION_STATE_CLOSING ; session->sim->driver->close_channel(session->sim,
Signature · 1 line
2.25.1
Hi Slava,
Quoted 5 lines · Slava Monich
Otherwise
open_channelwon't be called again after a failure.--- src/sim-auth.c | 2 ++ 1 file changed, 2 insertions(+)
Both applied, thanks.
Regards,
-Denis