mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
x.websocket: workaround for _, item in a_map{}
bug, causing panic (#8463)
This commit is contained in:
parent
5746ac4dd4
commit
7eb7d042ec
@ -26,8 +26,9 @@ fn start_server() ? {
|
||||
|
||||
// on_message_ref, broadcast all incoming messages to all clients except the one sent it
|
||||
s.on_message_ref(fn (mut ws websocket.Client, msg &websocket.Message, mut m websocket.Server) ? {
|
||||
for _, cli in m.clients {
|
||||
mut c := cli
|
||||
// for _, cli in m.clients {
|
||||
for i, _ in m.clients {
|
||||
mut c := m.clients[i]
|
||||
if c.client.state == .open && c.client.id != ws.id {
|
||||
c.client.write(msg.payload, websocket.OPCode.text_frame) or {
|
||||
panic(err)
|
||||
|
Loading…
Reference in New Issue
Block a user