device: reply to connect/disconnect requests on removal
PATCH 2/2 device: reply to connect/disconnect requests on removal
Replying here prevents the client from getting a DBus NoReply when the device is removed.
--- src/device.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
src/device.c +9 -2
@@ -650,6 +650,7 @@ static void svc_dev_remove(gpointer user_data)static void device_free (gpointer user_data) {struct btd_device *device = user_data; +DBusMessage *reply;btd_gatt_client_destroy (device->client_dbus); device->client_dbus =NULL ;
@@ -677,11 +678,17 @@ static void device_free(gpointer user_data)if (device->discov_timer)g_source_remove (device->discov_timer); -if (device->connect) +if (device->connect) { + reply =btd_error_failed (device->connect,"Device removed" ); +g_dbus_send_message (dbus_conn, reply);dbus_message_unref (device->connect); + } -if (device->disconnect) +if (device->disconnect) { + reply =btd_error_failed (device->disconnect,"Device removed" ); +g_dbus_send_message (dbus_conn, reply);dbus_message_unref (device->disconnect); + }DBG ("%p" , device);
Signature · 1 line
2.7.4