From: Luiz Augusto von Dentz Date: Tue, 6 Feb 2018 10:01:19 +0000 (-0200) Subject: client: Fix not cleaning up notify pipe X-Git-Tag: accepted/tizen/unified/20190522.085452~1^2~187 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F204895%2F1;p=platform%2Fupstream%2Fbluez.git 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. Change-Id: I9cd77b61e7bfdd38ecd160edd0b9316d8285c7b0 Signed-off-by: Amit Purwar --- diff --git a/client/gatt.c b/client/gatt.c index b83bea7..b640b6e 100755 --- a/client/gatt.c +++ b/client/gatt.c @@ -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; }