From 37f0edd3a517b1bd9b3144848b143c954d54e3c1 Mon Sep 17 00:00:00 2001 From: Pontus Stenetorp Date: Wed, 1 Jul 2015 14:50:28 +0100 Subject: [PATCH 1/2] Int to Bool conversion compatible with v0.4 --- src/WebSockets.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/WebSockets.jl b/src/WebSockets.jl index e8c5299..9bcd20a 100644 --- a/src/WebSockets.jl +++ b/src/WebSockets.jl @@ -163,12 +163,12 @@ function WebSocketFragment( ,data::Vector{Uint8}) WebSocketFragment( - bool(fin) - , bool(rsv1) - , bool(rsv2) - , bool(rsv3) + fin != 0 + , rsv1 != 0 + , rsv2 != 0 + , rsv3 != 0 , opcode - , bool(masked) + , masked != 0 , payload_len , maskkey , data) From ed53b31cd83427e0ed1b4e1f7e3ff6d340be8f10 Mon Sep 17 00:00:00 2001 From: Pontus Stenetorp Date: Wed, 1 Jul 2015 15:01:08 +0100 Subject: [PATCH 2/2] Replace UInt* constructors with `convert` for v0.4 --- src/WebSockets.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/WebSockets.jl b/src/WebSockets.jl index 9bcd20a..c6139c4 100644 --- a/src/WebSockets.jl +++ b/src/WebSockets.jl @@ -71,17 +71,17 @@ function send_fragment(ws::WebSocket, islast::Bool, data::Array{Uint8}, opcode=0 b1::Uint8 = (islast ? 0b1000_0000 : 0b0000_0000) | opcode if l <= 125 write(ws.socket,b1) - write(ws.socket,uint8(l)) + write(ws.socket,convert(Uint8,l)) write(ws.socket,data) elseif l <= typemax(Uint16) write(ws.socket,b1) - write(ws.socket,uint8(126)) - write(ws.socket,hton(uint16(l))) + write(ws.socket,convert(Uint8,126)) + write(ws.socket,hton(convert(Uint16,l))) write(ws.socket,data) elseif l <= typemax(Uint64) write(ws.socket,b1) - write(ws.socket,uint8(127)) - write(ws.socket,hton(uint64(l))) + write(ws.socket,convert(Uint8,127)) + write(ws.socket,hton(convert(Uint64,l))) write(ws.socket,data) else error("Attempted to send too much data for one websocket fragment\n")