From 711a2d093300f5fc46ffbb3bceae8372efdffdb9 Mon Sep 17 00:00:00 2001 From: Yilun Date: Sun, 12 Jul 2020 03:43:42 -0700 Subject: [PATCH] Fix potential race condition when sending close packet have error Signed-off-by: Yilun --- session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session.go b/session.go index b69b7d4..f533cd8 100644 --- a/session.go +++ b/session.go @@ -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{}{}: