From de900f387d63bc74bebedbe52f158e7ec64129d5 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 8 May 2007 14:42:02 +0000 Subject: Fix bug on FindServer and add missing headers. --- network/server.c | 8 +++++--- network/server.h | 2 ++ 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); -- cgit