Mercurial > prosody-hg
comparison net/websocket/frames.lua @ 11200:bf8f2da84007
Merge 0.11->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 05 Nov 2020 22:31:25 +0100 |
| parents | 51e5149ed0ad |
| children | 2d3080d02960 |
comparison
equal
deleted
inserted
replaced
| 11199:6c7c50a4de32 | 11200:bf8f2da84007 |
|---|---|
| 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 lshift = bit.lshift; | 15 local lshift = bit.lshift; |
| 17 local rshift = bit.rshift; | 16 local rshift = bit.rshift; |
| 18 local sbit = require "util.strbitop"; | 17 local sbit = require "util.strbitop"; |
| 19 local sxor = sbit.sxor; | 18 local sxor = sbit.sxor; |
| 20 | 19 |
| 21 local s_char= string.char; | 20 local s_char= string.char; |
| 22 local s_pack = string.pack; -- luacheck: ignore 143 | 21 local s_pack = string.pack; |
| 23 local s_unpack = string.unpack; -- luacheck: ignore 143 | 22 local s_unpack = string.unpack; |
| 24 | 23 |
| 25 if not s_pack and softreq"struct" then | 24 if not s_pack and softreq"struct" then |
| 26 s_pack = softreq"struct".pack; | 25 s_pack = softreq"struct".pack; |
| 27 s_unpack = softreq"struct".unpack; | 26 s_unpack = softreq"struct".unpack; |
| 28 end | 27 end |
