mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
in websocket data copying code, wait for other goroutine to stop before changing the connection
found while running tests
This commit is contained in:
parent
459317097b
commit
afefadf2c0
1 changed files with 1 additions and 1 deletions
|
@ -634,10 +634,10 @@ func forwardWebsocket(h *config.WebForward, w http.ResponseWriter, r *http.Reque
|
||||||
// Close connections so other goroutine stops as well.
|
// Close connections so other goroutine stops as well.
|
||||||
cconn.Close()
|
cconn.Close()
|
||||||
beconn.Close()
|
beconn.Close()
|
||||||
cconn = nil
|
|
||||||
// Wait for goroutine so it has updated the logWriter.Size*Client fields before we
|
// Wait for goroutine so it has updated the logWriter.Size*Client fields before we
|
||||||
// continue with logging.
|
// continue with logging.
|
||||||
<-errc
|
<-errc
|
||||||
|
cconn = nil
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue