OSDN Git Service

core: Make use of g_dbus_send_message_with_reply
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 19 Aug 2013 12:41:49 +0000 (15:41 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 9 Sep 2013 14:35:30 +0000 (17:35 +0300)
This replaces dbus_connection_send_with_reply with
g_dbus_send_message_with_reply which does not alter message order.

src/agent.c
src/profile.c

index b9e6e8c..7880ba6 100644 (file)
@@ -370,7 +370,7 @@ static int agent_call_authorize_service(struct agent_request *req,
                                DBUS_TYPE_STRING, &uuid,
                                DBUS_TYPE_INVALID);
 
-       if (dbus_connection_send_with_reply(btd_get_dbus_connection(),
+       if (g_dbus_send_message_with_reply(btd_get_dbus_connection(),
                                                req->msg, &req->call,
                                                REQUEST_TIMEOUT) == FALSE) {
                error("D-Bus send failed");
@@ -480,7 +480,7 @@ static int pincode_request_new(struct agent_request *req, const char *device_pat
        dbus_message_append_args(req->msg, DBUS_TYPE_OBJECT_PATH, &device_path,
                                        DBUS_TYPE_INVALID);
 
-       if (dbus_connection_send_with_reply(btd_get_dbus_connection(), req->msg,
+       if (g_dbus_send_message_with_reply(btd_get_dbus_connection(), req->msg,
                                        &req->call, REQUEST_TIMEOUT) == FALSE) {
                error("D-Bus send failed");
                return -EIO;
@@ -574,7 +574,7 @@ static int passkey_request_new(struct agent_request *req,
        dbus_message_append_args(req->msg, DBUS_TYPE_OBJECT_PATH, &device_path,
                                        DBUS_TYPE_INVALID);
 
-       if (dbus_connection_send_with_reply(btd_get_dbus_connection(), req->msg,
+       if (g_dbus_send_message_with_reply(btd_get_dbus_connection(), req->msg,
                                        &req->call, REQUEST_TIMEOUT) == FALSE) {
                error("D-Bus send failed");
                return -EIO;
@@ -632,7 +632,7 @@ static int confirmation_request_new(struct agent_request *req,
                                DBUS_TYPE_UINT32, &passkey,
                                DBUS_TYPE_INVALID);
 
-       if (dbus_connection_send_with_reply(btd_get_dbus_connection(), req->msg,
+       if (g_dbus_send_message_with_reply(btd_get_dbus_connection(), req->msg,
                                &req->call, REQUEST_TIMEOUT) == FALSE) {
                error("D-Bus send failed");
                return -EIO;
@@ -689,7 +689,7 @@ static int authorization_request_new(struct agent_request *req,
                                DBUS_TYPE_OBJECT_PATH, &device_path,
                                DBUS_TYPE_INVALID);
 
-       if (dbus_connection_send_with_reply(btd_get_dbus_connection(), req->msg,
+       if (g_dbus_send_message_with_reply(btd_get_dbus_connection(), req->msg,
                                &req->call, REQUEST_TIMEOUT) == FALSE) {
                error("D-Bus send failed");
                return -EIO;
@@ -823,7 +823,7 @@ static int display_pincode_request_new(struct agent_request *req,
                                        DBUS_TYPE_STRING, &pincode,
                                        DBUS_TYPE_INVALID);
 
-       if (dbus_connection_send_with_reply(btd_get_dbus_connection(), req->msg,
+       if (g_dbus_send_message_with_reply(btd_get_dbus_connection(), req->msg,
                                &req->call, REQUEST_TIMEOUT) == FALSE) {
                error("D-Bus send failed");
                return -EIO;
index 90c3535..57aead7 100644 (file)
@@ -938,7 +938,7 @@ static bool send_new_connection(struct ext_profile *ext, struct ext_io *conn)
 
        dbus_message_iter_close_container(&iter, &dict);
 
-       if (!dbus_connection_send_with_reply(btd_get_dbus_connection(),
+       if (!g_dbus_send_message_with_reply(btd_get_dbus_connection(),
                                                msg, &conn->pending, -1)) {
                error("%s: sending NewConnection failed", ext->name);
                dbus_message_unref(msg);
@@ -1682,7 +1682,7 @@ static int send_disconn_req(struct ext_profile *ext, struct ext_io *conn)
        dbus_message_append_args(msg, DBUS_TYPE_OBJECT_PATH, &path,
                                                        DBUS_TYPE_INVALID);
 
-       if (!dbus_connection_send_with_reply(btd_get_dbus_connection(),
+       if (!g_dbus_send_message_with_reply(btd_get_dbus_connection(),
                                                msg, &conn->pending, -1)) {
                error("%s: sending RequestDisconnection failed", ext->name);
                dbus_message_unref(msg);