rpms/bluez/devel bluez-4.5-browse-fixes.patch, NONE, 1.1 bluez.spec, 1.4, 1.5

David Woodhouse dwmw2 at fedoraproject.org
Sat Sep 13 04:08:11 UTC 2008


Author: dwmw2

Update of /cvs/pkgs/rpms/bluez/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv29598

Modified Files:
	bluez.spec 
Added Files:
	bluez-4.5-browse-fixes.patch 
Log Message:
fix sdp browse problems

bluez-4.5-browse-fixes.patch:

--- NEW FILE bluez-4.5-browse-fixes.patch ---
--- bluez-4.5/src/device.c.orig	2008-09-11 23:59:02.000000000 -0700
+++ bluez-4.5/src/device.c	2008-09-12 21:04:40.000000000 -0700
@@ -977,8 +977,9 @@ static void browse_cb(sdp_list_t *recs, 
 	bdaddr_t src, dst;
 	uuid_t uuid;
 
-	/* Public browsing successful or Single record requested */
-	if (err < 0 || (!req->search_uuid && recs))
+	/* If we have a valid response and req->search_uuid == 1, then
+	   public browsing was successful -- we don't need any more */
+	if (err < 0 || (req->search_uuid == 1 && recs))
 		goto done;
 
 	update_services(req, recs);
@@ -987,8 +988,8 @@ static void browse_cb(sdp_list_t *recs, 
 	str2ba(device->address, &dst);
 
 	/* Search for mandatory uuids */
-	if (uuid_list[++req->search_uuid]) {
-		sdp_uuid16_create(&uuid, uuid_list[req->search_uuid]);
+	if (uuid_list[req->search_uuid]) {
+		sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]);
 		bt_search_service(&src, &dst, &uuid, browse_cb, user_data, NULL);
 		return;
 	}
@@ -1025,10 +1026,25 @@ static void init_browse(struct browse_re
 
 		for (i = 0; driver->uuids[i]; i++) {
 			char *uuid;
+			int j;
 
+			/* Eliminate duplicates of UUIDs in uuid_list[]... */
+			if (strlen(driver->uuids[i]) == 36 && 
+			    !strncmp(driver->uuids[i], "0000", 4) &&
+			    !strcasecmp(driver->uuids[i] + 8, 
+					"-0000-1000-8000-00805F9B34FB")) {
+				uint16_t uuid16 = strtol(driver->uuids[i],
+							 NULL, 16);
+				for (j = 0; uuid_list[j]; j++) {
+					if (uuid16 == uuid_list[j])
+						continue;
+				}
+					
+			}
+			/* ... and of UUIDs another driver already asked for */
 			if (g_slist_find_custom(req->uuids, driver->uuids[i],
 					(GCompareFunc) strcasecmp))
-				return;
+				continue;
 
 			uuid = g_strdup(driver->uuids[i]);
 			req->uuids = g_slist_append(req->uuids, uuid);
@@ -1062,7 +1078,7 @@ int device_browse(struct btd_device *dev
 		memcpy(&uuid, search, sizeof(uuid_t));
 		cb = search_cb;
 	} else {
-		sdp_uuid16_create(&uuid, uuid_list[req->search_uuid]);
+		sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]);
 		init_browse(req);
 		cb = browse_cb;
 	}
@@ -1076,7 +1092,7 @@ int device_browse(struct btd_device *dev
 						discover_services_req_exit,
 						device, NULL);
 
-	return bt_search_service(&src, &dst, &uuid, browse_cb, req, NULL);
+	return bt_search_service(&src, &dst, &uuid, cb, req, NULL);
 }
 
 struct btd_adapter *device_get_adapter(struct btd_device *device)


Index: bluez.spec
===================================================================
RCS file: /cvs/pkgs/rpms/bluez/devel/bluez.spec,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- bluez.spec	12 Sep 2008 22:29:05 -0000	1.4
+++ bluez.spec	13 Sep 2008 04:07:40 -0000	1.5
@@ -1,13 +1,14 @@
 Summary: Bluetooth utilities
 Name: bluez
 Version: 4.5
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2+
 Group: Applications/System
 Source: http://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.gz
 Source1: bluetooth.init
 Source2: bluetooth.conf
 Patch1: bluez-utils-oui-usage.patch
+Patch2: bluez-4.5-browse-fixes.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 URL: http://www.bluez.org/
@@ -96,6 +97,7 @@
 
 %setup -q
 %patch1 -p0 -b .oui
+%patch2 -p1
 
 %build
 %configure --enable-cups --enable-hid2hci --enable-dfutool --enable-tools --enable-bccmd --enable-gstreamer --enable-hidd --enable-pand --enable-dund
@@ -181,6 +183,9 @@
 %{_libdir}/alsa-lib/*.so
 
 %changelog
+* Fri Sep 12 2008 - David Woodhouse <David.Woodhouse at intel.com> - 4.5-4
+- SDP browse fixes
+
 * Fri Sep 12 2008 - David Woodhouse <David.Woodhouse at intel.com> - 4.5-3
 - Bluez-alsa needs to provide/obsolete bluez-utils-alsa
 - Use versioned Obsoletes:




More information about the fedora-extras-commits mailing list