summaryrefslogtreecommitdiffstats
path: root/audio/manager.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-17 19:37:36 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2008-06-17 19:37:36 +0000
commite8ca2351ee3ba3f8b2b99731972234f42ae9b64b (patch)
tree8a639f9f831dd79ec2b3b8d5d952d649885a59ba /audio/manager.c
parentbbec31284f7e4e960c07bddd9fd1d7ee5c990118 (diff)
Fix authorization mechanism for 3.x.
Diffstat (limited to 'audio/manager.c')
-rw-r--r--audio/manager.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/audio/manager.c b/audio/manager.c
index 242f16bb..18ef9eb4 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -1164,9 +1164,7 @@ static void auth_cb(DBusError *derr, void *user_data)
error("Access denied: %s", derr->message);
if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY)) {
debug("Canceling authorization request");
- if (service_cancel_auth(&device->dst) < 0)
- manager_cancel_authorize(&device->dst, uuid,
- NULL);
+ service_cancel_auth(&device->src, &device->dst);
}
headset_set_state(device, HEADSET_STATE_DISCONNECTED);
@@ -1219,9 +1217,13 @@ static void ag_io_cb(GIOChannel *chan, int err, const bdaddr_t *src,
goto drop;
}
- if (!service_req_auth(&device->src, &device->dst, uuid, auth_cb,
- device) == 0)
+ err = service_req_auth(&device->src, &device->dst, uuid, auth_cb,
+ device);
+ if (err < 0) {
+ debug("Authorization denied: %s", strerror(-err));
headset_close_rfcomm(device);
+ return;
+ }
headset_set_state(device, HEADSET_STATE_CONNECT_IN_PROGRESS);