linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] audio/gateway.c: Don't reply to DBus when connection comes from AG
@ 2010-02-15 19:34 Gustavo F. Padovan
  2010-02-16  5:27 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo F. Padovan @ 2010-02-15 19:34 UTC (permalink / raw)
  To: linux-bluetooth

---
 audio/gateway.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/audio/gateway.c b/audio/gateway.c
index 46fbb63..22e5da2 100644
--- a/audio/gateway.c
+++ b/audio/gateway.c
@@ -224,7 +224,7 @@ static void rfcomm_connect_cb(GIOChannel *chan, GError *err,
 	struct audio_device *dev = user_data;
 	struct gateway *gw = dev->gateway;
 	DBusMessage *reply;
-	int sk;
+	int sk, ret;
 
 	if (err) {
 		error("connect(): %s", err->message);
@@ -242,11 +242,16 @@ static void rfcomm_connect_cb(GIOChannel *chan, GError *err,
 
 	gw->rfcomm = g_io_channel_ref(chan);
 
-	if (!agent_sendfd(gw->agent, sk, newconnection_reply, dev))
+	ret = agent_sendfd(gw->agent, sk, newconnection_reply, dev);
+
+	if (!gw->msg)
+		return;
+
+	if (ret)
+		reply = dbus_message_new_method_return(gw->msg);
+	else
 		reply = g_dbus_create_error(gw->msg, ERROR_INTERFACE ".Failed",
 					"Can not pass file descriptor");
-	else
-		reply = dbus_message_new_method_return(gw->msg);
 
 	g_dbus_send_message(dev->conn, reply);
 
@@ -258,7 +263,6 @@ fail:
 						ERROR_INTERFACE ".Failed",
 						"Connection attempt failed");
 
-
 	change_state(dev, GATEWAY_STATE_DISCONNECTED);
 }
 
-- 
1.6.4.4


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

* Re: [PATCH] audio/gateway.c: Don't reply to DBus when connection comes from AG
  2010-02-15 19:34 [PATCH] audio/gateway.c: Don't reply to DBus when connection comes from AG Gustavo F. Padovan
@ 2010-02-16  5:27 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2010-02-16  5:27 UTC (permalink / raw)
  To: Gustavo F. Padovan; +Cc: linux-bluetooth

Hi Gustavo,

>  audio/gateway.c |   14 +++++++++-----
>  1 files changed, 9 insertions(+), 5 deletions(-)

patch has been applied. Thanks.

Regards

Marcel



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

end of thread, other threads:[~2010-02-16  5:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15 19:34 [PATCH] audio/gateway.c: Don't reply to DBus when connection comes from AG Gustavo F. Padovan
2010-02-16  5:27 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).