diff options
| author | Johan Hedberg <johan.hedberg@nokia.com> | 2006-08-19 01:24:47 +0000 | 
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@nokia.com> | 2006-08-19 01:24:47 +0000 | 
| commit | f841e8de8c71a0f726f77a65b4145b76e924df14 (patch) | |
| tree | 1c01979716966d1e0cf0066df8fa4caae7086bd0 /hcid/dbus.c | |
| parent | 9f1c935d4e9a36ad0af6afb0b0e9893397698efa (diff) | |
Improve situation where bonding requestor exits
Diffstat (limited to 'hcid/dbus.c')
| -rw-r--r-- | hcid/dbus.c | 29 | 
1 files changed, 28 insertions, 1 deletions
diff --git a/hcid/dbus.c b/hcid/dbus.c index 7f72d7cc..ec79a932 100644 --- a/hcid/dbus.c +++ b/hcid/dbus.c @@ -1980,7 +1980,34 @@ void create_bond_req_exit(const char *name, struct hci_dbus_data *pdata)  	snprintf(path, sizeof(path), "%s/hci%d", BASE_PATH, pdata->dev_id); -	debug("PasskeyAgent at %s exited before bonding was completed", name); +	debug("CreateConnection requestor at %s exited before bonding was completed", name);  	cancel_passkey_agent_requests(pdata->passkey_agents, path, &pdata->bonding->bdaddr); + +	if (pdata->bonding->disconnect) { +		struct slist *l; + +		l = slist_find(pdata->active_conn, &pdata->bonding->bdaddr, active_conn_find_by_bdaddr); +		if (l) { +			struct active_conn_info *con = l->data; +			struct hci_req_data *data; +			disconnect_cp cp; +			memset(&cp, 0, sizeof(cp)); + +			cp.handle = con->handle; +			cp.reason = HCI_OE_USER_ENDED_CONNECTION; + +			data = hci_req_data_new(pdata->dev_id, &pdata->bonding->bdaddr, OGF_LINK_CTL, +						OCF_DISCONNECT, EVT_DISCONN_COMPLETE, +						&cp, DISCONNECT_CP_SIZE); + +			hci_req_queue_append(data); +		} +	} + +	bonding_request_free(pdata->bonding); +	pdata->bonding = NULL; + +	free(pdata->requestor_name); +	pdata->requestor_name = NULL;  }  | 
