# HG changeset patch # User daurnimator # Date 1412013556 14400 # Node ID a8d9d3eea6f4b811a749caf24b8964fd7cbcf0fd # Parent 6842b07fc7bca6c48c3dec3f3d40e12f60f5e9fc# Parent b6514e691a70bc417980ec81f94a56567467332c Merge 0.10->trunk diff -r 6842b07fc7bc -r a8d9d3eea6f4 net/websocket.lua --- a/net/websocket.lua Fri Sep 26 17:44:14 2014 -0400 +++ b/net/websocket.lua Mon Sep 29 13:59:16 2014 -0400 @@ -134,7 +134,7 @@ log("debug", "closing WebSocket with code %i: %s" , code , tostring(reason)); self.readyState = 2; local handler = self.handler; - handler:write(frames.build_close(code, reason)); + handler:write(frames.build_close(code, reason, true)); -- Do not close socket straight away, wait for acknowledgement from server. self.close_timer = timer.add_task(close_timeout, close_timeout_cb, self); elseif self.readyState == 2 then diff -r 6842b07fc7bc -r a8d9d3eea6f4 net/websocket/frames.lua --- a/net/websocket/frames.lua Fri Sep 26 17:44:14 2014 -0400 +++ b/net/websocket/frames.lua Mon Sep 29 13:59:16 2014 -0400 @@ -171,7 +171,7 @@ return code, message end -local function build_close(code, message) +local function build_close(code, message, mask) local data = pack_uint16be(code); if message then assert(#message<=123, "Close reason must be <=123 bytes"); @@ -180,7 +180,7 @@ return build_frame({ opcode = 0x8; FIN = true; - MASK = true; + MASK = mask; data = data; }); end