Software / code / prosody
Comparison
net/websocket/frames.lua @ 10411:db2a06b9ff98
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 16 Nov 2019 16:52:31 +0100 |
| parent | 10241:48f7cda4174d |
| child | 11114:6a608ecb3471 |
comparison
equal
deleted
inserted
replaced
| 10410:659b577f280c | 10411:db2a06b9ff98 |
|---|---|
| 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; |
| 18 local unpack = table.unpack or unpack; -- luacheck: ignore 113 | |
| 19 | 19 |
| 20 local t_concat = table.concat; | 20 local t_concat = table.concat; |
| 21 local s_byte = string.byte; | 21 local s_byte = string.byte; |
| 22 local s_char= string.char; | 22 local s_char= string.char; |
| 23 local s_sub = string.sub; | 23 local s_sub = string.sub; |
| 24 local s_pack = string.pack; -- luacheck: ignore 143 | 24 local s_pack = string.pack; |
| 25 local s_unpack = string.unpack; -- luacheck: ignore 143 | 25 local s_unpack = string.unpack; |
| 26 | 26 |
| 27 if not s_pack and softreq"struct" then | 27 if not s_pack and softreq"struct" then |
| 28 s_pack = softreq"struct".pack; | 28 s_pack = softreq"struct".pack; |
| 29 s_unpack = softreq"struct".unpack; | 29 s_unpack = softreq"struct".unpack; |
| 30 end | 30 end |