[PATCH obexd] Fix finding mime driver by type

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

 



IrOBEX specification chap. 2.2.3 states that the Type header is an ASCII
null-terminated string which values are case insensitive (as it is also
defined by RFC 1521).
---
 src/mimetype.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/mimetype.c b/src/mimetype.c
index 078d97c..4e3573c 100644
--- a/src/mimetype.c
+++ b/src/mimetype.c
@@ -135,7 +135,14 @@ static struct obex_mime_type_driver *find_driver(const uint8_t *target,
 		if (memncmp0(who, who_size, driver->who, driver->who_size))
 			continue;
 
-		if (g_strcmp0(mimetype, driver->mimetype) == 0)
+		if (mimetype == NULL || driver->mimetype == NULL) {
+			if (mimetype == driver->mimetype)
+				return driver;
+			else
+				continue;
+		}
+
+		if (g_ascii_strcasecmp(mimetype, driver->mimetype) == 0)
 			return driver;
 	}
 
-- 
1.7.4.1

--
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