summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-06-06 09:57:27 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-06-06 09:57:27 +0000
commite64373ef34f318aa60030cde093aa7cd7694c714 (patch)
treef522bd4c0c93f086f35322878cbe560313842176
parentee865eb34c8fd1d1f1e5193230c0bd7129079309 (diff)
More direct usage of D-Bus sending function
-rw-r--r--hcid/adapter.c13
-rw-r--r--hcid/agent.c8
-rw-r--r--hcid/dbus-sdp.c13
3 files changed, 23 insertions, 11 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c
index 4374cef4..2351b395 100644
--- a/hcid/adapter.c
+++ b/hcid/adapter.c
@@ -2198,10 +2198,11 @@ gboolean dc_pending_timeout_handler(void *data)
error_failed_errno(pending_dc->conn, pending_dc->msg, err);
} else {
reply = dbus_message_new_method_return(pending_dc->msg);
- if (!reply)
+ if (reply) {
+ dbus_connection_send(pending_dc->conn, reply, NULL);
+ dbus_message_unref(reply);
+ } else
error("Failed to allocate disconnect reply");
- else
- send_message_and_unref(pending_dc->conn, reply);
}
hci_close_dev(dd);
@@ -2285,8 +2286,10 @@ static void reply_authentication_failure(struct bonding_request_info *bonding)
bonding->hci_status : HCI_AUTHENTICATION_FAILURE;
reply = new_authentication_return(bonding->msg, status);
- if (reply)
- send_message_and_unref(bonding->conn, reply);
+ if (reply) {
+ dbus_connection_send(bonding->conn, reply, NULL);
+ dbus_message_unref(reply);
+ }
}
struct device *adapter_find_device(struct adapter *adapter, const char *dest)
diff --git a/hcid/agent.c b/hcid/agent.c
index 802323a9..f793a003 100644
--- a/hcid/agent.c
+++ b/hcid/agent.c
@@ -102,7 +102,9 @@ static void agent_release(struct agent *agent)
dbus_message_set_no_reply(message, TRUE);
- send_message_and_unref(connection, message);
+ dbus_connection_send(connection, message, NULL);
+
+ dbus_message_unref(message);
}
static int send_cancel_request(struct agent_request *req)
@@ -118,7 +120,9 @@ static int send_cancel_request(struct agent_request *req)
dbus_message_set_no_reply(message, TRUE);
- send_message_and_unref(connection, message);
+ dbus_connection_send(connection, message, NULL);
+
+ dbus_message_unref(message);
return 0;
}
diff --git a/hcid/dbus-sdp.c b/hcid/dbus-sdp.c
index 2af53b27..2b1e12c2 100644
--- a/hcid/dbus-sdp.c
+++ b/hcid/dbus-sdp.c
@@ -530,7 +530,8 @@ static void remote_svc_rec_completed_cb(uint8_t type, uint16_t err,
done:
dbus_message_iter_close_container(&iter, &array_iter);
- send_message_and_unref(ctxt->conn, reply);
+ dbus_connection_send(ctxt->conn, reply, NULL);
+ dbus_message_unref(reply);
failed:
transaction_context_free(ctxt, TRUE);
@@ -606,7 +607,8 @@ static void remote_svc_rec_completed_xml_cb(uint8_t type, uint16_t err,
free(result.data);
}
done:
- send_message_and_unref(ctxt->conn, reply);
+ dbus_connection_send(ctxt->conn, reply, NULL);
+ dbus_message_unref(reply);
failed:
transaction_context_free(ctxt, TRUE);
@@ -680,7 +682,8 @@ static void remote_svc_handles_completed_cb(uint8_t type, uint16_t err,
done:
dbus_message_iter_close_container(&iter, &array_iter);
- send_message_and_unref(ctxt->conn, reply);
+ dbus_connection_send(ctxt->conn, reply, NULL);
+ dbus_message_unref(reply);
failed:
transaction_context_free(ctxt, TRUE);
@@ -844,7 +847,9 @@ static void remote_svc_identifiers_completed_cb(uint8_t type, uint16_t err,
DBUS_TYPE_ARRAY, DBUS_TYPE_STRING,
&identifiers, len,
DBUS_TYPE_INVALID);
- send_message_and_unref(ctxt->conn, reply);
+
+ dbus_connection_send(ctxt->conn, reply, NULL);
+ dbus_message_unref(reply);
if (len)
dbus_connection_emit_signal(ctxt->conn,