Commit: b669604f43bbbf04ebaa66dd14ad9cfb005e561b
Parent: 75b0bf3ddb293747d5a1b3dce445536a862c0c07
Author: Hsin-Yu Chao <hychao@chromium.org>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2015-04-27 16:37:46
Tree: 647be489565c3008402ede7f0844755784117e3a

src/profile: Set service to connecting in ext_connect For the profile connection initiated by remote device, ext_connect() function is triggered without advance the state of device's service to BTD_SERVICE_STATE_CONNECTING. This is causing a problems when the later 'NewConnection' dbus method call is made to registered application. If the remote device gets disconnected during the period of time waiting for the reply of 'NewConnection' method, the btd_service_disconnect() call will fail at the service state check and never handle the profile disconnection due to that state was incorrectly left as BTD_SERVICE_STATE_DISCONNECTED. Fix the problem by use service_accept() call in ext_connect() to assure the service state has changed. Also modify the logic of service state check in btd_service_connecting_complete() to prevent the problem when the 'NewConnect' reply changes service state to BTD_SERVICE_STATE_CONNECTED while the device has already disconnected before it arrives.

Diffstat

M src/profile.c | 6 ++++- -
M src/service.c | 11 +++++++- - - -

2 files changed, 11 insertions(+), 6 deletions(-)

View Full Diff | Patch