Skip to content

Commit

Permalink
change succ/fail chan length to 1
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <[email protected]>
  • Loading branch information
yilunzhang committed Feb 24, 2022
1 parent f5c953f commit 206abfb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,8 @@ func (session *Session) sendHandshakePacket(writeTimeout time.Duration) error {
var wg sync.WaitGroup
var lock sync.Mutex
var errMsg []string
success := make(chan struct{})
fail := make(chan struct{})
success := make(chan struct{}, 1)
fail := make(chan struct{}, 1)
if len(session.connections) > 0 {
for _, connection := range session.connections {
wg.Add(1)
Expand Down Expand Up @@ -571,8 +571,8 @@ func (session *Session) sendClosePacket() error {
var wg sync.WaitGroup
var lock sync.Mutex
var errMsg []string
success := make(chan struct{})
fail := make(chan struct{})
success := make(chan struct{}, 1)
fail := make(chan struct{}, 1)
for _, connection := range session.connections {
wg.Add(1)
go func(connection *Connection) {
Expand Down

0 comments on commit 206abfb

Please sign in to comment.