-
Notifications
You must be signed in to change notification settings - Fork 795
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
Fix off by one error in frontier req server #1992
Fix off by one error in frontier req server #1992
Conversation
Any idea why the test is failing? I cannot see how it would be related to my code. The test |
|
If the wanted count is 1, and you run the code, the following happens:
So the server will send 2 results and then exit if I have understood the code correctly. There should probably be a test for this as well, but I'm not very good at C++ and I couldn't even get the project to build on my mac, so it's a bit hard to write and check a test.. |
Tests are passing on travis here: https://travis-ci.org/orhanhenrik/nano-node, so I'm not sure what's wrong with this test run. Maybe a race condition in the code? |
I see, send_next is initially called from the visitor. This looks like it'll fix it. I think clients currently always use max here (2^31-1), which might be why tests doesn't pick it up. We can look into fixing the test in a separate PR. The test failure is unrelated, probably one of the tests failing intermittently on CI. |
Yeah, I noticed that max is always used. I’m writing a separate node implementation and was getting the wrong number of results, so that’s how I found this minor bug. |
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.
LGTM
The current implementation will send 1 too many items, since count starts at 0.