From 1416c70e73d73daaa64e9309b82498d0ca58fa89 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 5 Jul 2020 18:44:33 +0300 Subject: [PATCH] net.websocket: fix building client.v --- vlib/net/websocket/events.v | 2 +- vlib/net/websocket/examples/client.v | 2 +- vlib/net/websocket/ws.v | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vlib/net/websocket/events.v b/vlib/net/websocket/events.v index f7a52c8533..08cc0700aa 100644 --- a/vlib/net/websocket/events.v +++ b/vlib/net/websocket/events.v @@ -1,6 +1,6 @@ module websocket -fn (ws &Client) send_message_event(msg Message) { +fn (ws &Client) send_message_event(msg &Message) { ws.eb.publish('on_message', ws, msg) l.d('sending on_message event') } diff --git a/vlib/net/websocket/examples/client.v b/vlib/net/websocket/examples/client.v index 7bf4a0a44d..a3449a149d 100644 --- a/vlib/net/websocket/examples/client.v +++ b/vlib/net/websocket/examples/client.v @@ -77,7 +77,7 @@ fn on_open(sender voidptr, ws &websocket.Client, x voidptr) { println('websocket opened.') } -fn on_message(sender voidptr, mut ws websocket.Client, msg websocket.Message) { +fn on_message(sender voidptr, mut ws websocket.Client, msg &websocket.Message) { println('Message recieved. Sending it back.') typ := msg.opcode if typ == .text_frame { diff --git a/vlib/net/websocket/ws.v b/vlib/net/websocket/ws.v index 124a893aab..32c51d8457 100644 --- a/vlib/net/websocket/ws.v +++ b/vlib/net/websocket/ws.v @@ -479,7 +479,7 @@ pub fn (mut ws Client) read() int { return -1 } } - message := Message{ + message := &Message{ opcode: frame.opcode payload: payload payload_len: int(payload_len)