mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-15 08:14:28 +08:00
client: Fix not cleaning up notify pipe
If remote unsubscribe, disconnects or the daemon closes the socket the io shall be destroyed properly otherwise it will prevent new subscriptions.
This commit is contained in:
parent
0e260e458c
commit
17c8980ad3
@ -679,11 +679,17 @@ static bool pipe_hup(struct io *io, void *user_data)
|
||||
struct chrc *chrc = user_data;
|
||||
|
||||
if (chrc) {
|
||||
bt_shell_printf("Attribute %s Write pipe closed\n", chrc->path);
|
||||
if (chrc->write_io) {
|
||||
bt_shell_printf("Attribute %s %s pipe closed\n", chrc->path,
|
||||
io == chrc->write_io ? "Write" : "Notify");
|
||||
|
||||
if (io == chrc->write_io) {
|
||||
io_destroy(chrc->write_io);
|
||||
chrc->write_io = NULL;
|
||||
} else {
|
||||
io_destroy(chrc->notify_io);
|
||||
chrc->notify_io = NULL;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user