Commit c8fd5401 authored by Michael Panzer's avatar Michael Panzer Committed by Kevin
Browse files

Fix deadlock on writing connection to master chan (#10)

parent 4f0cfa41
...@@ -442,7 +442,11 @@ func (h *HCI) handleLEConnectionComplete(b []byte) error { ...@@ -442,7 +442,11 @@ func (h *HCI) handleLEConnectionComplete(b []byte) error {
h.muConns.Unlock() h.muConns.Unlock()
if e.Role() == roleMaster { if e.Role() == roleMaster {
if e.Status() == 0x00 { if e.Status() == 0x00 {
h.chMasterConn <- c select {
case h.chMasterConn <- c:
default:
go c.Close()
}
return nil return nil
} }
if ErrCommand(e.Status()) == ErrConnID { if ErrCommand(e.Status()) == ErrConnID {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment