* [PATCH 1/2] Fix Find by Type Response with start == end grp handle
@ 2011-02-21 14:36 Bruna Moreira
2011-02-21 14:36 ` [PATCH 2/2] Fix end grp handle on Find By Type response Bruna Moreira
2011-02-21 16:57 ` [PATCH 1/2] Fix Find by Type Response with start == end grp handle Johan Hedberg
0 siblings, 2 replies; 3+ messages in thread
From: Bruna Moreira @ 2011-02-21 14:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Bruna Moreira
Find by type value response in attribute server was in loop when the
start/end grp handles from a primary service had same values.
Initializing end grp handle with start handle makes the special check
when end grp handle was zero unnecessary so it was removed.
---
src/attrib-server.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/attrib-server.c b/src/attrib-server.c
index 4285f6e..2eb800f 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -469,6 +469,9 @@ static int find_by_type(uint16_t start, uint16_t end, uuid_t *uuid,
range = g_new0(struct att_range, 1);
range->start = a->handle;
+ /* It is allowed to have end group handle the same as
+ * start handle, for groups with only one attribute. */
+ range->end = a->handle;
matches = g_slist_append(matches, range);
} else if (range) {
@@ -487,12 +490,6 @@ static int find_by_type(uint16_t start, uint16_t end, uuid_t *uuid,
if (l == NULL) {
/* Avoids another iteration */
range->end = 0xFFFF;
- } else if (range->end == 0) {
- /* Broken requests: requested End Handle is not
- * 0xFFFF. Given handle is in the middle of a
- * service definition. */
- matches = g_slist_remove(matches, range);
- g_free(range);
}
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] Fix end grp handle on Find By Type response
2011-02-21 14:36 [PATCH 1/2] Fix Find by Type Response with start == end grp handle Bruna Moreira
@ 2011-02-21 14:36 ` Bruna Moreira
2011-02-21 16:57 ` [PATCH 1/2] Fix Find by Type Response with start == end grp handle Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Bruna Moreira @ 2011-02-21 14:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Bruna Moreira
The attribute server was incorrectly setting the end group handle of the
last attribute to 0xFFFF on Find By Type response (used by Discover
Primary Service by UUID).
---
src/attrib-server.c | 7 -------
1 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/src/attrib-server.c b/src/attrib-server.c
index 2eb800f..7ec0f56 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -486,13 +486,6 @@ static int find_by_type(uint16_t start, uint16_t end, uuid_t *uuid,
}
}
- if (range) {
- if (l == NULL) {
- /* Avoids another iteration */
- range->end = 0xFFFF;
- }
- }
-
if (matches == NULL)
return enc_error_resp(ATT_OP_FIND_BY_TYPE_REQ, start,
ATT_ECODE_ATTR_NOT_FOUND, opdu, mtu);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] Fix Find by Type Response with start == end grp handle
2011-02-21 14:36 [PATCH 1/2] Fix Find by Type Response with start == end grp handle Bruna Moreira
2011-02-21 14:36 ` [PATCH 2/2] Fix end grp handle on Find By Type response Bruna Moreira
@ 2011-02-21 16:57 ` Johan Hedberg
1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2011-02-21 16:57 UTC (permalink / raw)
To: Bruna Moreira; +Cc: linux-bluetooth
Hi Bruna,
On Mon, Feb 21, 2011, Bruna Moreira wrote:
> Find by type value response in attribute server was in loop when the
> start/end grp handles from a primary service had same values.
>
> Initializing end grp handle with start handle makes the special check
> when end grp handle was zero unnecessary so it was removed.
> ---
> src/attrib-server.c | 9 +++------
> 1 files changed, 3 insertions(+), 6 deletions(-)
Both patches have been pushed upstream. Thanks.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-02-21 16:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-21 14:36 [PATCH 1/2] Fix Find by Type Response with start == end grp handle Bruna Moreira
2011-02-21 14:36 ` [PATCH 2/2] Fix end grp handle on Find By Type response Bruna Moreira
2011-02-21 16:57 ` [PATCH 1/2] Fix Find by Type Response with start == end grp handle Johan Hedberg
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).