Matthew Wild
bc402b6409
net.http.parser: Expose 'partial', 'chunked' and 'body_length' on packets
5 years ago
Kim Alvefur
5b33f834fa
util.paths: Optimize path joining with few arguments
...
A casual search suggests that the majority of paths.join() calls involve
only two arguments. This saves the creation of a table for up to 3
arguments.
Looks like 3x faster for 3 arguments or less, 5% slower when it uses the
array to concatenate.
5 years ago
Kim Alvefur
c812a98068
util_paths_spec: Trim trailing white space
...
And add spacing between describe() blocks
5 years ago
Kim Alvefur
fce45aff34
util.paths: Add some tests
5 years ago
Kim Alvefur
6b306e3313
MUC: Remove XEP-0091: Legacy Delayed Delivery
...
Why do we still include this? Deprecated in 2007, obsoleted in 2009.
Removes redundant timestamp that nobody should be looking at since many
years and a redundant copy of the room JID.
5 years ago
Matthew Wild
8f059290a7
mod_posix: Hook and fire events on SIGUSR1/2
5 years ago
Matthew Wild
2cd0521696
Merge 0.11->trunk
5 years ago
Matthew Wild
a095a0c533
util.debug: Fix locals being reported under wrong stack frame in some cases (+tests!!)
5 years ago
Kim Alvefur
eefbd36485
Merge 0.11->trunk
5 years ago
Kim Alvefur
20fc0c9c15
Back out changeset 2c1583bb0e0f
...
Same reason as 712b2e6a09d9
5 years ago
Kim Alvefur
bad47be8f9
Back out 6dde2c9fa272: Doesn't work on Lua 5.1
5 years ago
Kim Alvefur
9b8a54345f
util.strbitop: Remove redundant init function
...
When you have 3 almost identical functions, you tend to edit one and
then copypaste. Forgot to remove this line from the other two.
5 years ago
Kim Alvefur
da8eca639a
util.strbitop: Create buffer in the correct size (optimization)
...
This avoids dynamically growing the buffer as Lua does when luaL_addchar
is used, thus saving on realloc calls.
5 years ago
Kim Alvefur
d5161fbf6f
util.strbitop: Add tests covering basics
...
Also as docs
5 years ago
Kim Alvefur
539255c692
util.strbitop: Reformat code
...
astyle \
--indent=tab \
--attach-classes \
--indent-switches \
--break-blocks \
--pad-oper \
--unpad-paren \
--add-braces \
--align-pointer=name \
--lineend=linux \
*.c
5 years ago
Matthew Wild
64856637ce
net.websocket.frames: Add test for empty frame with MASK and key set
5 years ago
Kim Alvefur
00bad1a9fe
net.websocket.frames: Use C string XOR implementation
5 years ago
Kim Alvefur
203b48b127
util.sasl.scram: Use util.strbitop for XOR step
6 years ago
Kim Alvefur
4d1b9f7c60
Merge 0.11->trunk
5 years ago
Kim Alvefur
66f3fe9d12
Merge 0.11->trunk
5 years ago
Matthew Wild
4f4140fbc3
Merge 0.11->trunk
5 years ago
Matthew Wild
58e33e3995
util.error: Pass through existing error objects passed to new()
5 years ago
Matthew Wild
7672305919
Merge 0.11->trunk
5 years ago
Matthew Wild
518904b66c
net.http.server: Don't send Content-Length on 1xx/204 responses, per RFC ( fixes #1596 )
5 years ago
Kim Alvefur
b0393fe9e1
Merge 0.11->trunk
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
Kim Alvefur
d3b3e21720
util.dbuffer: Expose length as :len() method, like strings
...
Ref #1598
5 years ago
Kim Alvefur
b4af560c97
mod_http_errors: Remove 'extra' element when empty
5 years ago
Kim Alvefur
6518e5f41b
mod_http_errors: Dark theme!
5 years ago
Kim Alvefur
09e8795afb
mod_http_errors: Use a class on extra data section
...
This CSS selector makes it awkward to add more items.
5 years ago
Matthew Wild
c07d15cf71
util.startup: Handle missing nparams field from debug info (not present in 5.1)
5 years ago
Kim Alvefur
bb3948c857
core.modulemanager: Fix error if installer path missing
...
Happens if run outside prosody. Noticed because because the storage
tests fail.
5 years ago
Kim Alvefur
c5933e9ed7
util.startup: Include arguments in function string representation
...
Improves usability of the console when digging around the internals.
No specific rationale for the function<file:line>(args) format, it
looked best of the variants I tried.
5 years ago
Kim Alvefur
9302a14d80
util.startup: Retrieve less data for function string representation
...
debug.getinfo(f) collects more info than what is needed here.
5 years ago
Kim Alvefur
d53dcee890
core.moduleapi: Return resource path from module:get_directory() (API BC)
...
:get_directory has so far returned the base directory of the current
module source code. This has worked well so far to load resources which
tend to be included in the same directory, but with the plugin installer
using LuaRocks, extra resources (e.g. templates and other assets) these
are saved in a completely different directory.
In be73df6765b9 core.modulemanager gained some code for finding that
directory and saving it in module.resource_path but now the question is
how this should be reflected in the API.
A survey of community modules suggest the vast majority use the
:get_directory method for locating templates and other assets, rather
than the code (which would use module:require instead).
Therefore this commit changes :get_directory to return the resource_path
when available. This should work for most modules.
5 years ago
Kim Alvefur
387a03e1d3
core.modulemanager: Add compat for LuaRocks 2.x
5 years ago
Kim Alvefur
58be93c184
core.moduleapi: Use resource path for :load_resource()
5 years ago
Kim Alvefur
915cebae96
core.modulemanager: Locate resources of LuaRocks-installed modules
...
Extra non-code files included with a `copy_directories` directive in a
LuaRocks manifest will be copied into a per-module and per-version
directory under /lib/luarocks/ and all this is there to dig that out so
it can be used in e.g. moduleapi :load_resource().
5 years ago
Kim Alvefur
f7f0a20abf
util.startup: Save the path used by the installer to prosody.paths
...
Makes it easier for other parts of the code to use this for things, such
as determining whether a certain module is from this path or from
elsewhere.
5 years ago
Kim Alvefur
0ffb4b8932
Merge 0.11->trunk
5 years ago
Kim Alvefur
0e0a75de4e
MUC: Preserve disco 'node' attribute (or lack thereof) in response ( fix #1595 ) (thanks lessthan3)
5 years ago
Kim Alvefur
a1bb944f52
Merge 0.11->trunk
5 years ago
Kim Alvefur
c91cc915b6
util.dependencies: Check for bitop library same way as net.websocket.frames ( fixes #1594 )
5 years ago
Kim Alvefur
4b4f32104f
util.startup: Fix startup failure if CFG_DATADIR is unset
...
As is normal when running from source
5 years ago
Kim Alvefur
defba34a6c
util.startup: Re-enable installer path setup
5 years ago
Kim Alvefur
e9c3e1dedc
util.startup: Put 'installer_plugin_path' under data directory by default
...
Fixes issue where it ends up creating this in $PWD, which might be
~prosody, ~you or /, depending on how it's invoked.
5 years ago
Kim Alvefur
ef24d8cd72
util.prosodyctl: Simplify luarocks invocation
5 years ago
Kim Alvefur
42eec522a3
util.prosodyctl: Get Luarocks server from config
5 years ago
Kim Alvefur
28aadca557
util.prosodyctl: Move hardcoded luarocks server into prosodyctl
...
To be replaced with config option in future commit
5 years ago
Kim Alvefur
b74859e35c
util.prosodyctl: Flip argument order
...
"verb subject" feels better than "subject verb", especially since the
subject (module) is optional.
5 years ago