-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnsdist: Implement LuaFFIRule, LuaFFIAction and LuaFFIResponseAction #8505
Conversation
I also spotted some remaining debug messages in the code :-) |
This pull request introduces 1 alert when merging 4eea956 into 930ed0c - view on LGTM.com new alerts:
|
d4f7597
to
cacc770
Compare
0129700
to
075f948
Compare
Rebased to fix conflicts. |
Using a sorted vector provides a much faster lookup time than a std::set when the number of points on the circle (weight of the backend) is huge. A boost::flat_set is almost as fast as a sorted vector but the insertion time is quite bad.
075f948
to
8eb84a5
Compare
@@ -172,6 +174,29 @@ void setupLuaBindings(bool client) | |||
|
|||
/* ComboAddress */ | |||
g_lua.writeFunction("newCA", [](const std::string& name) { return ComboAddress(name); }); | |||
g_lua.writeFunction("newCAFromRaw", [](const std::string& raw, boost::optional<uint16_t> port) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe document the new functions introduced here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is very specific to what we do with our own Lua FFI code, I'll ponder if it's worth documenting it.
Thanks a lot for the review! |
…erface.h Reported by LGTM.
80364a8
to
c0e86fc
Compare
Short description
This PR implements:
LuaFFIRule
: to be able to write a query/response selector inLua
using the FFI interface ;LuaFFIAction
: to be able to write actions inLua
using the FFI interface ;LuaFFIResponseAction
: to be able to write response actions inLua
using the FFI interface ;LuaRule()
: to be able to write a query/response selector inLua
(non-FFI version) ;setServerPolicyLuaFFI
: to be able to write server load-balancing policies inLua
using the FFI interface.It also refactor the code around the server selection policies and backends, slightly speeding up some of the built-in C++ policies in the process, and adding unit tests for them.
Closes #7617.
Checklist
I have: