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

Make getOutstanding be usable from both lua and console #6826

Merged
merged 2 commits into from Aug 3, 2018

Conversation

Projects
None yet
2 participants
@phonedph1
Contributor

phonedph1 commented Aug 1, 2018

Short description

So that we can do sketchy things with it from maintenance and luarule actions.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
@rgacogne

Thanks for this PR! Looks good except for one minor nit.

@@ -105,7 +105,7 @@ void setupLuaBindings(bool client)
g_pools.setState(localPools);
s->pools.erase(pool);
});
g_lua.registerFunction<void(DownstreamState::*)()>("getOutstanding", [](const DownstreamState& s) { g_outputBuffer=std::to_string(s.outstanding.load()); });
g_lua.registerFunction<int(DownstreamState::*)()>("getOutstanding", [](const DownstreamState& s) { return s.outstanding.load(); });

This comment has been minimized.

@rgacogne

rgacogne Aug 2, 2018

Member

If you don't mind, please make the return value the same type than the outstanding member (uint64_t) otherwise we'll likely have conversion issues down the road.

@rgacogne rgacogne added this to the dnsdist-1.4.0 milestone Aug 2, 2018

@phonedph1

This comment has been minimized.

Contributor

phonedph1 commented Aug 2, 2018

Right - thanks! Updated.

@rgacogne

LGTM!

@rgacogne rgacogne merged commit 739e431 into PowerDNS:master Aug 3, 2018

4 checks passed

LGTM analysis: C/C++ No alert changes
Details
LGTM analysis: JavaScript No alert changes
Details
LGTM analysis: Python No alert changes
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment