Comparison

net/websocket.lua @ 10113:66a9bc2d5c8d

net.websocket: Fix log call to pass data via format string instead of concatenation
author Kim Alvefur <zash@zash.se>
date Tue, 30 Jul 2019 02:35:28 +0200
parent 10112:b327f2870382
child 10453:926d6086a95a
comparison
equal deleted inserted replaced
10112:b327f2870382 10113:66a9bc2d5c8d
111 elseif frame.opcode == 0x9 then -- Ping frame 111 elseif frame.opcode == 0x9 then -- Ping frame
112 frame.opcode = 0xA; 112 frame.opcode = 0xA;
113 frame.MASK = true; -- RFC 6455 6.1.5: If the data is being sent by the client, the frame(s) MUST be masked 113 frame.MASK = true; -- RFC 6455 6.1.5: If the data is being sent by the client, the frame(s) MUST be masked
114 conn:write(frames.build(frame)); 114 conn:write(frames.build(frame));
115 elseif frame.opcode == 0xA then -- Pong frame 115 elseif frame.opcode == 0xA then -- Pong frame
116 log("debug", "Received unexpected pong frame: " .. tostring(frame.data)); 116 log("debug", "Received unexpected pong frame: %s", frame.data);
117 else 117 else
118 return fail(s, 1002, "Reserved opcode"); 118 return fail(s, 1002, "Reserved opcode");
119 end 119 end
120 end 120 end
121 end 121 end