[PATCH obexd 2/2] Return empty list for vcardlisting on empty phonebook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This change is needed to be consistent with scenario about pulling empty
phonebook. Previously NOT_FOUND error was returned for vcardlisting when
there were no entries in selected phonebook.

PBAP spec says, that error NOT_FOUND should be returned when phonebook object
could not be found - very strict clients may think that phonebook does not exist
(and in scenario described above phonebook exists but its content is empty).
---
 plugins/pbap.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/plugins/pbap.c b/plugins/pbap.c
index ab1d9ce..7eedfe0 100644
--- a/plugins/pbap.c
+++ b/plugins/pbap.c
@@ -462,8 +462,6 @@ static int generate_response(void *user_data)
 	sorted = sort_entries(pbap->cache.entries, pbap->params->order,
 				pbap->params->searchattrib,
 				(const char *) pbap->params->searchval);
-	if (sorted == NULL)
-		return -ENOENT;
 
 	/* Computing offset considering first entry of the phonebook */
 	l = g_slist_nth(sorted, pbap->params->liststartoffset);
@@ -486,18 +484,12 @@ static int generate_response(void *user_data)
 static void cache_ready_notify(void *user_data)
 {
 	struct pbap_session *pbap = user_data;
-	int err;
 
 	DBG("");
 
 	pbap->cache.valid = TRUE;
 
-	err = generate_response(pbap);
-	if (err < 0) {
-		obex_object_set_io_flags(pbap->obj, G_IO_ERR, err);
-		return;
-	}
-
+	generate_response(pbap);
 	obex_object_set_io_flags(pbap->obj, G_IO_IN, 0);
 }
 
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux