Software /
code /
prosody
Comparison
net/websocket/frames.lua @ 11120:b2331f3dfeea
Merge 0.11->trunk
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 30 Sep 2020 09:50:33 +0100 |
parent | 11114:6a608ecb3471 |
child | 11158:3a72cb126d6c |
comparison
equal
deleted
inserted
replaced
11119:68df52bf08d5 | 11120:b2331f3dfeea |
---|---|
7 -- | 7 -- |
8 | 8 |
9 local softreq = require "util.dependencies".softreq; | 9 local softreq = require "util.dependencies".softreq; |
10 local random_bytes = require "util.random".bytes; | 10 local random_bytes = require "util.random".bytes; |
11 | 11 |
12 local bit = assert(softreq"bit" or softreq"bit32", | 12 local bit = require "util.bitcompat"; |
13 "No bit module found. See https://prosody.im/doc/depends#bitop"); | |
14 local band = bit.band; | 13 local band = bit.band; |
15 local bor = bit.bor; | 14 local bor = bit.bor; |
16 local bxor = bit.bxor; | 15 local bxor = bit.bxor; |
17 local lshift = bit.lshift; | 16 local lshift = bit.lshift; |
18 local rshift = bit.rshift; | 17 local rshift = bit.rshift; |
19 local unpack = table.unpack or unpack; -- luacheck: ignore 113 | 18 local unpack = table.unpack or unpack; -- luacheck: ignore 113 |
20 | 19 |
21 local t_concat = table.concat; | 20 local t_concat = table.concat; |
22 local s_char= string.char; | 21 local s_char= string.char; |
23 local s_pack = string.pack; -- luacheck: ignore 143 | 22 local s_pack = string.pack; |
24 local s_unpack = string.unpack; -- luacheck: ignore 143 | 23 local s_unpack = string.unpack; |
25 | 24 |
26 if not s_pack and softreq"struct" then | 25 if not s_pack and softreq"struct" then |
27 s_pack = softreq"struct".pack; | 26 s_pack = softreq"struct".pack; |
28 s_unpack = softreq"struct".unpack; | 27 s_unpack = softreq"struct".unpack; |
29 end | 28 end |