From 06082049381e6b5f95aca2047942db67b1c7fa29 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 24 Oct 2008 15:20:36 +0300 Subject: Fix manager_allow_headset_connection count check --- audio/manager.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'audio/manager.c') diff --git a/audio/manager.c b/audio/manager.c index 816e6821..8661dcca 100644 --- a/audio/manager.c +++ b/audio/manager.c @@ -453,8 +453,10 @@ static void ag_io_cb(GIOChannel *chan, int err, const bdaddr_t *src, if (!device) goto drop; - if (!manager_allow_headset_connection(&device->src)) + if (!manager_allow_headset_connection(&device->src)) { + debug("Refusing headset: too many existing connections"); goto drop; + } if (!device->headset) btd_device_add_uuid(device->btd_dev, remote_uuid); @@ -1091,7 +1093,7 @@ gboolean manager_allow_headset_connection(bdaddr_t *src) if (headset_get_state(dev) > HEADSET_STATE_DISCONNECTED) connected++; - if (connected > max_connected_headsets) + if (connected >= max_connected_headsets) return FALSE; } -- cgit