Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/4] AVCTP: Fix allways destroying browsing channel
@ 2013-01-31 17:12 Luiz Augusto von Dentz
  2013-01-31 17:12 ` [PATCH BlueZ 2/4] AVCTP: Fix memory leak Luiz Augusto von Dentz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2013-01-31 17:12 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This reverts commit 53d3fc3fad5152167458625ad2acf19070cdf26a that leads
to always destroy the browsing channel because the callback changes the
state.

To fix session_browsing_cb naw takes care of destroying the channel if it
disconnects.
---
 profiles/audio/avctp.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
index 41e2f46..303427e 100644
--- a/profiles/audio/avctp.c
+++ b/profiles/audio/avctp.c
@@ -490,10 +490,6 @@ static void avctp_set_state(struct avctp *session, avctp_state_t new_state)
 		break;
 	case AVCTP_STATE_CONNECTED:
 		DBG("AVCTP Connected");
-		if (session->browsing) {
-			avctp_channel_destroy(session->browsing);
-			session->browsing = NULL;
-		}
 		break;
 	case AVCTP_STATE_BROWSING_CONNECTING:
 		DBG("AVCTP Browsing Connecting");
@@ -817,6 +813,13 @@ send:
 
 failed:
 	DBG("AVCTP Browsing: disconnected");
+	avctp_set_state(session, AVCTP_STATE_CONNECTED);
+
+	if (session->browsing) {
+		avctp_channel_destroy(session->browsing);
+		session->browsing = NULL;
+	}
+
 	return FALSE;
 }
 
-- 
1.8.1


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

end of thread, other threads:[~2013-01-31 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-31 17:12 [PATCH BlueZ 1/4] AVCTP: Fix allways destroying browsing channel Luiz Augusto von Dentz
2013-01-31 17:12 ` [PATCH BlueZ 2/4] AVCTP: Fix memory leak Luiz Augusto von Dentz
2013-01-31 17:12 ` [PATCH BlueZ 3/4] A2DP: Fix not setting setup error to NULL Luiz Augusto von Dentz
2013-01-31 17:12 ` [PATCH BlueZ 4/4] AVRCP: Get track duration using GetPlayStatus command Luiz Augusto von Dentz

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