All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] doc: Label Profile1.Release() method as no reply
@ 2013-09-10 16:42 Denis Kenzior
  2013-09-10 16:42 ` [PATCH 2/3] doc: Remove Profile1.Cancel() method Denis Kenzior
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Denis Kenzior @ 2013-09-10 16:42 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Denis Kenzior

The current implementation does not expect a reply, nor would it make
sense for BlueZ to wait for one from the agent.  So explicitly label
this method as noreply.
---
 doc/profile-api.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/profile-api.txt b/doc/profile-api.txt
index 03b7d2b..96cfce9 100644
--- a/doc/profile-api.txt
+++ b/doc/profile-api.txt
@@ -108,7 +108,7 @@ Service		unique name
 Interface	org.bluez.Profile1
 Object path	freely definable
 
-Methods		void Release()
+Methods		void Release() [noreply]
 
 			This method gets called when the service daemon
 			unregisters the profile. A profile can use it to do
-- 
1.8.1.5


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

* [PATCH 2/3] doc: Remove Profile1.Cancel() method
  2013-09-10 16:42 [PATCH 1/3] doc: Label Profile1.Release() method as no reply Denis Kenzior
@ 2013-09-10 16:42 ` Denis Kenzior
  2013-09-10 16:42 ` [PATCH 3/3] profile: Remove support for Cancel method Denis Kenzior
  2013-09-11 18:49 ` [PATCH 1/3] doc: Label Profile1.Release() method as no reply Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2013-09-10 16:42 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Denis Kenzior

There does not seem to be any actual need for this method.

The current implementation calls Cancel when a pending
NewConnection() or RequestDisconnection() method call fails.
Additionally it calls Cancel() when the remote client has disconnected.
In either case BlueZ calls shutdown on the file descriptor associated
with the agent and issues a Cancel() method call.

The closing of the file descriptor will trigger a HUP on the agent side,
which will trigger normal cleanup procedures.  The received Cancel()
method call is redundant in both cases.
---
 doc/profile-api.txt | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/doc/profile-api.txt b/doc/profile-api.txt
index 96cfce9..ec18034 100644
--- a/doc/profile-api.txt
+++ b/doc/profile-api.txt
@@ -145,11 +145,3 @@ Methods		void Release() [noreply]
 
 			Possible errors: org.bluez.Error.Rejected
 			                 org.bluez.Error.Canceled
-
-		void Cancel()
-
-			This method gets called to indicate that the profile
-			request failed before a reply was returned.
-
-			All request are queued and there will be only one
-			pending pequest at a time per profile.
-- 
1.8.1.5


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

* [PATCH 3/3] profile: Remove support for Cancel method
  2013-09-10 16:42 [PATCH 1/3] doc: Label Profile1.Release() method as no reply Denis Kenzior
  2013-09-10 16:42 ` [PATCH 2/3] doc: Remove Profile1.Cancel() method Denis Kenzior
@ 2013-09-10 16:42 ` Denis Kenzior
  2013-09-11 18:49 ` [PATCH 1/3] doc: Label Profile1.Release() method as no reply Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2013-09-10 16:42 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Denis Kenzior

---
 src/profile.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/src/profile.c b/src/profile.c
index 57aead7..523e119 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -678,20 +678,9 @@ static struct ext_profile *find_ext_profile(const char *owner,
 	return NULL;
 }
 
-static void ext_cancel(struct ext_profile *ext)
-{
-	DBusMessage *msg;
-
-	msg = dbus_message_new_method_call(ext->owner, ext->path,
-						"org.bluez.Profile1", "Cancel");
-	if (msg)
-		g_dbus_send_message(btd_get_dbus_connection(), msg);
-}
-
 static void ext_io_destroy(gpointer p)
 {
 	struct ext_io *ext_io = p;
-	struct ext_profile *ext = ext_io->ext;
 
 	if (ext_io->io_id > 0)
 		g_source_remove(ext_io->io_id);
@@ -711,7 +700,6 @@ static void ext_io_destroy(gpointer p)
 	if (ext_io->pending) {
 		dbus_pending_call_cancel(ext_io->pending);
 		dbus_pending_call_unref(ext_io->pending);
-		ext_cancel(ext);
 	}
 
 	if (ext_io->resolving)
@@ -783,9 +771,6 @@ static void new_conn_reply(DBusPendingCall *call, void *user_data)
 
 	btd_service_connecting_complete(conn->service, -ECONNREFUSED);
 
-	if (dbus_error_has_name(&err, DBUS_ERROR_NO_REPLY))
-		ext_cancel(ext);
-
 	dbus_error_free(&err);
 
 	ext->conns = g_slist_remove(ext->conns, conn);
@@ -817,9 +802,6 @@ static void disconn_reply(DBusPendingCall *call, void *user_data)
 
 	btd_service_disconnecting_complete(conn->service, -ECONNREFUSED);
 
-	if (dbus_error_has_name(&err, DBUS_ERROR_NO_REPLY))
-		ext_cancel(ext);
-
 	dbus_error_free(&err);
 
 disconnect:
-- 
1.8.1.5


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

* Re: [PATCH 1/3] doc: Label Profile1.Release() method as no reply
  2013-09-10 16:42 [PATCH 1/3] doc: Label Profile1.Release() method as no reply Denis Kenzior
  2013-09-10 16:42 ` [PATCH 2/3] doc: Remove Profile1.Cancel() method Denis Kenzior
  2013-09-10 16:42 ` [PATCH 3/3] profile: Remove support for Cancel method Denis Kenzior
@ 2013-09-11 18:49 ` Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2013-09-11 18:49 UTC (permalink / raw)
  To: Denis Kenzior; +Cc: linux-bluetooth

Hi Denis,

On Tue, Sep 10, 2013, Denis Kenzior wrote:
> The current implementation does not expect a reply, nor would it make
> sense for BlueZ to wait for one from the agent.  So explicitly label
> this method as noreply.
> ---
>  doc/profile-api.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

All three patches have been applied. Thanks.

Johan

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

end of thread, other threads:[~2013-09-11 18:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-10 16:42 [PATCH 1/3] doc: Label Profile1.Release() method as no reply Denis Kenzior
2013-09-10 16:42 ` [PATCH 2/3] doc: Remove Profile1.Cancel() method Denis Kenzior
2013-09-10 16:42 ` [PATCH 3/3] profile: Remove support for Cancel method Denis Kenzior
2013-09-11 18:49 ` [PATCH 1/3] doc: Label Profile1.Release() method as no reply Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.