From e8353af3275ff6a04b62a1fb958625352b673128 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 10 Jul 2013 13:55:04 +0300 Subject: [PATCH] core: Fix incorrectly restarting service discovery after pairing If services are already discovered through a Device1.Connect() call we should not retry discovering them when Device1.Pair() is called. --- src/device.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/device.c b/src/device.c index 88a7b86b5..0ec23a13f 100644 --- a/src/device.c +++ b/src/device.c @@ -3793,6 +3793,20 @@ void device_bonding_complete(struct btd_device *device, uint8_t status) device_set_paired(device, TRUE); + /* If services are already resolved just reply to the pairing + * request + */ + if (device->svc_resolved && bonding) { + DBusMessage *reply; + + reply = dbus_message_new_method_return(bonding->msg); + g_dbus_send_message(dbus_conn, reply); + + bonding_request_free(bonding); + + return; + } + /* If we were initiators start service discovery immediately. * However if the other end was the initator wait a few seconds * before SDP. This is due to potential IOP issues if the other -- 2.47.3