rfcomm: don't send rfcomm channel open failed on remote disconnect

This commit is contained in:
Matthias Ringwald 2016-03-31 14:57:21 +02:00
parent 1193857ef4
commit 67a687294c

View File

@ -768,10 +768,16 @@ static void rfcomm_multiplexer_finalize(rfcomm_multiplexer_t * multiplexer){
rfcomm_channel_t * channel = (rfcomm_channel_t *) it->next;
if (channel->multiplexer == multiplexer) {
// emit appropriate events
if (channel->state == RFCOMM_CHANNEL_OPEN) {
rfcomm_emit_channel_closed(channel);
} else {
rfcomm_emit_channel_opened(channel, RFCOMM_MULTIPLEXER_STOPPED);
switch(channel->state){
case RFCOMM_CHANNEL_OPEN:
rfcomm_emit_channel_closed(channel);
break;
case RFCOMM_CHANNEL_SEND_UA_AFTER_DISC:
// remote didn't wait until we send the UA disc
break;
default:
rfcomm_emit_channel_opened(channel, RFCOMM_MULTIPLEXER_STOPPED);
break;
}
// remove from list
it->next = it->next->next;