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; rfcomm_channel_t * channel = (rfcomm_channel_t *) it->next;
if (channel->multiplexer == multiplexer) { if (channel->multiplexer == multiplexer) {
// emit appropriate events // emit appropriate events
if (channel->state == RFCOMM_CHANNEL_OPEN) { switch(channel->state){
rfcomm_emit_channel_closed(channel); case RFCOMM_CHANNEL_OPEN:
} else { rfcomm_emit_channel_closed(channel);
rfcomm_emit_channel_opened(channel, RFCOMM_MULTIPLEXER_STOPPED); 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 // remove from list
it->next = it->next->next; it->next = it->next->next;