* [PATCH] ussd: Cancel pending requests when unregistering
@ 2018-05-23 13:48 Slava Monich
2018-05-23 15:23 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Slava Monich @ 2018-05-23 13:48 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1088 bytes --]
And reset state to idle before unregistering the D-Bus interface.
This may occur e.g. when we receive REFRESH from STK.
---
src/ussd.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/ussd.c b/src/ussd.c
index f5dd9d9..23b3323 100644
--- a/src/ussd.c
+++ b/src/ussd.c
@@ -810,6 +810,22 @@ static void ussd_unregister(struct ofono_atom *atom)
DBusConnection *conn = ofono_dbus_get_connection();
struct ofono_modem *modem = __ofono_atom_get_modem(atom);
const char *path = __ofono_atom_get_path(atom);
+ DBusMessage *reply;
+
+ if (ussd->pending) {
+ reply = __ofono_error_canceled(ussd->pending);
+ __ofono_dbus_pending_reply(&ussd->pending, reply);
+ }
+
+ if (ussd->cancel) {
+ reply = dbus_message_new_method_return(ussd->cancel);
+ __ofono_dbus_pending_reply(&ussd->cancel, reply);
+ }
+
+ if (ussd->req)
+ ussd_request_finish(ussd, -ECANCELED, 0, NULL, 0);
+
+ ussd_change_state(ussd, USSD_STATE_IDLE);
g_slist_free_full(ussd->ss_control_list, ssc_entry_destroy);
ussd->ss_control_list = NULL;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ussd: Cancel pending requests when unregistering
2018-05-23 13:48 [PATCH] ussd: Cancel pending requests when unregistering Slava Monich
@ 2018-05-23 15:23 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2018-05-23 15:23 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 313 bytes --]
Hi Slava,
On 05/23/2018 08:48 AM, Slava Monich wrote:
> And reset state to idle before unregistering the D-Bus interface.
> This may occur e.g. when we receive REFRESH from STK.
> ---
> src/ussd.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-05-23 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 13:48 [PATCH] ussd: Cancel pending requests when unregistering Slava Monich
2018-05-23 15:23 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.