2013-01-28 19:27:36

by Vinicius Costa Gomes

[permalink] [raw]
Subject: [PATCH BlueZ] media: Fix not finding endpoints with different case UUIDs

When multiple Endpoints are registered with different case UUIDs,
the only UUIDs found were those with matching case.
---
profiles/audio/media.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index 0ae9932..59fc840 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
@@ -170,7 +170,7 @@ static struct media_endpoint *media_adapter_find_endpoint(
if (path && g_strcmp0(endpoint->path, path) != 0)
continue;

- if (uuid && g_strcmp0(endpoint->uuid, uuid) != 0)
+ if (uuid && strcasecmp(endpoint->uuid, uuid) != 0)
continue;

return endpoint;
@@ -692,7 +692,7 @@ static bool endpoint_properties_get(const char *uuid,
for (l = adapter->endpoints; l; l = l->next) {
struct media_endpoint *endpoint = l->data;

- if (g_strcmp0(endpoint->uuid, uuid) != 0)
+ if (strcasecmp(endpoint->uuid, uuid) != 0)
continue;

append_endpoint(endpoint, &dict);
--
1.8.1.1



2013-01-28 20:20:06

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH BlueZ] media: Fix not finding endpoints with different case UUIDs

Hi Vinicius,

On Mon, Jan 28, 2013 at 1:27 PM, Vinicius Costa Gomes
<[email protected]> wrote:
> When multiple Endpoints are registered with different case UUIDs,
> the only UUIDs found were those with matching case.
> ---
> profiles/audio/media.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/profiles/audio/media.c b/profiles/audio/media.c
> index 0ae9932..59fc840 100644
> --- a/profiles/audio/media.c
> +++ b/profiles/audio/media.c
> @@ -170,7 +170,7 @@ static struct media_endpoint *media_adapter_find_endpoint(
> if (path && g_strcmp0(endpoint->path, path) != 0)
> continue;
>
> - if (uuid && g_strcmp0(endpoint->uuid, uuid) != 0)
> + if (uuid && strcasecmp(endpoint->uuid, uuid) != 0)
> continue;
>
> return endpoint;
> @@ -692,7 +692,7 @@ static bool endpoint_properties_get(const char *uuid,
> for (l = adapter->endpoints; l; l = l->next) {
> struct media_endpoint *endpoint = l->data;
>
> - if (g_strcmp0(endpoint->uuid, uuid) != 0)
> + if (strcasecmp(endpoint->uuid, uuid) != 0)
> continue;
>
> append_endpoint(endpoint, &dict);
> --
> 1.8.1.1

Applied, thanks


--
Luiz Augusto von Dentz