Kim Alvefur
ece896d253
net.websocket.frames: Replace bit fiddling code with util.struct
...
Fallback code for not having either the string.pack and string.unpack
functions available in Lua 5.4 or the struct lib is no longer needed
since the struct lib was imported as util.struct in 3ce3633527af
4 years ago
Kim Alvefur
6ac58a4d1c
net.websocket.frames: Remove completed TODO
...
The XOR is done in C since 4e5a2af9dd19
2 years ago
Kim Alvefur
869581384d
net: Prefix module imports with prosody namespace
3 years ago
Kim Alvefur
00bad1a9fe
net.websocket.frames: Use C string XOR implementation
5 years ago
Kim Alvefur
fb63187afc
net.websocket.frames: Read buffer length correctly in Lua 5.1 ( fix #1598 )
...
COMPAT: The __len metamethod does not work with tables in Lua 5.1.
Both strings and util.dbuffer now expose their length as a :len()
method.
5 years ago
Matthew Wild
a0fb8d876f
net.websocket.frames: Additionally return partial frame if there is one
5 years ago
Matthew Wild
5a1c206ece
mod_websocket: Switch partial frame buffering to util.dbuffer
...
This improves performance and enforces stanza size limits earlier
in the pipeline.
5 years ago
Matthew Wild
3989ff2ddc
net.websocket.frames: Allow all methods to work on non-string objects
...
Instead of using the string library, use methods from the passed object,
which are assumed to be equivalent.
This provides compatibility with objects from util.ringbuffer and
util.dbuffer, for example.
5 years ago
Kim Alvefur
3dcfc5ee71
util.bitops: Library to find appropriate bitwise library ( closes #1395 )
7 years ago
Kim Alvefur
3ec060fc0c
Fix spelling throughout the codebase [codespell]
8 years ago
Kim Alvefur
6f1b772ce0
net.websocket.frames: Ignore Lua 5.3-only fields [luacheck]
8 years ago
Matthew Wild
8967760df5
net.websocket.frames, util.datetime, util.json, util.prosodyctl, util.rfc6724: Remove unused variables [luacheck]
10 years ago
Kim Alvefur
b75d87f63d
net.websocket.frames: Fix syntax error due to code copy pasting
10 years ago
Kim Alvefur
0ce785a39c
net.websocket.frames: Use struct packing in Lua 5.3 or struct lib if available
10 years ago
Kim Alvefur
2efcb9f82f
net.websocket.frames: Pack and unpack 64bit ints without overflows (lua-bitop/bit32 are 32bit)
10 years ago
Kim Alvefur
5d941b553a
net.websocket.frames: Link to documentation when bitop is missing
10 years ago
Kim Alvefur
fc34f3fdbf
net.websocket.frames: Throw an error if no bit lib is found
10 years ago
Kim Alvefur
49fccb11b2
net.websocket.frames: Simplify import of bitlib
10 years ago
Florian Zeitz
0504583316
net.websocket: Make data masking configurable
11 years ago
daurnimator
50bcb0a559
net/websocket: Add new websocket client code
11 years ago
daurnimator
143508d675
net/websocket: Add new websocket client code
11 years ago
Kim Alvefur
5a608450d5
lint: Remove use of the 143 error code
...
Does not appear to be invoked by anything
7 years ago
Kim Alvefur
2b289f34f9
various: Don't rely on _G.unpack existing
7 years ago
Kim Alvefur
874cf01e2b
net.websocket.frames: Prefer Lua 5.2 built-in bit module over LuaJIT version
...
When running on Lua 5.2 this makes sense since bit32 is usually already
loaded. It's sensible to prefer this going forward in case of
incompatibilities between the two variants.
7 years ago