mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-17 02:16:54 +00:00
Attempt to fix locking issue
This commit is contained in:
parent
db486e4eba
commit
7b095542fc
3 changed files with 11 additions and 2 deletions
|
@ -152,6 +152,7 @@ func HandleSocketConnection(conn *websocket.Conn) {
|
|||
var client ClientInfo
|
||||
client.MessageChannel = _serverMessageChan
|
||||
client.RemoteAddr = conn.RemoteAddr()
|
||||
client.MsgChannelIsDone = stoppedChan
|
||||
|
||||
// Launch receiver goroutine
|
||||
go func(errorChan chan<- error, clientChan chan<- ClientMessage, stoppedChan <-chan struct{}) {
|
||||
|
@ -186,7 +187,10 @@ func HandleSocketConnection(conn *websocket.Conn) {
|
|||
if err != io.EOF && !isClose {
|
||||
log.Println("Error while reading from client:", err)
|
||||
}
|
||||
errorChan <- err
|
||||
select {
|
||||
case errorChan <- err:
|
||||
case <-stoppedChan:
|
||||
}
|
||||
close(errorChan)
|
||||
close(clientChan)
|
||||
// exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue