Commit: 5d88d8d690b3aa3f84813b3d6d22e68b69b7459a
Parent: 13568564b1ef30ccd14812af2b393f6dfc02b4b1
Author: Peter Hurley <peter@hurleysoftware.com>
Committer: Johan Hedberg <johan.hedberg@intel.com>
Date: 2011-07-10 10:55:19
Tree: f4b31a7a130eef928b2a503b08f74dedc763d74a

avdtp: fix race condition when starting a stream The AVDTP spec allows for a race condition between remote and local device when issuing an AVDTP_START cmd on a stream in the OPEN state. However, the internal state must continue to be consistent. For example, suppose that avdtp_start() has been called while in the OPEN state and a AVDTP_START cmd is sent. Now before we have received a response (and thus entered the STREAMING state), we *receive* a START cmd. Prior to this fix, since the sep is still in the OPEN state, we would accept the new START cmd. This will leads us to send both a Start_Ind and Start_Cfm - not good. Now, we track this transitional state (starting == TRUE). NB - 'starting' is only in a valid state while the sep is in the OPEN state. 'starting' is reset when we return to the OPEN state.

Diffstat

M audio/avdtp.c | 29 +++++++++++++++++++++++++- - - -

1 files changed, 25 insertions(+), 4 deletions(-)

View Full Diff | Patch