Skip to contentSkip to conversation

Return empty body instead -ENOENT when phonebook is empty

PATCH In review Rafal Michalski 2 participants 2 messages Jul 1, 2011 – Jul 9, 2011 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Return empty body instead -ENOENT when phonebook is empty

Previously, when doing pull of empty phonebook, NOT FOUND error was returned. Now returning empty body - this change is needed to pass PTS testcase TC_PSE_PDF_BV_05_I (this testcase is optional).

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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
plugins/pbap.c +1 -1
index 0356ae7..ab1d9ce 100644
@@ -301,7 +301,7 @@ static void query_result(const char *buffer, size_t bufsize, int vcards,
 
 	pbap->obj->lastpart = lastpart;
 
-	if (vcards <= 0) {
+	if (vcards < 0) {
 		obex_object_set_io_flags(pbap->obj, G_IO_ERR, -ENOENT);
 		return;
 	}
Signature · 1 line
1.6.3.3
#1 lore raw

Hi Rafal,

Quoted 11 lines · Rafal Michalski

Previously, when doing pull of empty phonebook, NOT FOUND error was returned. Now returning empty body - this change is needed to pass PTS testcase TC_PSE_PDF_BV_05_I (this testcase is optional).

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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Both patches have been applied. Thanks.

Johan