aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* net.server_epoll: Ensure timers can't run more than once per tickKim Alvefur2021-01-081-2/+18
| | | | | | | | This makes sure that a timer that returns 0 (or less) does not prevent runtimers() from completing, as well as making sure a timer added with zero timeout from within a timer does not run until the next tick. Thanks tmolitor
* util.stanza: Move misplaced argument to correct placeKim Alvefur2020-12-241-2/+2
| | | | | valid_utf8() takes only one argument, so the false was probably meant to be valid_xml_cdata(text, attribute=false)
* mod_s2s: Fix copypaste mistake in b3ae48362f78Kim Alvefur2020-12-161-1/+1
| | | | | Directly sending something over s2s needs to use sends2s() but the code copied from mod_c2s had .send()
* MUC: Fix logic bug causing unnecessary presence to be sent, fixes #1615 ↵Matthew Wild2020-12-151-2/+2
| | | | (thanks damencho)
* mod_s2s: Prevent whitespace keepalives the stream has been openedKim Alvefur2020-12-101-1/+4
| | | | | | | | | This will result in the stream timing out instead, which is probably correct if the stream has not been opened yet. This was already done for c2s in e69df8093387 Thanks Ge0rG
* mod_saslauth: Only advertise channel binding if a finished message is availableKim Alvefur2020-11-231-1/+1
| | | | In some cases this method returns nothing, unclear why.
* mod_saslauth: Disable 'tls-unique' channel binding with TLS 1.3 (closes #1542)Kim Alvefur2020-11-231-1/+4
| | | | | | | | The 'tls-unique' channel binding is undefined in TLS 1.3 according to a single sentence in parenthesis in Apendix C of RFC 8446 This may trigger downgrade protection in clients that were expecting channel binding to be available.
* util.promise: Use xpcall() for promise function to preserve tracebacksMatthew Wild2020-11-231-1/+1
|
* util.stanza: Reject ASCII control characters (fixes #1606)Kim Alvefur2020-11-112-1/+10
|
* mod_pubsub: Fix notification stanza type setting (fixes #1605)Kim Alvefur2020-11-061-1/+1
|
* mod_pubsub: Lower priority of default <body> generatorKim Alvefur2020-11-051-1/+1
| | | | | | | in order to avoid conflict with a handler at the default (0) priority, making it easier to write your own formatting in plugins. this follows the common pattern of default modules having lower priority
* util.dbuffer: Optimize :sub() and :byte()Matthew Wild2020-10-281-4/+26
|
* util.debug: Fix locals being reported under wrong stack frame in some cases ↵Matthew Wild2020-10-162-1/+94
| | | | (+tests!!)
* Back out changeset 2c1583bb0e0fKim Alvefur2020-10-151-0/+4
| | | | Same reason as 712b2e6a09d9
* Back out 6dde2c9fa272: Doesn't work on Lua 5.1Kim Alvefur2020-10-151-13/+6
|
* util.strbitop: Remove redundant init functionKim Alvefur2020-10-151-4/+0
| | | | | When you have 3 almost identical functions, you tend to edit one and then copypaste. Forgot to remove this line from the other two.
* util.strbitop: Create buffer in the correct size (optimization)Kim Alvefur2020-10-151-6/+13
| | | | | This avoids dynamically growing the buffer as Lua does when luaL_addchar is used, thus saving on realloc calls.
* util.strbitop: Add tests covering basicsKim Alvefur2020-10-151-0/+41
| | | | Also as docs
* util.strbitop: Reformat codeKim Alvefur2020-10-151-9/+9
| | | | | | | | | | | | | | astyle \ --indent=tab \ --attach-classes \ --indent-switches \ --break-blocks \ --pad-oper \ --unpad-paren \ --add-braces \ --align-pointer=name \ --lineend=linux \ *.c
* net.websocket.frames: Add test for empty frame with MASK and key setMatthew Wild2020-10-151-0/+10
|
* net.websocket.frames: Use C string XOR implementationKim Alvefur2020-10-142-24/+8
|
* util.strbitop: Library for bitwise operations on stringsKim Alvefur2019-09-073-2/+93
|
* net.websocket.frames: Add small test covering xor-maskingKim Alvefur2020-10-141-0/+13
| | | | This is basically a recording of current behavior, to detect changes.
* net.http.server: Don't send Content-Length on 1xx/204 responses, per RFC ↵Matthew Wild2020-10-131-1/+4
| | | | (fixes #1596)
* net.websocket.frames: Read buffer length correctly in Lua 5.1 (fix #1598)Kim Alvefur2020-10-121-3/+3
| | | | | | | 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.
* util.dbuffer: Expose length as :len() method, like stringsKim Alvefur2020-10-122-0/+2
| | | | Ref #1598
* MUC: Preserve disco 'node' attribute (or lack thereof) in response (fix ↵Kim Alvefur2020-10-071-2/+2
| | | | #1595) (thanks lessthan3)
* util.dependencies: Check for bitop library same way as net.websocket.frames ↵Kim Alvefur2020-10-051-1/+1
| | | | (fixes #1594)
* MUC: Correct advertising of subject write access (really fixes #1155)Kim Alvefur2020-10-041-2/+2
| | | | | | | | | | Thanks pep. and lovetox XEP-0045 §6.4: > any field defined for the muc\#roomconfig FORM_TYPE can be included in > the extended service discovery fields Probably happened because the same mistake is in #1155
* mod_bosh: Ensure that stream is directed to a VirtualHost (fixes #425)Kim Alvefur2020-10-031-0/+16
|
* mod_bosh: Pick out the 'wait' before checking it instead of earlierKim Alvefur2020-10-031-1/+2
| | | | | Going to add more host related checks, so to keep the wait variable closer to the related checks
* Added tag 0.11.7 for changeset ece430d49809Matthew Wild2020-10-010-0/+0
|
* mod_c2s,mod_s2s: Make stanza size limits configurablevault/0.11.7Kim Alvefur2020-05-312-2/+4
|
* MergeMatthew Wild2020-09-305-85/+434
|\
| * mod_websocket: Refactor frame validity checking, also check ↵Matthew Wild2020-09-291-77/+95
| | | | | | | | partially-received frames against constraints
| * net.websocket.frames: Additionally return partial frame if there is oneMatthew Wild2020-09-291-1/+1
| |
| * mod_websocket: Continue to process data already in the buffer after an error ↵Matthew Wild2020-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | occurs Previously any error, or even a normal websocket close frame, would return early, leaving potentially entire frames in the buffer unprocessed and then discarded. This change stops processing new data, but returns an existing processed data up to the point of the error/close.
| * mod_websocket: Enforce stanza size limit and close streamMatthew Wild2020-09-171-0/+4
| |
| * mod_websocket: Add separate limit for frame buffer sizeMatthew Wild2020-09-171-2/+2
| |
| * mod_websocket: handle full frame buffer and raise stream errorMatthew Wild2020-09-171-1/+5
| |
| * mod_websocket: Switch partial frame buffering to util.dbufferMatthew Wild2020-09-172-5/+10
| | | | | | | | | | This improves performance and enforces stanza size limits earlier in the pipeline.
| * net.websocket.frames: Allow all methods to work on non-string objectsMatthew Wild2020-09-171-10/+15
| | | | | | | | | | | | | | | | 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.
| * util.dbuffer: Simplify test caseKim Alvefur2020-08-241-0/+130
| | | | | | | | | | | | | | | | | | 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
| * util.dbuffer: Fix :sub() not working with partially-consumed chunks (thanks ↵Matthew Wild2020-08-241-0/+176
| | | | | | | | | | | | Zash for test case) This also appears to fix some bugs with chunk-encoded streams in net.http.parser.
| * util.dbuffer: dynamic string bufferMatthew Wild2020-06-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | util.indexedbheap: Fix heap datastructure corruption in ↵Waqas Hussain2020-09-292-1/+34
|/ | | | :reschedule(smaller_value)
* util.startup: Configure the GC on startup, using the config or built-in defaultsMatthew Wild2020-06-151-0/+17
|
* util.gc: Linter fixes [luacheck]Matthew Wild2020-06-151-2/+1
|
* util.gc: New module for configuring the Lua garbage collectorMatthew Wild2020-06-151-0/+50
|
* net.http: Add feature discovery (currently just contains SNI)Matthew Wild2020-09-151-0/+3
|