Skip to content

Commit a118d13

Browse files
committed
fix: treat disconnect during L2capChannel::accept
1 parent ac8c26d commit a118d13

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

host/src/channel_manager.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,19 @@ 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))
205+
}
206+
_ => {
207+
info!("{}", chan.state);
202208
}
203-
_ => {}
204209
}
205210
}
206211
Poll::Pending
207212
})
208-
.await;
213+
.await?;
209214

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

0 commit comments

Comments
 (0)