Skip to content

Commit

Permalink
fix handshack error blocking a channel
Browse files Browse the repository at this point in the history
  • Loading branch information
soyum2222 committed Apr 22, 2021
1 parent 5d75c43 commit 51338b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion headquarters.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func Dial(addr string) (net.Conn, error) {
sn := NewSniper(conn, udpaddr)
sn.noLeader = true

c := make(chan error, 1)
c := make(chan error, 2)

go func() {

Expand Down Expand Up @@ -80,6 +80,7 @@ func Dial(addr string) (net.Conn, error) {

if ammo.Kind != protocol.SECONDHANDSHACK {
c <- errors.New("handshake package error")
return
}

c <- nil
Expand Down

0 comments on commit 51338b1

Please sign in to comment.