summaryrefslogtreecommitdiffstats
path: root/network
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-05-08 14:42:02 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-05-08 14:42:02 +0000
commitde900f387d63bc74bebedbe52f158e7ec64129d5 (patch)
tree3bafd58bff3f57e39cb7f0c375e90fec75c68e48 /network
parente9143c3e1fd1b882f475c98394f549d2b2aabcea (diff)
Fix bug on FindServer and add missing headers.
Diffstat (limited to 'network')
-rw-r--r--network/server.c8
-rw-r--r--network/server.h2
2 files changed, 7 insertions, 3 deletions
diff --git a/network/server.c b/network/server.c
index 0c22a67d..a3b1c068 100644
--- a/network/server.c
+++ b/network/server.c
@@ -1249,17 +1249,19 @@ int server_find_data(DBusConnection *conn,
const char *path, const char *pattern)
{
struct network_server *ns;
+ const char *uuid;
if (!dbus_connection_get_object_path_data(conn, path, (void *) &ns))
return -1;
- if (strcasecmp(pattern, ns->name) == 0)
+ if (ns->name && strcasecmp(pattern, ns->name) == 0)
return 0;
- if (strcasecmp(pattern, ns->iface) == 0)
+ if (ns->iface && strcasecmp(pattern, ns->iface) == 0)
return 0;
- if (strcasecmp(pattern, bnep_name(ns->id)) == 0)
+ uuid = bnep_name(ns->id);
+ if (uuid && strcasecmp(pattern, uuid) == 0)
return 0;
if (bnep_service_id(pattern) == ns->id)
diff --git a/network/server.h b/network/server.h
index 30016f3e..ff754711 100644
--- a/network/server.h
+++ b/network/server.h
@@ -28,3 +28,5 @@ int server_register_from_file(DBusConnection *conn, const char *path,
int server_store(DBusConnection *conn, const char *path);
int server_remove_stored(DBusConnection *conn, const char *path);
+int server_find_data(DBusConnection *conn, const char *path,
+ const char *pattern);