setLuaSideEffect();
g_policy.setState(policy);
});
- g_lua.writeFunction("setServerPolicyLua", [](string name, policy_t policy) {
+ g_lua.writeFunction("setServerPolicyLua", [](string name, policyfunc_t policy) {
setLuaSideEffect();
g_policy.setState(ServerPolicy{name, policy});
});
g_lua.registerMember("name", &ServerPolicy::name);
g_lua.registerMember("policy", &ServerPolicy::policy);
- g_lua.writeFunction("newServerPolicy", [](string name, policy_t policy) { return ServerPolicy{name, policy};});
+ g_lua.writeFunction("newServerPolicy", [](string name, policyfunc_t policy) { return ServerPolicy{name, policy};});
g_lua.writeVariable("firstAvailable", ServerPolicy{"firstAvailable", firstAvailable});
g_lua.writeVariable("roundrobin", ServerPolicy{"roundrobin", roundrobin});
g_lua.writeVariable("wrandom", ServerPolicy{"wrandom", wrandom});
};
using NumberedServerVector = NumberedVector<shared_ptr<DownstreamState>>;
-typedef std::function<shared_ptr<DownstreamState>(const NumberedServerVector& servers, const ComboAddress& remote, const DNSName& qname, uint16_t qtype, dnsheader* dh)> policy_t;
+typedef std::function<shared_ptr<DownstreamState>(const NumberedServerVector& servers, const ComboAddress& remote, const DNSName& qname, uint16_t qtype, dnsheader* dh)> policyfunc_t;
struct ServerPolicy
{
string name;
- policy_t policy;
+ policyfunc_t policy;
};
struct CarbonConfig