Vsevolod Stakhov
75327b3889
[Project] Convert the remaining
3 kuukautta sitten
Vsevolod Stakhov
537a7180a0
[Rework] Use clang-format to unify formatting in all sources
No meaningful changes.
11 kuukautta sitten
Vsevolod Stakhov
dccf92aa82
[Feature] Allow lua_http module to accept upstreams
2 vuotta sitten
Vsevolod Stakhov
49768177cf
[Minor] Allow to get a port for a specific upstream
2 vuotta sitten
Vsevolod Stakhov
51a37928e9
[Minor] Lua_upstream: Add get_name method
2 vuotta sitten
Vsevolod Stakhov
0d49f9163e
[Fix] Store reference of upstream list in upstreams objects
3 vuotta sitten
Vsevolod Stakhov
684996ee80
[Minor] Add failure reason in the upstreams code
4 vuotta sitten
Vsevolod Stakhov
5ef148649d
[Rework] Lua core: Use lightuserdata to index classes
4 vuotta sitten
Vsevolod Stakhov
eb5fc65aca
[Fix] Do not use lightuserdata for traceback
LuaJIT limits lightuserdata usage to 47 bits. On Arm64, this leads to
break of the C <-> Lua interoperability using this type.
This rework has changed traceback function behaviour from lightuserdata
opaque pointer (GString * in particular) to luaL_Buffer.
Issue: #2906
5 vuotta sitten
Vsevolod Stakhov
0f32df6f44
[Fix] Core: Fix address rotation bug
Previously, upstream.get_addr function returned the new address of the
upstream. Unfortunately, it was used for printing addresses. It caused
the following situation: let's imagine we have A1 and A2 where A1 was
initially selected. So the connection was performed to A1:
Current addr Selected addr
Connect+---------+ A2+------>A1 A1
|
+-+Print failure<---+ A1+------>A2 A2
| +----+
+->Mark failure+-------->+ A2 |
+----+
But the failure OP as well as log message told about `A2` where the real
problem happened with `A1`.
This commit adds distinguishing between getting the next and the current
address of the upstream resolving this issue.
5 vuotta sitten
Vsevolod Stakhov
70d859cede
[Feature] Allow to add upstream watchers to Lua API
5 vuotta sitten
Vsevolod Stakhov
084dc96bc5
[Feature] Add support for Lua API tracing
5 vuotta sitten
Vsevolod Stakhov
1812d38cb8
[Feature] Distinguish IP failures from connection failures
6 vuotta sitten
Vsevolod Stakhov
3f86aa3aaf
[Minor] Fix table argument parsing
6 vuotta sitten
Vsevolod Stakhov
7d3f1e1663
[Minor] Fix upstreams parsing
6 vuotta sitten
Vsevolod Stakhov
4b7e987b91
[Minor] Allow to create upstream lists without rspamd_config
6 vuotta sitten
Vsevolod Stakhov
9d99bef124
[Minor] Allow to get all upstreams from the list in Lua
6 vuotta sitten
Vsevolod Stakhov
71d52e806a
[Minor] Fix various style issues
7 vuotta sitten
Vsevolod Stakhov
dedb850663
[Feature] Use rspamd specific type checks for userdata
8 vuotta sitten
Vsevolod Stakhov
c2cbcd8d98
Fix some issues found by coverity
8 vuotta sitten
Vsevolod Stakhov
8766fba694
Switch the rest to apache 2
8 vuotta sitten
Vsevolod Stakhov
f3ac408594
Use new rotation logic in the code
8 vuotta sitten
Vsevolod Stakhov
13cb93001a
Fix upstreams usage
8 vuotta sitten
Vsevolod Stakhov
c137be80df
Avoid non-portable lua integers.
9 vuotta sitten
Vsevolod Stakhov
cf28be3242
Forgot @module.
9 vuotta sitten
Vsevolod Stakhov
72c673cf28
Document lua upstream.
9 vuotta sitten
Vsevolod Stakhov
bbec275025
Fix lua upstream code.
9 vuotta sitten
Vsevolod Stakhov
919a59426b
Use rspamd_ prefix.
9 vuotta sitten
Vsevolod Stakhov
c2765b3eb3
Use modules preload for lua.
9 vuotta sitten
Vsevolod Stakhov
df48f709f8
Rework lua function names to avoid ambiguity.
10 vuotta sitten
Vsevolod Stakhov
379055dbbb
Unify style without sorting headers.
10 vuotta sitten
Vsevolod Stakhov
fe79d8c5a3
Revert "Unify code style."
This reverts commit e0483657ff
.
10 vuotta sitten
Vsevolod Stakhov
e0483657ff
Unify code style.
10 vuotta sitten
Vsevolod Stakhov
d6643f35d7
Refactor config API.
10 vuotta sitten
Vsevolod Stakhov
7cc8754ad9
Adopt to lua 5.2.
11 vuotta sitten
Vsevolod Stakhov
e2bc828fdd
Avoid arrays addresses manipulation.
11 vuotta sitten
Vsevolod Stakhov
37845898cb
Rework socket creation logic to support both ipv4 and ipv6 sockets.
11 vuotta sitten
Vsevolod Stakhov
e1a8ed5013
* Add lua worker type and lua worker bindings.
* Add lua utility library for basic utils.
* Fixes lua_buffer code.
Fix lua loading error.
Added some other lua utility functions.
12 vuotta sitten
Vsevolod Stakhov
efe165bc3d
* Add ratelimit plugin
Some polishing of lua task api.
12 vuotta sitten
Vsevolod Stakhov
7e440d6f43
* Add lua bindings for upstream API.
12 vuotta sitten