Исправлена гонка записи в сокет
This commit is contained in:
@@ -81,12 +81,12 @@ func processData(data <-chan []byte, connection *connection.Connection) {
|
||||
response.Put(0x01)
|
||||
response.Flip()
|
||||
// Отправляем ответ клиенту
|
||||
connection.Socket.WriteMessage(websocket.BinaryMessage, response.Bytes())
|
||||
connection.WriteBinary(response.Bytes())
|
||||
continue
|
||||
}
|
||||
connection.Socket.WriteMessage(websocket.BinaryMessage, []byte{0xFF})
|
||||
connection.WriteBinary([]byte{0xFF})
|
||||
logger.LogWarnMessage("failed handshake from " + connection.Socket.RemoteAddr().String() + " because of invalid secret key")
|
||||
connection.Socket.Close()
|
||||
connection.Close()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ func processData(data <-chan []byte, connection *connection.Connection) {
|
||||
response.PutBytes([]byte(room.RoomID))
|
||||
response.Flip()
|
||||
// Отправляем ответ клиенту
|
||||
connection.Socket.WriteMessage(websocket.BinaryMessage, response.Bytes())
|
||||
connection.WriteBinary(response.Bytes())
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ func processData(data <-chan []byte, connection *connection.Connection) {
|
||||
response.PutBytes(answerBytes)
|
||||
response.Flip()
|
||||
// Отправляем ответ клиенту
|
||||
connection.Socket.WriteMessage(websocket.BinaryMessage, response.Bytes())
|
||||
connection.WriteBinary(response.Bytes())
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user