diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2014-07-28 19:31:01 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-07-31 18:42:51 +0200 |
commit | ebf3baf49503e7e9a14f40ffb18fe5db57f0caaf (patch) | |
tree | 8a829bdb448bad8c1ea0a91c3baefb451215ca72 | |
parent | 8673de9b04af1004b77e630cc7ae11d17c2bb2f0 (diff) | |
download | libmbim-ebf3baf49503e7e9a14f40ffb18fe5db57f0caaf.tar.gz |
libmbim-glib,proxy: prefer the API to update the message transaction id
-rw-r--r-- | src/libmbim-glib/mbim-message.c | 5 | ||||
-rw-r--r-- | src/libmbim-glib/mbim-proxy.c | 2 |
2 files changed, 1 insertions, 6 deletions
diff --git a/src/libmbim-glib/mbim-message.c b/src/libmbim-glib/mbim-message.c index 0891acc..48f6018 100644 --- a/src/libmbim-glib/mbim-message.c +++ b/src/libmbim-glib/mbim-message.c @@ -1007,12 +1007,7 @@ void mbim_message_set_transaction_id (MbimMessage *self, guint32 transaction_id) { - /* Only allow setting transaction ID in host-generated messages */ g_return_if_fail (self != NULL); - g_return_if_fail (MBIM_MESSAGE_GET_MESSAGE_TYPE (self) == MBIM_MESSAGE_TYPE_COMMAND || - MBIM_MESSAGE_GET_MESSAGE_TYPE (self) == MBIM_MESSAGE_TYPE_OPEN || - MBIM_MESSAGE_GET_MESSAGE_TYPE (self) == MBIM_MESSAGE_TYPE_CLOSE || - MBIM_MESSAGE_GET_MESSAGE_TYPE (self) == MBIM_MESSAGE_TYPE_HOST_ERROR); ((struct header *)(self->data))->transaction_id = GUINT32_TO_LE (transaction_id); } diff --git a/src/libmbim-glib/mbim-proxy.c b/src/libmbim-glib/mbim-proxy.c index 82e218d..e294898 100644 --- a/src/libmbim-glib/mbim-proxy.c +++ b/src/libmbim-glib/mbim-proxy.c @@ -802,7 +802,7 @@ device_command_ready (MbimDevice *device, } /* replace reponse transaction id with the requested transaction id */ - ((struct header *)(request->response->data))->transaction_id = GUINT32_TO_LE (mbim_message_get_transaction_id (request->message)); + mbim_message_set_transaction_id (request->response, mbim_message_get_transaction_id (request->message)); if (!client_send_message (request->client, request->response, &error)) { g_debug ("couldn't send response back to client: %s", error->message); |