summaryrefslogtreecommitdiffstats
path: root/hcid/agent.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-03-14 20:10:07 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2008-03-14 20:10:07 +0000
commitc69acf2c268b7204da42166001194b0fe6926d91 (patch)
treed7b6295325a488e72dcabc03d32c48aa1801da29 /hcid/agent.c
parentf2e721cb33943a434fc4a1565badc774b3397e93 (diff)
Add some checks to disallow multiple simultaneous agent requests
Diffstat (limited to 'hcid/agent.c')
-rw-r--r--hcid/agent.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hcid/agent.c b/hcid/agent.c
index e0111b0b..a5f2dd40 100644
--- a/hcid/agent.c
+++ b/hcid/agent.c
@@ -304,7 +304,8 @@ int agent_authorize(struct agent *agent,
{
struct agent_request *req;
- debug("agent_authorize");
+ if (agent->request)
+ return -EBUSY;
req = agent_request_new(agent, device, cb, user_data);
@@ -426,6 +427,9 @@ int agent_request_passkey(struct agent *agent, const char *device,
{
struct agent_request *req;
+ if (agent->request)
+ return -EBUSY;
+
req = agent_request_new(agent, device, cb, user_data);
req->call = passkey_request_new(device, agent, FALSE);
@@ -528,6 +532,9 @@ int agent_confirm(struct agent *agent, const char *device, const char *pin,
{
struct agent_request *req;
+ if (agent->request)
+ return -EBUSY;
+
debug("Calling Agent.Confirm: name=%s, path=%s",
agent->name, agent->path);