Fix incorrect handling of messages array. Closes #1287
This commit is contained in:
parent
cb7a9b89ea
commit
12cbe529de
@ -71,7 +71,7 @@ func (s *ChatServer) Addclient(conn *websocket.Conn, user *user.User, accessToke
|
||||
User: user,
|
||||
ipAddress: conn.RemoteAddr().String(),
|
||||
accessToken: accessToken,
|
||||
send: make(chan []byte, maxMessageSize),
|
||||
send: make(chan []byte, 256),
|
||||
UserAgent: userAgent,
|
||||
ConnectedAt: time.Now(),
|
||||
}
|
||||
|
@ -158,9 +158,9 @@ export default class Websocket {
|
||||
var messages = e.data.split('\n');
|
||||
for (var i = 0; i < messages.length; i++) {
|
||||
try {
|
||||
var model = JSON.parse(e.data);
|
||||
var model = JSON.parse(messages[i]);
|
||||
} catch (e) {
|
||||
// console.log(e, e.data);
|
||||
console.error(e, e.data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user