Skip to content

Commit

Permalink
Fix potential race condition when sending close packet have error
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <[email protected]>
  • Loading branch information
yilunzhang committed Jul 12, 2020
1 parent 844c061 commit 711a2d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ func (session *Session) sendClosePacket() error {
wg.Add(1)
go func(connection *Connection) {
defer wg.Done()
err = session.sendWith(connection.localClientID, connection.remoteClientID, buf, connection.RetransmissionTimeout())
err := session.sendWith(connection.localClientID, connection.remoteClientID, buf, connection.RetransmissionTimeout())
if err == nil {
select {
case success <- struct{}{}:
Expand Down

0 comments on commit 711a2d0

Please sign in to comment.