diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2014-12-28 13:05:40 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-12-28 18:01:57 +0100 |
commit | 575cd0a3ec2f691c1d541c000469245fb1c96c87 (patch) | |
tree | 5c4737edaa978d257351114093483c9c0e68c9ca | |
parent | 3f24b9a96d41e6588e8f14482855b445691a0958 (diff) | |
download | libmbim-575cd0a3ec2f691c1d541c000469245fb1c96c87.tar.gz |
libmbim-glib,device: match function errors within transactions
Or we won't get e.g. NotOpened errors forwarded through the MbimProxy.
-rw-r--r-- | src/libmbim-glib/mbim-device.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libmbim-glib/mbim-device.c b/src/libmbim-glib/mbim-device.c index 826fa3e..09a8b5c 100644 --- a/src/libmbim-glib/mbim-device.c +++ b/src/libmbim-glib/mbim-device.c @@ -567,8 +567,19 @@ process_message (MbimDevice *self, } case MBIM_MESSAGE_TYPE_FUNCTION_ERROR: { + Transaction *tr; GError *error_indication; + /* Try to match this transaction just per transaction ID */ + tr = device_release_transaction (self, + TRANSACTION_TYPE_HOST, + MBIM_MESSAGE_TYPE_INVALID, + mbim_message_get_transaction_id (message)); + + if (!tr) + g_debug ("[%s] No transaction matched in received function error message", + self->priv->path_display); + if (mbim_utils_get_traces_enabled ()) { gchar *printable; @@ -579,6 +590,15 @@ process_message (MbimDevice *self, g_free (printable); } + if (tr) { + if (tr->fragments) + mbim_message_unref (tr->fragments); + tr->fragments = mbim_message_dup (message); + transaction_complete_and_free (tr, NULL); + return; + } + + /* No transaction matched, use error signal */ error_indication = mbim_message_error_get_error (message); g_signal_emit (self, signals[SIGNAL_ERROR], 0, error_indication); g_error_free (error_indication); |