Verified Commit aa1b54f3 authored by Camil Staps's avatar Camil Staps 🚀

Fix encoding of websocket messages of exactly 125 bytes (reported in #347)

parent f9f21a17
Pipeline #30788 passed with stage
in 5 minutes and 52 seconds
......@@ -116,7 +116,7 @@ wsockPongMsg payload = wsockControlFrame WS_OP_PONG payload
wsockMsgFrame :: !Int !Bool !String -> String
wsockMsgFrame opcode final payload
| num_bytes < 125 = frame num_bytes "" payload
| num_bytes <= 125 = frame num_bytes "" payload
| num_bytes < 65536 = frame 126 {toChar (num_bytes >> (8*i)) \\ i <- [1,0]} payload
| otherwise = IF_INT_64_OR_32
(frame 127 {toChar (num_bytes >> (8*i)) \\ i <- [7,6,5,4,3,2,1,0]} payload)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment