From 2865321b1111d201fa68e2b579ea78df792a39ab Mon Sep 17 00:00:00 2001 From: Slawomir Bochenski Date: Thu, 21 Jul 2011 12:56:39 +0200 Subject: [PATCH] obexd: Fix finding mime driver by type IrOBEX specification chap. 2.2.3 states that the Type header is an ASCII null-terminated string whose values are case insensitive (as it is also defined by RFC 1521). --- obexd/src/mimetype.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/obexd/src/mimetype.c b/obexd/src/mimetype.c index 078d97c58..4e3573ca6 100644 --- a/obexd/src/mimetype.c +++ b/obexd/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; } -- 2.47.3