summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2008-09-09 15:18:27 -0300
committerVinicius Costa Gomes <vinicius.gomes@openbossa.org>2008-09-09 19:47:14 -0300
commitc0296a9dde463495975140e7fb7f689a347807d6 (patch)
tree8db2fe54052fa2566d0ce365842e96943c104b35
parent8b783303433f7c25c2a888034a6da369a7e9a731 (diff)
Cancels the pending request from agent side when receiving a NoReply
-rw-r--r--audio/avdtp.c5
-rw-r--r--audio/control.c4
-rw-r--r--audio/manager.c4
-rw-r--r--input/server.c2
-rw-r--r--network/server.c7
-rw-r--r--src/agent.c8
6 files changed, 9 insertions, 21 deletions
diff --git a/audio/avdtp.c b/audio/avdtp.c
index b052b927..592322f8 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -2715,11 +2715,6 @@ static void auth_cb(DBusError *derr, void *user_data)
if (derr && dbus_error_is_set(derr)) {
error("Access denied: %s", derr->message);
- if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY)) {
- debug("Canceling authorization request");
- btd_cancel_authorization(&session->server->src,
- &session->dst);
- }
connection_lost(session, -EACCES);
return;
diff --git a/audio/control.c b/audio/control.c
index 15e38c99..4792b4ba 100644
--- a/audio/control.c
+++ b/audio/control.c
@@ -630,10 +630,6 @@ static void auth_cb(DBusError *derr, void *user_data)
if (derr && dbus_error_is_set(derr)) {
error("Access denied: %s", derr->message);
- if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY)) {
- debug("Canceling authorization request");
- btd_cancel_authorization(&session->src, &session->dst);
- }
avctp_unref(session);
return;
diff --git a/audio/manager.c b/audio/manager.c
index deeb375c..5af175c3 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -455,10 +455,6 @@ static void auth_cb(DBusError *derr, void *user_data)
if (derr && dbus_error_is_set(derr)) {
error("Access denied: %s", derr->message);
- if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY)) {
- debug("Canceling authorization request");
- btd_cancel_authorization(&device->src, &device->dst);
- }
headset_set_state(device, HEADSET_STATE_DISCONNECTED);
} else {
diff --git a/input/server.c b/input/server.c
index c0ed1f7a..164426e4 100644
--- a/input/server.c
+++ b/input/server.c
@@ -65,8 +65,6 @@ static void auth_callback(DBusError *derr, void *user_data)
if (derr) {
error("Access denied: %s", derr->message);
- if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY))
- btd_cancel_authorization(&auth->src, &auth->dst);
input_device_close_channels(&auth->src, &auth->dst);
} else
diff --git a/network/server.c b/network/server.c
index e283a994..3230fde6 100644
--- a/network/server.c
+++ b/network/server.c
@@ -338,7 +338,6 @@ static int server_connadd(struct network_server *ns, int nsk,
static void req_auth_cb(DBusError *derr, void *user_data)
{
struct network_server *ns = user_data;
- struct network_adapter *na = ns->na;
uint16_t val;
if (!setup) {
@@ -348,11 +347,7 @@ static void req_auth_cb(DBusError *derr, void *user_data)
if (derr) {
error("Access denied: %s", derr->message);
- if (dbus_error_has_name(derr, DBUS_ERROR_NO_REPLY)) {
- bdaddr_t dst;
- str2ba(setup->address, &dst);
- btd_cancel_authorization(&na->src, &dst);
- }
+
val = BNEP_CONN_NOT_ALLOWED;
goto done;
}
diff --git a/src/agent.c b/src/agent.c
index e8f9c651..6b7c8d03 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -285,6 +285,14 @@ static void simple_agent_reply(DBusPendingCall *call, void *user_data)
err.name, err.message);
cb(agent, &err, req->user_data);
+
+ if (dbus_error_has_name(&err, DBUS_ERROR_NO_REPLY)) {
+ agent_cancel(agent);
+ dbus_message_unref(message);
+ dbus_error_free(&err);
+ return;
+ }
+
dbus_error_free(&err);
goto done;
}