From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 1/2] Fix service driver selection when WHO header is informed
Date: Tue, 23 Feb 2010 12:06:14 +0200 [thread overview]
Message-ID: <2d5a2c101002230206r5a945ec0hd8b638f171440a33@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]
Drivers which support WHO header should be checked first since they have
priority e.g. pcsuite over ftp.
---
src/service.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/service.c b/src/service.c
index 196a5c1..c6ce101 100644
--- a/src/service.c
+++ b/src/service.c
@@ -49,8 +49,8 @@ struct obex_service_driver
*obex_service_driver_find(GSList *list,
struct obex_service_driver *driver = l->data;
if (driver->who && who &&
- driver->who_size == who_size &&
- memcmp(driver->who, who, who_size) != 0)
+ (driver->who_size != who_size ||
+ memcmp(driver->who, who, who_size) != 0))
continue;
if (driver->target == NULL && target == NULL)
@@ -97,7 +97,11 @@ int obex_service_driver_register(struct
obex_service_driver *driver)
debug("driver %p service %s registered", driver, driver->name);
- drivers = g_slist_append(drivers, driver);
+ /* Drivers that support who has priority */
+ if (driver->who)
+ drivers = g_slist_prepend(drivers, driver);
+ else
+ drivers = g_slist_append(drivers, driver);
return 0;
}
--
1.6.3.3
--
Luiz Augusto von Dentz
Computer Engineer
[-- Attachment #2: 0001-Fix-service-driver-selection-when-WHO-header-is-info.patch --]
[-- Type: text/x-patch, Size: 1346 bytes --]
From cce63393c40e55ddbdbc8241bddaecdb5d7306ef Mon Sep 17 00:00:00 2001
From: Luiz Augusto Von Dentz <luiz.dentz-von@nokia.com>
Date: Mon, 22 Feb 2010 17:26:26 +0200
Subject: [PATCH 1/2] Fix service driver selection when WHO header is informed
Drivers which support WHO header should be checked first since they have
priority e.g. pcsuite over ftp.
---
src/service.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/service.c b/src/service.c
index 196a5c1..c6ce101 100644
--- a/src/service.c
+++ b/src/service.c
@@ -49,8 +49,8 @@ struct obex_service_driver *obex_service_driver_find(GSList *list,
struct obex_service_driver *driver = l->data;
if (driver->who && who &&
- driver->who_size == who_size &&
- memcmp(driver->who, who, who_size) != 0)
+ (driver->who_size != who_size ||
+ memcmp(driver->who, who, who_size) != 0))
continue;
if (driver->target == NULL && target == NULL)
@@ -97,7 +97,11 @@ int obex_service_driver_register(struct obex_service_driver *driver)
debug("driver %p service %s registered", driver, driver->name);
- drivers = g_slist_append(drivers, driver);
+ /* Drivers that support who has priority */
+ if (driver->who)
+ drivers = g_slist_prepend(drivers, driver);
+ else
+ drivers = g_slist_append(drivers, driver);
return 0;
}
--
1.6.3.3
next reply other threads:[~2010-02-23 10:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-23 10:06 Luiz Augusto von Dentz [this message]
2010-02-23 13:59 ` [PATCH 1/2] Fix service driver selection when WHO header is informed Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2d5a2c101002230206r5a945ec0hd8b638f171440a33@mail.gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).