in websocket data copying code, wait for other goroutine to stop before changing the connection

found while running tests
This commit is contained in:
Mechiel Lukkien 2023-06-24 00:14:14 +02:00
parent 459317097b
commit afefadf2c0
No known key found for this signature in database

View file

@ -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
} }