Matthew Wild <mwild1@gmail.com> [Thu, 17 Sep 2020 13:00:19 +0100] rev 11110
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.
Kim Alvefur <zash@zash.se> [Mon, 24 Aug 2020 17:28:48 +0200] rev 11109
util.dbuffer: Simplify test case
An earlier theory involved the bug being related to collapsing multiple
items, so it exercised that too.
Also correct the comment, it referred to the space in "hello world" in
an earlier version before the test string was changed to "foobar", which
was what was tested in a REPL
Matthew Wild <mwild1@gmail.com> [Mon, 24 Aug 2020 16:18:13 +0100] rev 11108
util.dbuffer: Fix :sub() not working with partially-consumed chunks (thanks Zash for test case)
This also appears to fix some bugs with chunk-encoded streams in net.http.parser.
Matthew Wild <mwild1@gmail.com> [Fri, 26 Jun 2020 16:41:31 +0100] rev 11107
util.dbuffer: dynamic string buffer
Similar to util.ringbuffer (and shares almost identical API). Differences:
- size limit is optional and dynamic
- does not allocate a fixed buffer of max_size bytes
- focus on simply storing references to existing string objects where possible,
avoiding unnecessary allocations
- references are still stored in a ring buffer to enable use as a fast FIFO
Optional second parameter to new() provides the number of ring buffer segments. On
Lua 5.2 on my laptop, a segment is ~19 bytes. If the ring buffer fills up, the next
write will compact all strings into a single item.
Kim Alvefur <zash@zash.se> [Mon, 28 Sep 2020 23:48:02 +0200] rev 11106
util.error: Drop registry initialization with namespace as key
Enough complexity with compact vs normal and with/without namespace
Kim Alvefur <zash@zash.se> [Mon, 28 Sep 2020 22:13:04 +0200] rev 11105
util.error: Expand compact registries into normal form internally
Also the exposed form on the table returned from init()
Kim Alvefur <zash@zash.se> [Mon, 28 Sep 2020 18:39:51 +0200] rev 11104
util.error: Add a "compact mode" for registries
Inspired by the older registry in pubsub.lib.lua
Kim Alvefur <zash@zash.se> [Mon, 28 Sep 2020 19:32:54 +0200] rev 11103
CHANGES: Add util.error
Kim Alvefur <zash@zash.se> [Mon, 28 Sep 2020 19:26:48 +0200] rev 11102
util.error: Expose source and registry as fields on the registry object
For access, e.g. to identify and compare errors later
Kim Alvefur <zash@zash.se> [Mon, 28 Sep 2020 18:36:00 +0200] rev 11101
util.error: Cover registry initialization in test