1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

net.websocket: fix a typo (allready -> already) ()

This commit is contained in:
Wertzui123 2023-03-06 09:05:17 +01:00 committed by GitHub
parent 7de3485bd2
commit 77b6bc1c1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions
vlib/net/websocket

View File

@ -40,7 +40,7 @@ fn (mut ws Client) socket_read_ptr(buf_ptr &u8, len int) !int {
fn (mut ws Client) socket_write(bytes []u8) !int {
lock {
if ws.state == .closed || ws.conn.sock.handle <= 1 {
ws.debug_log('socket_write: Socket allready closed')
ws.debug_log('socket_write: Socket already closed')
return error('socket_write: trying to write on a closed socket')
}
if ws.is_ssl {

View File

@ -330,8 +330,8 @@ pub fn (mut ws Client) write_string(str string) !int {
pub fn (mut ws Client) close(code int, message string) ! {
ws.debug_log('sending close, ${code}, ${message}')
if ws.state in [.closed, .closing] || ws.conn.sock.handle <= 1 {
ws.debug_log('close: Websocket allready closed (${ws.state}), ${message}, ${code} handle(${ws.conn.sock.handle})')
err_msg := 'Socket allready closed: ${code}'
ws.debug_log('close: Websocket already closed (${ws.state}), ${message}, ${code} handle(${ws.conn.sock.handle})')
err_msg := 'Socket already closed: ${code}'
return error(err_msg)
}
defer {