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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(); });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Right - thanks! Updated.

Copy link
Member

@rgacogne rgacogne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rgacogne rgacogne merged commit 739e431 into PowerDNS:master Aug 3, 2018
@phonedph1 phonedph1 deleted the getoutstanding branch August 23, 2023 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants