Thread (3 messages) 3 messages, 2 authors, 2011-02-21
STALE5635d

[PATCH 1/2] Fix Find by Type Response with start == end grp handle

From: Bruna Moreira <hidden>
Date: 2011-02-21 14:36:53
Subsystem: the rest · Maintainer: Linus Torvalds

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help