linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ 4/5] shared/gatt-client: Don't remove active services
Date: Fri, 17 Jul 2020 12:15:14 -0700	[thread overview]
Message-ID: <20200717191515.220621-4-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20200717191515.220621-1-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If discovery was aborted (i.e due to a disconnect) check if pending
services were active so only staled services which were not completed
fetched are removed.
---
 src/shared/gatt-client.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
index e21aca1f0..409a3ee57 100644
--- a/src/shared/gatt-client.c
+++ b/src/shared/gatt-client.c
@@ -412,6 +412,10 @@ static void discovery_op_complete(struct discovery_op *op, bool success,
 		struct gatt_db_attribute *attr = svc->data;
 		uint16_t start, end;
 
+		/* Leave active services if operation was aborted */
+		if ((!success && err == 0) && gatt_db_service_get_active(attr))
+			continue;
+
 		gatt_db_attribute_get_service_data(attr, &start, &end,
 							NULL, NULL);
 
-- 
2.26.2


  parent reply	other threads:[~2020-07-17 19:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 19:15 [PATCH BlueZ 1/5] shared/att: Fix possible crash on disconnect Luiz Augusto von Dentz
2020-07-17 19:15 ` [PATCH BlueZ 2/5] shared/gatt-db: Add support for notifying attribute changes Luiz Augusto von Dentz
2020-07-17 19:15 ` [PATCH BlueZ 3/5] shared/gatt-client: Remove notification if its attribute is removed Luiz Augusto von Dentz
2020-07-17 19:15 ` Luiz Augusto von Dentz [this message]
2020-07-17 19:15 ` [PATCH BlueZ 5/5] shared/gatt-client: Fix handling of service changed Luiz Augusto von Dentz
2020-07-17 19:20 ` [BlueZ,1/5] shared/att: Fix possible crash on disconnect bluez.test.bot
2020-07-17 19:23 ` bluez.test.bot
2020-07-17 20:32   ` Tedd Ho-Jeong An
2020-07-17 20:45     ` Luiz Augusto von Dentz
2020-07-17 21:52       ` Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200717191515.220621-4-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).