Software /
code /
prosody
Comparison
net/websocket/frames.lua @ 6900:44a7e9152b9a
net.websocket.frames: Fix syntax error due to code copy pasting
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 06 Oct 2015 18:08:58 +0200 |
parent | 6899:5f3da8b00b9b |
child | 7259:d8300985f2bb |
comparison
equal
deleted
inserted
replaced
6899:5f3da8b00b9b | 6900:44a7e9152b9a |
---|---|
47 local function get_byte(x, n) | 47 local function get_byte(x, n) |
48 return band(rshift(x, n), 0xFF); | 48 return band(rshift(x, n), 0xFF); |
49 end | 49 end |
50 local function pack_uint64be(x) | 50 local function pack_uint64be(x) |
51 local h = band(x / 2^32, 2^32-1); | 51 local h = band(x / 2^32, 2^32-1); |
52 return s_char(get_byte(h, 24), get_byte(h, 16), get_byte(h, 8), band(h, 0xFF)); | 52 return s_char(get_byte(h, 24), get_byte(h, 16), get_byte(h, 8), band(h, 0xFF), |
53 get_byte(x, 24), get_byte(x, 16), get_byte(x, 8), band(x, 0xFF); | 53 get_byte(x, 24), get_byte(x, 16), get_byte(x, 8), band(x, 0xFF)); |
54 end | 54 end |
55 | 55 |
56 if s_pack then | 56 if s_pack then |
57 function pack_uint16be(x) | 57 function pack_uint16be(x) |
58 return s_pack(">I2", x); | 58 return s_pack(">I2", x); |