diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2016-09-08 10:52:42 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2016-09-08 11:30:50 +0300 |
commit | d93af80e37274656bca792a673eb0b66141e62a1 (patch) | |
tree | 2faecd18d2a5577c6bceec5e760d7f748591f68c /src/service.c | |
parent | 968fdffb92c2edeac4b124db92c87e5e2bbe2598 (diff) | |
download | bluez-d93af80e37274656bca792a673eb0b66141e62a1.tar.gz |
core/service: Fix setting wrong state after calling accept
The accept calback may transit the state to connected on the call itself
since most of the time it is just a matter of selecting the attributes
in case of GATT profiles.
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/service.c b/src/service.c index f387fc406..20a41d052 100644 --- a/src/service.c +++ b/src/service.c @@ -209,7 +209,8 @@ int service_accept(struct btd_service *service) return err; done: - change_state(service, BTD_SERVICE_STATE_CONNECTING, 0); + if (service->state == BTD_SERVICE_STATE_DISCONNECTED) + change_state(service, BTD_SERVICE_STATE_CONNECTING, 0); return 0; } |