diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-10-20 00:06:04 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-10-20 00:06:04 +0300 |
commit | 0c1d6232e7b4c39d33dfcc759bd19f050d7953e7 (patch) | |
tree | 54dda27ecb39482144bf19a817cd410077acb46d /audio | |
parent | d78f1f6ca28f2744af70bf189837e4c1b06b4eb8 (diff) |
Perform a proper abort upon stream connect failure
Diffstat (limited to 'audio')
-rw-r--r-- | audio/avdtp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/audio/avdtp.c b/audio/avdtp.c index 87e19cca..93b40d9b 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -1618,9 +1618,13 @@ static void l2cap_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src, failed: if (session->pending_open) { - avdtp_sep_set_state(session, session->pending_open->lsep, - AVDTP_STATE_IDLE); - session->pending_open = NULL; + struct avdtp_stream *stream = session->pending_open; + + handle_transport_connect(session, -1, 0, 0); + + if (avdtp_abort(session, stream) < 0) + avdtp_sep_set_state(session, stream->lsep, + AVDTP_STATE_IDLE); } else connection_lost(session, -err); @@ -2678,7 +2682,7 @@ int avdtp_abort(struct avdtp *session, struct avdtp_stream *stream) avdtp_sep_set_state(session, stream->lsep, AVDTP_STATE_ABORTING); - return 0; + return ret; } struct avdtp_local_sep *avdtp_register_sep(const bdaddr_t *src, uint8_t type, |