From 77f1e5fd0decd1726a86746fe6b0e497c8673cd1 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Tue, 13 Apr 2010 19:32:20 -0300 Subject: [PATCH] obexd: Fix PhoneBookSize request for PullPhoneBook function When MaxListCount is zero, PCE wants to know the number of used indexes in the phonebook of interest. All other application parameters shall be ignored. --- obexd/plugins/phonebook-ebook.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/obexd/plugins/phonebook-ebook.c b/obexd/plugins/phonebook-ebook.c index 140ca78ee..153ea95f2 100644 --- a/obexd/plugins/phonebook-ebook.c +++ b/obexd/plugins/phonebook-ebook.c @@ -141,7 +141,17 @@ static void ebookpull_cb(EBook *book, EBookStatus estatus, GList *contacts, goto done; } + /* + * When MaxListCount s zero, PCE wants to know the number of used + * indexes in the phonebook of interest. All other parameters that + * may be present in the request shall be ignored. + */ maxcount = data->params->maxlistcount; + if (maxcount == 0) { + count = g_list_length(contacts); + goto done; + } + l = g_list_nth(contacts, data->params->liststartoffset); /* FIXME: Missing 0.vcf */ -- 2.47.3