diff options
author | Rafal Michalski <michalski.raf@gmail.com> | 2011-07-01 13:43:25 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2011-07-09 19:21:30 +0300 |
commit | 88fb8dd5715d6ddc02534bac1f909426067e417b (patch) | |
tree | edb14a8b3692c9ef6755329d7c4cd81a18891885 | |
parent | bf94d4bf578d6d072d675e7c82b00db9c7ee88f0 (diff) | |
download | obexd-88fb8dd5715d6ddc02534bac1f909426067e417b.tar.gz |
Return empty list for vcardlisting on empty phonebook
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).
-rw-r--r-- | 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); } |