From f269e27ce7e39e6484cf02a137dcda7458a7fd85 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Fri, 6 Jun 2008 10:20:21 +0000 Subject: Fix the last remains of sending helpers --- audio/device.c | 4 +++- audio/headset.c | 9 ++++++--- audio/manager.c | 7 +++++-- audio/sink.c | 9 ++++++--- network/server.c | 4 +++- serial/manager.c | 6 ++++-- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/audio/device.c b/audio/device.c index c9608b96..2f5f834f 100644 --- a/audio/device.c +++ b/audio/device.c @@ -311,7 +311,9 @@ void device_finish_sdp_transaction(struct audio_device *dev) dbus_message_append_args(msg, DBUS_TYPE_STRING, &addr_ptr, DBUS_TYPE_INVALID); - send_message_and_unref(dev->conn, msg); + dbus_connection_send(dev->conn, msg, NULL); + + dbus_message_unref(msg); } #if 0 diff --git a/audio/headset.c b/audio/headset.c index 1cdaf746..bb28affb 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -321,7 +321,8 @@ static void sco_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src, if (p->msg) { DBusMessage *reply = dbus_message_new_method_return(p->msg); - send_message_and_unref(dev->conn, reply); + dbus_connection_send(dev->conn, reply, NULL); + dbus_message_unref(reply); } pending_connect_finalize(dev); @@ -374,7 +375,8 @@ static void hfp_slc_complete(struct audio_device *dev) if (p->msg) { DBusMessage *reply = dbus_message_new_method_return(p->msg); - send_message_and_unref(dev->conn, reply); + dbus_connection_send(dev->conn, reply, NULL); + dbus_message_unref(reply); } if (p->target_state == HEADSET_STATE_CONNECTED) { @@ -717,7 +719,8 @@ static void rfcomm_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src, if (p->msg) { DBusMessage *reply = dbus_message_new_method_return(p->msg); - send_message_and_unref(dev->conn, reply); + dbus_connection_send(dev->conn, reply, NULL); + dbus_message_unref(reply); } pending_connect_finalize(dev); diff --git a/audio/manager.c b/audio/manager.c index 0a8b6478..75c44440 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -370,7 +370,8 @@ update: dbus_message_append_args(reply, DBUS_TYPE_STRING, &data->device->path, DBUS_TYPE_INVALID); - send_message_and_unref(connection, reply); + dbus_connection_send(connection, reply, NULL); + dbus_message_unref(reply); } done: @@ -1569,7 +1570,9 @@ void manager_cancel_authorize(bdaddr_t *dba, const char *uuid, DBUS_TYPE_STRING, &uuid, DBUS_TYPE_INVALID); - send_message_and_unref(connection, cancel); + dbus_connection_send(connection, cancel, NULL); + + dbus_message_unref(cancel); } gboolean manager_authorize(const bdaddr_t *dba, const char *uuid, diff --git a/audio/sink.c b/audio/sink.c index 9027cd74..3b5447db 100644 --- a/audio/sink.c +++ b/audio/sink.c @@ -96,7 +96,8 @@ static void stream_state_changed(struct avdtp_stream *stream, sink->disconnect = NULL; reply = dbus_message_new_method_return(p->msg); - send_message_and_unref(p->conn, reply); + dbus_connection_send(p->conn, reply, NULL); + dbus_message_unref(reply); pending_request_free(p); } @@ -144,7 +145,8 @@ static gboolean stream_setup_retry(gpointer user_data) DBusMessage *reply; debug("Stream successfully created, after XCASE connect:connect"); reply = dbus_message_new_method_return(pending->msg); - send_message_and_unref(pending->conn, reply); + dbus_connection_send(pending->conn, reply, NULL); + dbus_message_unref(reply); } else { debug("Stream setup failed, after XCASE connect:connect"); error_failed(pending->conn, pending->msg, "Stream setup failed"); @@ -169,7 +171,8 @@ static void stream_setup_complete(struct avdtp *session, struct a2dp_sep *sep, DBusMessage *reply; sink->connect = NULL; reply = dbus_message_new_method_return(pending->msg); - send_message_and_unref(pending->conn, reply); + dbus_connection_send(pending->conn, reply, NULL); + dbus_message_unref(reply); pending_request_free(pending); debug("Stream successfully created"); } else { diff --git a/network/server.c b/network/server.c index b306242b..c7b2b778 100644 --- a/network/server.c +++ b/network/server.c @@ -327,7 +327,9 @@ static void cancel_authorization_old() DBUS_TYPE_STRING, &uuid, DBUS_TYPE_INVALID); - send_message_and_unref(connection, msg); + dbus_connection_send(connection, msg, NULL); + + dbus_message_unref(msg); } static int server_connadd(struct network_server *ns, int nsk, diff --git a/serial/manager.c b/serial/manager.c index a9bc0968..64f2203a 100644 --- a/serial/manager.c +++ b/serial/manager.c @@ -234,7 +234,8 @@ static void open_notify(int fd, int err, struct pending_connect *pc) dbus_message_append_args(reply, DBUS_TYPE_STRING, &pc->dev, DBUS_TYPE_INVALID); - send_message_and_unref(pc->conn, reply); + dbus_connection_send(pc->conn, reply, NULL); + dbus_message_unref(reply); /* Send the D-Bus signal */ dbus_connection_emit_signal(pc->conn, SERIAL_MANAGER_PATH, @@ -453,7 +454,8 @@ static DBusMessage *create_channel_port(DBusConnection *conn, dbus_message_append_args(reply, DBUS_TYPE_STRING, &ppath, DBUS_TYPE_INVALID); - send_message_and_unref(conn, reply); + dbus_connection_send(conn, reply, NULL); + dbus_message_unref(reply); dbus_connection_emit_signal(conn, SERIAL_MANAGER_PATH, SERIAL_MANAGER_INTERFACE, "PortCreated" , -- cgit