[PATCH obexd] Fix pulling single vCard for parameters header missing

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

 



According to PBAP specification (ANNEX A), all application-parameters
are optional in case of pulling single vCard entry, so header for
application-parameters can be omitted, and it would be valid as well.
Previously pulling single vCard was always failing with "Bad Request"
status in such a circumstance.
This patch fixes that issue and pulling single vCard is done successfully
with "OK" status. Output vCard would contain all fields under 2.1 format
(as for default settings).
---
 plugins/pbap.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/plugins/pbap.c b/plugins/pbap.c
index a03f07c..066e37e 100644
--- a/plugins/pbap.c
+++ b/plugins/pbap.c
@@ -643,8 +643,12 @@ static int pbap_get(struct obex_session *os, obex_object_t *obj,
 		return -EBADR;
 
 	rsize = obex_aparam_read(os, obj, &buffer);
-	if (rsize < 0)
-		return -EBADR;
+	if (rsize < 0) {
+		if (g_ascii_strcasecmp(type, VCARDENTRY_TYPE) != 0)
+			return -EBADR;
+
+		rsize = 0;
+	}
 
 	params = parse_aparam(buffer, rsize);
 	if (params == NULL)
-- 
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