Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/bta2dpd/bta2dpd Connection state machine improvemen...



details:   https://anonhg.NetBSD.org/src/rev/6359a692301c
branches:  trunk
changeset: 826301:6359a692301c
user:      nat <nat%NetBSD.org@localhost>
date:      Sun Aug 27 10:39:18 2017 +0000

description:
Connection state machine improvement upon transition from AVDTP_OPEN to
AVDTP_START/SUSPEND.

diffstat:

 usr.sbin/bta2dpd/bta2dpd/bta2dpd.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r c516996d1b7c -r 6359a692301c usr.sbin/bta2dpd/bta2dpd/bta2dpd.c
--- a/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c        Sun Aug 27 09:32:12 2017 +0000
+++ b/usr.sbin/bta2dpd/bta2dpd/bta2dpd.c        Sun Aug 27 10:39:18 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bta2dpd.c,v 1.3 2017/05/27 10:04:57 nat Exp $ */
+/* $NetBSD: bta2dpd.c,v 1.4 2017/08/27 10:39:18 nat Exp $ */
 
 /*-
  * Copyright (c) 2015 - 2016 Nathanial Sloss <nathanialsloss%yahoo.com.au@localhost>
@@ -674,7 +674,8 @@
                case AVDTP_SUSPEND:
                case AVDTP_START:
                        avdtpSendAccept(fd, fd, trans, signal);
-                       state = 6;
+                       if (state < 6)
+                               state = 6;
                        break;
                default:
                        avdtpSendReject(fd, fd, trans, signal);
@@ -717,7 +718,8 @@
                        break;
                case AVDTP_SUSPEND:
                case AVDTP_START:
-                       state = 6;
+                       if (state < 6)
+                               state = 6;
                        break;
                default:
                        avdtpSendReject(fd, fd, trans, signal);
@@ -730,7 +732,7 @@
        if (state < 5 || state > 7)
                return;
 
-       if (asSpeaker) {
+       if (asSpeaker && state == 6) {
                len = sizeof(addr);
                if ((sc = accept(orighc,(struct sockaddr*)&addr, &len)) < 0)
                        err(EXIT_FAILURE, "stream accept");



Home | Main Index | Thread Index | Old Index