All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH obexd] Fix finding mime driver by type
@ 2011-07-21 10:56 Slawomir Bochenski
  2011-07-21 11:07 ` Slawomir Bochenski
  2011-07-27 11:52 ` Johan Hedberg
  0 siblings, 2 replies; 4+ messages in thread
From: Slawomir Bochenski @ 2011-07-21 10:56 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Slawomir Bochenski

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH obexd] Fix finding mime driver by type
  2011-07-21 10:56 [PATCH obexd] Fix finding mime driver by type Slawomir Bochenski
@ 2011-07-21 11:07 ` Slawomir Bochenski
  2011-07-21 11:53   ` Luiz Augusto von Dentz
  2011-07-27 11:52 ` Johan Hedberg
  1 sibling, 1 reply; 4+ messages in thread
From: Slawomir Bochenski @ 2011-07-21 11:07 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Slawomir Bochenski

On Thu, Jul 21, 2011 at 12:56 PM, Slawomir Bochenski <lkslawek@gmail.com> wrote:
> 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).

s/which/whose/

-- 
Slawomir Bochenski

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH obexd] Fix finding mime driver by type
  2011-07-21 11:07 ` Slawomir Bochenski
@ 2011-07-21 11:53   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2011-07-21 11:53 UTC (permalink / raw)
  To: Slawomir Bochenski; +Cc: linux-bluetooth

Hi,

On Thu, Jul 21, 2011 at 2:07 PM, Slawomir Bochenski <lkslawek@gmail.com> wrote:
> On Thu, Jul 21, 2011 at 12:56 PM, Slawomir Bochenski <lkslawek@gmail.com> wrote:
>> 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).
>
> s/which/whose/
>
> --

Nice catch, ack.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH obexd] Fix finding mime driver by type
  2011-07-21 10:56 [PATCH obexd] Fix finding mime driver by type Slawomir Bochenski
  2011-07-21 11:07 ` Slawomir Bochenski
@ 2011-07-27 11:52 ` Johan Hedberg
  1 sibling, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2011-07-27 11:52 UTC (permalink / raw)
  To: Slawomir Bochenski; +Cc: linux-bluetooth

Hi Slawek,

On Thu, Jul 21, 2011, Slawomir Bochenski wrote:
> 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(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-27 11:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-21 10:56 [PATCH obexd] Fix finding mime driver by type Slawomir Bochenski
2011-07-21 11:07 ` Slawomir Bochenski
2011-07-21 11:53   ` Luiz Augusto von Dentz
2011-07-27 11:52 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.