Skip to content

Commit 590674b

Browse files
committed
fix: handle disconnect state in L2capChannel::accept
1 parent ac8c26d commit 590674b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

host/src/channel_manager.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,17 @@ impl<'d> ChannelManager<'d> {
198198
let index = ChannelIndex(idx as u8);
199199

200200
state.inc_ref(index);
201-
return Poll::Ready((L2capChannel::new(index, self), req_id, mps, mtu, cid, available));
201+
return Poll::Ready(Ok((L2capChannel::new(index, self), req_id, mps, mtu, cid, available)));
202+
}
203+
ChannelState::Disconnected => {
204+
return Poll::Ready(Err(Error::Disconnected))
202205
}
203206
_ => {}
204207
}
205208
}
206209
Poll::Pending
207210
})
208-
.await;
211+
.await?;
209212

210213
let mut tx = [0; 18];
211214
// Respond that we accept the channel.

0 commit comments

Comments
 (0)