diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-07-07 13:31:44 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-07-07 15:13:44 +0300 |
commit | 39b9e120eb6e85f18e67679b4c3fe2823ba4c92d (patch) | |
tree | 246a79d3bbbb156fe3cc23a126a5340d4f469b74 | |
parent | c73c1002331b2c0de0eaf555b5f1d05149f9a3b0 (diff) | |
download | bluez-39b9e120eb6e85f18e67679b4c3fe2823ba4c92d.tar.gz |
core/profiles: Fix not handling disconnections properly
If a profiles disconnects while in connecting state but ext_connect has
already been called the state is never updated since ext_io_disconnected
always calls btd_service_disconnecting_complete.
-rw-r--r-- | src/profile.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/profile.c b/src/profile.c index 4e68afc2a..4b7302630 100644 --- a/src/profile.c +++ b/src/profile.c @@ -797,8 +797,13 @@ static gboolean ext_io_disconnected(GIOChannel *io, GIOCondition cond, DBG("%s disconnected from %s", ext->name, addr); drop: - if (conn->service) - btd_service_disconnecting_complete(conn->service, 0); + if (conn->service) { + if (btd_service_get_state(conn->service) == + BTD_SERVICE_STATE_CONNECTING) + btd_service_connecting_complete(conn->service, -EIO); + else + btd_service_disconnecting_complete(conn->service, 0); + } ext->conns = g_slist_remove(ext->conns, conn); ext_io_destroy(conn); |