Skip to content
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

@phonedph1
Copy link
Contributor

@phonedph1 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)
Copy link
Member

@rgacogne rgacogne left a comment

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.

@phonedph1
Copy link
Contributor Author

@phonedph1 phonedph1 commented Aug 2, 2018

Right - thanks! Updated.

Copy link
Member

@rgacogne rgacogne left a comment

LGTM!

@rgacogne rgacogne merged commit 739e431 into PowerDNS:master Aug 3, 2018
4 checks passed
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants