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

fix: handle empty keys #562

Merged
merged 1 commit into from
Apr 7, 2020
Merged

fix: handle empty keys #562

merged 1 commit into from
Apr 7, 2020

Conversation

Stebalien
Copy link
Member

Handle empty keys, both when sent in RPC requests and in the local API.

@Stebalien Stebalien requested a review from willscott April 6, 2020 23:43
defer func() {
for i := 0; i < nDHTs; i++ {
dhts[i].Close()
defer dhts[i].host.Close()
Copy link
Contributor

Choose a reason for hiding this comment

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

the need for this defer seems like a bit of black magic, no? is there a reason the hosts need to all be closed after the dhts?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe? I really don't know. I'm just copying other tests.

ctx, cancel := context.WithCancel(context.Background())
defer cancel()

nDHTs := 2
Copy link
Contributor

Choose a reason for hiding this comment

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

Worth having a function parameterized on this and then run the test with a 2 node and a >2 node instance?

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably not. This test just cares about having at least one other node so the routing table isn't empty.

Handle empty keys, both when sent in RPC requests and in the local API.
@Stebalien Stebalien merged commit 6c82b40 into master Apr 7, 2020
@Stebalien Stebalien deleted the fix/handle-empty-keys branch April 7, 2020 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants