public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHes] CUPS fixes
@ 2009-08-11 11:27 Bastien Nocera
  2009-08-11 22:02 ` Marcel Holtmann
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien Nocera @ 2009-08-11 11:27 UTC (permalink / raw)
  To: BlueZ development

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]

The CUPS backend would be aborting when scanning for a printer that's
not in bluetoothd known devices. Fixes both bugs I found in my testing.

Cheers

[-- Attachment #2: 0001-Don-t-abort-cups-backend-on-property-change.patch --]
[-- Type: text/x-patch, Size: 963 bytes --]

>From 35ffd5a6dafd7e38c7d8c9502608314a44919302 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 11 Aug 2009 12:23:39 +0100
Subject: [PATCH 1/2] Don't abort cups backend on property change

Make sure the cups backend doesn't abort when trying to
access a property that's not Discovering.
---
 cups/main.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/cups/main.c b/cups/main.c
index 2fbfe7e..9c24734 100644
--- a/cups/main.c
+++ b/cups/main.c
@@ -506,6 +506,9 @@ static DBusHandlerResult filter_func(DBusConnection *connection, DBusMessage *me
 
 		dbus_message_iter_init(message, &iter);
 		dbus_message_iter_get_basic(&iter, &name);
+		if (name == NULL ||
+		    strcmp(name, "Discovering") != 0)
+		    	return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
 		dbus_message_iter_next(&iter);
 		dbus_message_iter_recurse(&iter, &value_iter);
 		dbus_message_iter_get_basic(&value_iter, &discovering);
-- 
1.6.2.5


[-- Attachment #3: 0002-Actually-read-the-CreateDevice-reply.patch --]
[-- Type: text/x-patch, Size: 906 bytes --]

>From b29e1cb433454391da92720c3ff87373d9d60500 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 11 Aug 2009 12:24:58 +0100
Subject: [PATCH 2/2] Actually read the CreateDevice reply

Fixes aborts when the printer isn't a known device.
---
 cups/main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cups/main.c b/cups/main.c
index 9c24734..ba9864f 100644
--- a/cups/main.c
+++ b/cups/main.c
@@ -371,9 +371,9 @@ static void remote_device_found(const char *adapter, const char *bdaddr, const c
 
 		if (!reply)
 			return;
-	} else {
-		if (dbus_message_get_args(reply, NULL, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID) == FALSE)
-			return;
+	}
+	if (dbus_message_get_args(reply, NULL, DBUS_TYPE_OBJECT_PATH, &object_path, DBUS_TYPE_INVALID) == FALSE) {
+		return;
 	}
 
 	id = device_get_ieee1284_id(adapter, object_path);
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-11 22:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-11 11:27 [PATCHes] CUPS fixes Bastien Nocera
2009-08-11 22:02 ` Marcel Holtmann
2009-08-11 22:29   ` Bastien Nocera
2009-08-11 22:32     ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox